From 69161b5f94b5473de1fc68833ca9647e975b46cd Mon Sep 17 00:00:00 2001 From: jbroman Date: Fri, 17 Mar 2017 07:48:20 -0700 Subject: [PATCH] deps: backport 3700a01c82 from upstream v8 Original commit message: Make v8::Eternal::Get and IsEmpty const. They do not modify the state of the handle. Review-Url: https://codereview.chromium.org/2753973002 Cr-Commit-Position: refs/heads/master@{#43907} Ref: https://github.com/v8/v8/commit/3700a01c82 PR-URL: https://github.com/nodejs/node/pull/12875 Reviewed-By: James M Snell --- deps/v8/include/v8.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index a3715211f03d3b..fe374089f67706 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -366,8 +366,8 @@ template class Eternal { Set(isolate, handle); } // Can only be safely called if already set. - V8_INLINE Local Get(Isolate* isolate); - V8_INLINE bool IsEmpty() { return index_ == kInitialValue; } + V8_INLINE Local Get(Isolate* isolate) const; + V8_INLINE bool IsEmpty() const { return index_ == kInitialValue; } template V8_INLINE void Set(Isolate* isolate, Local handle); private: @@ -8604,9 +8604,8 @@ void Eternal::Set(Isolate* isolate, Local handle) { V8::Eternalize(isolate, reinterpret_cast(*handle), &this->index_); } - -template -Local Eternal::Get(Isolate* isolate) { +template +Local Eternal::Get(Isolate* isolate) const { return Local(reinterpret_cast(*V8::GetEternal(isolate, index_))); }