Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2199)

Unified Diff: src/runtime/runtime-object.cc

Issue 1879053003: Replace DefineIndexedProperty with %CreateDataProperty (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index 5bdb08541f18d5075b5140dceea9d1fba4a88636..10bc3cdbb2515d0566f9b48a509cffe3ff984677 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -1238,6 +1238,21 @@ RUNTIME_FUNCTION(Runtime_ObjectDefineProperty) {
return JSReceiver::DefineProperty(isolate, o, name, attributes);
}
+RUNTIME_FUNCTION(Runtime_CreateDataProperty) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 3);
+ CONVERT_ARG_HANDLE_CHECKED(JSReceiver, o, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, key, 1);
+ CONVERT_ARG_HANDLE_CHECKED(Object, value, 2);
+ bool success;
+ LookupIterator it = LookupIterator::PropertyOrElement(
+ isolate, o, key, &success, LookupIterator::HIDDEN);
+ if (!success) return isolate->heap()->exception();
+ MAYBE_RETURN(
+ JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR),
+ isolate->heap()->exception());
+ return *value;
+}
RUNTIME_FUNCTION(Runtime_ObjectDefineProperties) {
HandleScope scope(isolate);
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698