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

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

Issue 1378323003: [runtime-object]: part fix element key list on global object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | test/mjsunit/global.js » ('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 2e3fea2bb4282724e3c630c32374bf0210ecd9ee..a97fff848eb3354b08b138282c961a56f5f6aceb 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -896,11 +896,19 @@ RUNTIME_FUNCTION(Runtime_GetOwnElementNames) {
if (!args[0]->IsJSObject()) {
return isolate->heap()->undefined_value();
}
- CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
+
+ // TODO(cbruni): implement proper prototype lookup like in GetOwnPropertyNames
+ if (object->IsJSGlobalProxy()) {
Toon Verwaest 2015/10/01 15:22:47 The JSGlobalProxy might be detached. In that case
+ PrototypeIterator iter(isolate, object,
+ PrototypeIterator::START_AT_RECEIVER);
+ iter.Advance();
+ object = PrototypeIterator::GetCurrent<JSObject>(iter);
+ }
- int n = obj->NumberOfOwnElements(NONE);
+ int n = object->NumberOfOwnElements(NONE);
Handle<FixedArray> names = isolate->factory()->NewFixedArray(n);
- obj->GetOwnElementKeys(*names, NONE);
+ object->GetOwnElementKeys(*names, NONE);
return *isolate->factory()->NewJSArrayWithElements(names);
}
« no previous file with comments | « no previous file | test/mjsunit/global.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698