Skip to content

Commit 3700a01

Browse files
jeremyromanCommit bot
authored andcommitted
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}
1 parent 9f720a6 commit 3700a01

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

include/v8.h

Lines changed: 4 additions & 5 deletions
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:
@@ -8644,9 +8644,8 @@ void Eternal<T>::Set(Isolate* isolate, Local<S> handle) {
86448644
V8::Eternalize(isolate, reinterpret_cast<Value*>(*handle), &this->index_);
86458645
}
86468646

8647-
8648-
template<class T>
8649-
Local<T> Eternal<T>::Get(Isolate* isolate) {
8647+
template <class T>
8648+
Local<T> Eternal<T>::Get(Isolate* isolate) const {
86508649
return Local<T>(reinterpret_cast<T*>(*V8::GetEternal(isolate, index_)));
86518650
}
86528651

0 commit comments

Comments
 (0)