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

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: Add test for attaching via Context::New Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/object-observe.js ('k') | src/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 } 1746 }
1747 1747
1748 1748
1749 void JSObject::EnqueueChangeRecord(Handle<JSObject> object, 1749 void JSObject::EnqueueChangeRecord(Handle<JSObject> object,
1750 const char* type_str, 1750 const char* type_str,
1751 Handle<String> name, 1751 Handle<String> name,
1752 Handle<Object> old_value) { 1752 Handle<Object> old_value) {
1753 Isolate* isolate = object->GetIsolate(); 1753 Isolate* isolate = object->GetIsolate();
1754 HandleScope scope; 1754 HandleScope scope;
1755 Handle<String> type = isolate->factory()->LookupAsciiSymbol(type_str); 1755 Handle<String> type = isolate->factory()->LookupAsciiSymbol(type_str);
1756 if (object->IsJSGlobalObject()) {
1757 object = handle(JSGlobalObject::cast(*object)->global_receiver(), isolate);
1758 }
1756 Handle<Object> args[] = { type, object, name, old_value }; 1759 Handle<Object> args[] = { type, object, name, old_value };
1757 bool threw; 1760 bool threw;
1758 Execution::Call(Handle<JSFunction>(isolate->observers_notify_change()), 1761 Execution::Call(Handle<JSFunction>(isolate->observers_notify_change()),
1759 Handle<Object>(isolate->heap()->undefined_value()), 1762 Handle<Object>(isolate->heap()->undefined_value()),
1760 old_value->IsTheHole() ? 3 : 4, args, 1763 old_value->IsTheHole() ? 3 : 4, args,
1761 &threw); 1764 &threw);
1762 ASSERT(!threw); 1765 ASSERT(!threw);
1763 } 1766 }
1764 1767
1765 1768
(...skipping 12115 matching lines...) Expand 10 before | Expand all | Expand 10 after
13881 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13884 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13882 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13885 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13883 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13886 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13884 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13887 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13885 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13888 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13886 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13889 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13887 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13890 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13888 } 13891 }
13889 13892
13890 } } // namespace v8::internal 13893 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/object-observe.js ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698