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