Skip to content

Commit 69161b5

Browse files
jeremyromanjasnell
authored andcommitted
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: v8/v8@3700a01c82 PR-URL: #12875 Reviewed-By: James M Snell <[email protected]>
1 parent 9edd6d8 commit 69161b5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

deps/v8/include/v8.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ template <class T> class Eternal {
366366
Set(isolate, handle);
367367
}
368368
// Can only be safely called if already set.
369-
V8_INLINE Local<T> Get(Isolate* isolate);
370-
V8_INLINE bool IsEmpty() { return index_ == kInitialValue; }
369+
V8_INLINE Local<T> Get(Isolate* isolate) const;
370+
V8_INLINE bool IsEmpty() const { return index_ == kInitialValue; }
371371
template<class S> V8_INLINE void Set(Isolate* isolate, Local<S> handle);
372372

373373
private:
@@ -8604,9 +8604,8 @@ void Eternal<T>::Set(Isolate* isolate, Local<S> handle) {
86048604
V8::Eternalize(isolate, reinterpret_cast<Value*>(*handle), &this->index_);
86058605
}
86068606

8607-
8608-
template<class T>
8609-
Local<T> Eternal<T>::Get(Isolate* isolate) {
8607+
template <class T>
8608+
Local<T> Eternal<T>::Get(Isolate* isolate) const {
86108609
return Local<T>(reinterpret_cast<T*>(*V8::GetEternal(isolate, index_)));
86118610
}
86128611

0 commit comments

Comments
 (0)