Index: gin/dictionary.h |
diff --git a/gin/dictionary.h b/gin/dictionary.h |
index 972108fbb438f72608f4f9a52d4fd7e6d6e2f218..b03153fca9a0f8a6670810a638e3b1ed20ffb050 100644 |
--- a/gin/dictionary.h |
+++ b/gin/dictionary.h |
@@ -32,13 +32,19 @@ class GIN_EXPORT Dictionary { |
template<typename T> |
bool Get(const std::string& key, T* out) { |
- v8::Handle<v8::Value> val = object_->Get(StringToV8(isolate_, key)); |
+ v8::Local<v8::Value> val; |
+ if (!object_->Get(isolate_->GetCurrentContext(), StringToV8(isolate_, key)) |
+ .ToLocal(&val)) |
+ return false; |
return ConvertFromV8(isolate_, val, out); |
} |
template<typename T> |
bool Set(const std::string& key, T val) { |
- return object_->Set(StringToV8(isolate_, key), ConvertToV8(isolate_, val)); |
+ v8::Maybe<bool> result = |
+ object_->Set(isolate_->GetCurrentContext(), StringToV8(isolate_, key), |
+ ConvertToV8(isolate_, val)); |
+ return !result.IsNothing() && result.FromJust(); |
} |
v8::Isolate* isolate() const { return isolate_; } |