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

Side by Side Diff: src/object-observe.js

Issue 351853005: Split SetProperty(...attributes, strictmode) into AddProperty(...attributes) and SetProperty(...… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/promise.js » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 "use strict"; 5 "use strict";
6 6
7 // Overview: 7 // Overview:
8 // 8 //
9 // This file contains all of the routing and accounting for Object.observe. 9 // This file contains all of the routing and accounting for Object.observe.
10 // User code will interact with these mechanisms via the Object.observe APIs 10 // User code will interact with these mechanisms via the Object.observe APIs
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 if (!ObjectInfoHasActiveObservers(objectInfo)) 431 if (!ObjectInfoHasActiveObservers(objectInfo))
432 return; 432 return;
433 433
434 var hasType = !IS_UNDEFINED(type); 434 var hasType = !IS_UNDEFINED(type);
435 var newRecord = hasType ? 435 var newRecord = hasType ?
436 { object: ObjectInfoGetObject(objectInfo), type: type } : 436 { object: ObjectInfoGetObject(objectInfo), type: type } :
437 { object: ObjectInfoGetObject(objectInfo) }; 437 { object: ObjectInfoGetObject(objectInfo) };
438 438
439 for (var prop in changeRecord) { 439 for (var prop in changeRecord) {
440 if (prop === 'object' || (hasType && prop === 'type')) continue; 440 if (prop === 'object' || (hasType && prop === 'type')) continue;
441 %DefineOrRedefineDataProperty(newRecord, prop, changeRecord[prop], 441 %AddProperty(newRecord, prop, changeRecord[prop], READ_ONLY + DONT_DELETE);
442 READ_ONLY + DONT_DELETE);
443 } 442 }
444 ObjectFreezeJS(newRecord); 443 ObjectFreezeJS(newRecord);
445 444
446 ObjectInfoEnqueueInternalChangeRecord(objectInfo, newRecord); 445 ObjectInfoEnqueueInternalChangeRecord(objectInfo, newRecord);
447 } 446 }
448 447
449 function ObjectInfoEnqueueInternalChangeRecord(objectInfo, changeRecord) { 448 function ObjectInfoEnqueueInternalChangeRecord(objectInfo, changeRecord) {
450 // TODO(rossberg): adjust once there is a story for symbols vs proxies. 449 // TODO(rossberg): adjust once there is a story for symbols vs proxies.
451 if (IS_SYMBOL(changeRecord.name)) return; 450 if (IS_SYMBOL(changeRecord.name)) return;
452 451
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 "observe", ArrayObserve, 631 "observe", ArrayObserve,
633 "unobserve", ArrayUnobserve 632 "unobserve", ArrayUnobserve
634 )); 633 ));
635 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( 634 InstallFunctions(notifierPrototype, DONT_ENUM, $Array(
636 "notify", ObjectNotifierNotify, 635 "notify", ObjectNotifierNotify,
637 "performChange", ObjectNotifierPerformChange 636 "performChange", ObjectNotifierPerformChange
638 )); 637 ));
639 } 638 }
640 639
641 SetupObjectObserve(); 640 SetupObjectObserve();
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698