Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index a63255a931090e60b01e5caf48e2747cdc9a7c97..2481e350e7dadb0dc577181862fc94a768d3118e 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -6572,6 +6572,18 @@ Maybe<bool> JSReceiver::ValidateAndApplyPropertyDescriptor( |
return Just(true); |
} |
+// static |
+Maybe<bool> JSReceiver::CreateDataProperty(Handle<JSReceiver> holder, |
Yang
2017/03/23 14:58:22
Does JSObject::AddProperty not fit the purpose? We
jgruber
2017/03/24 14:06:46
Good point, CreateDataProperty ends up calling tha
|
+ Handle<Object> key, |
+ Handle<Object> value, |
+ ShouldThrow should_throw) { |
+ Isolate* isolate = holder->GetIsolate(); |
+ bool success; |
+ LookupIterator it = LookupIterator::PropertyOrElement( |
+ isolate, holder, key, &success, LookupIterator::OWN); |
+ if (!success) return Nothing<bool>(); |
+ return JSReceiver::CreateDataProperty(&it, value, should_throw); |
+} |
// static |
Maybe<bool> JSReceiver::CreateDataProperty(LookupIterator* it, |