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

Unified Diff: src/objects.cc

Issue 11414094: Make Object.observe on the global object functional (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Test with reattaching to a different context Created 8 years, 1 month 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 05c00824009233bb90642c648d78d262f6a73e17..cb7b6eb9106583fd0c1e3e286a724e87f267aef2 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1749,6 +1749,9 @@ void JSObject::EnqueueChangeRecord(Handle<JSObject> object,
Isolate* isolate = object->GetIsolate();
HandleScope scope;
Handle<String> type = isolate->factory()->LookupAsciiSymbol(type_str);
+ if (object->IsJSGlobalObject()) {
+ object = handle(JSGlobalObject::cast(*object)->global_receiver(), isolate);
+ }
Handle<Object> args[] = { type, object, name, old_value };
bool threw;
Execution::Call(Handle<JSFunction>(isolate->observers_notify_change()),
« no previous file with comments | « src/object-observe.js ('k') | src/runtime.h » ('j') | test/cctest/test-object-observe.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698