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

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

Issue 1181733002: Revert of Replace SetObjectProperty / DefineObjectProperty with less powerful alternatives where relevant. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-classes.cc
diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc
index fe76dfa0dd2564c9787cb9d806084cb74eea4f23..3dbcc65eca6af1e5e5e9a0f80009d18dd8a73640 100644
--- a/src/runtime/runtime-classes.cc
+++ b/src/runtime/runtime-classes.cc
@@ -200,8 +200,16 @@
CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 2);
- RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::DefinePropertyOrElement(
- object, name, function, DONT_ENUM));
+ uint32_t index;
+ if (name->AsArrayIndex(&index)) {
+ RETURN_FAILURE_ON_EXCEPTION(
+ isolate, JSObject::SetOwnElementIgnoreAttributes(object, index,
+ function, DONT_ENUM));
+ } else {
+ RETURN_FAILURE_ON_EXCEPTION(
+ isolate, JSObject::SetOwnPropertyIgnoreAttributes(object, name,
+ function, DONT_ENUM));
+ }
return isolate->heap()->undefined_value();
}
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698