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

Unified Diff: src/object-observe.js

Issue 11377171: Object.observe: Use [[DefineOwnProperty]] to create properties of changeRecord (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: 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
« no previous file with comments | « no previous file | test/mjsunit/harmony/object-observe.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/object-observe.js
diff --git a/src/object-observe.js b/src/object-observe.js
index 1b0a491a03215765b07ea6a9efa3a0988871daa0..c4c2009aa312a297fb8d112695ae1ef9b6f2214e 100644
--- a/src/object-observe.js
+++ b/src/object-observe.js
@@ -29,6 +29,7 @@
var InternalObjectIsFrozen = $Object.isFrozen;
var InternalObjectFreeze = $Object.freeze;
+var InternalObjectDefineProperty = $Object.defineProperty;
adamk 2012/11/14 22:32:24 Not sure these are worth it, at least not until we
rafaelw 2012/11/14 22:40:56 Removed. On 2012/11/14 22:32:24, adamk wrote:
var observationState = %GetObservationState();
if (IS_UNDEFINED(observationState.observerInfoMap)) {
@@ -164,7 +165,11 @@ function ObjectNotifierNotify(changeRecord) {
for (var prop in changeRecord) {
if (prop === 'object')
continue;
- newRecord[prop] = changeRecord[prop];
+
+ InternalObjectDefineProperty(newRecord, prop, {
+ value: changeRecord[prop],
+ enumerable: true
+ });
}
InternalObjectFreeze(newRecord);
« no previous file with comments | « no previous file | test/mjsunit/harmony/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698