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

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

Issue 795573005: ES6 computed property names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup tests a bit Created 6 years 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-classes.cc ('k') | src/typing.cc » ('j') | 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 617644c49efbf5199a24ad66ca7fc2ed1ce34b77..a05c6dbc0eabb55aee1191238f54775836df788c 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -1605,5 +1605,35 @@ RUNTIME_FUNCTION(RuntimeReference_ClassOf) {
if (!obj->IsJSReceiver()) return isolate->heap()->null_value();
return JSReceiver::cast(obj)->class_name();
}
+
+
+RUNTIME_FUNCTION(Runtime_DefineGetterPropertyUnchecked) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 3);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, getter, 2);
+
+ RETURN_FAILURE_ON_EXCEPTION(
+ isolate,
+ JSObject::DefineAccessor(object, name, getter,
+ isolate->factory()->null_value(), NONE));
+ return isolate->heap()->undefined_value();
+}
+
+
+RUNTIME_FUNCTION(Runtime_DefineSetterPropertyUnchecked) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 3);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, setter, 2);
+
+ RETURN_FAILURE_ON_EXCEPTION(
+ isolate,
+ JSObject::DefineAccessor(object, name, isolate->factory()->null_value(),
+ setter, NONE));
+ return isolate->heap()->undefined_value();
+}
}
} // namespace v8::internal
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | src/typing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698