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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1742 } 1742 }
1743 1743
1744 1744
1745 void JSObject::EnqueueChangeRecord(Handle<JSObject> object, 1745 void JSObject::EnqueueChangeRecord(Handle<JSObject> object,
1746 const char* type_str, 1746 const char* type_str,
1747 Handle<String> name, 1747 Handle<String> name,
1748 Handle<Object> old_value) { 1748 Handle<Object> old_value) {
1749 Isolate* isolate = object->GetIsolate(); 1749 Isolate* isolate = object->GetIsolate();
1750 HandleScope scope; 1750 HandleScope scope;
1751 Handle<String> type = isolate->factory()->LookupAsciiSymbol(type_str); 1751 Handle<String> type = isolate->factory()->LookupAsciiSymbol(type_str);
1752 if (object->IsJSGlobalObject()) {
1753 object = handle(JSGlobalObject::cast(*object)->global_receiver(), isolate);
1754 }
1752 Handle<Object> args[] = { type, object, name, old_value }; 1755 Handle<Object> args[] = { type, object, name, old_value };
1753 bool threw; 1756 bool threw;
1754 Execution::Call(Handle<JSFunction>(isolate->observers_notify_change()), 1757 Execution::Call(Handle<JSFunction>(isolate->observers_notify_change()),
1755 Handle<Object>(isolate->heap()->undefined_value()), 1758 Handle<Object>(isolate->heap()->undefined_value()),
1756 old_value->IsTheHole() ? 3 : 4, args, 1759 old_value->IsTheHole() ? 3 : 4, args,
1757 &threw); 1760 &threw);
1758 ASSERT(!threw); 1761 ASSERT(!threw);
1759 } 1762 }
1760 1763
1761 1764
(...skipping 12117 matching lines...) Expand 10 before | Expand all | Expand 10 after
13879 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13882 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13880 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13883 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13881 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13884 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13882 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13885 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13883 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13886 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13884 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13887 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13885 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13888 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13886 } 13889 }
13887 13890
13888 } } // namespace v8::internal 13891 } } // namespace v8::internal
OLDNEW
« 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