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

Unified Diff: src/object-observe.js

Issue 18221006: Add map transition for observed objects (Closed) Base URL: https://github.com/v8/v8.git@bleeding_edge
Patch Set: better check Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap.cc ('k') | src/objects.h » ('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 ada7919d6dd215f6d49470f30dca230d14f02d83..90c9a699e0569281ca3d415f880e04c21423600e 100644
--- a/src/object-observe.js
+++ b/src/object-observe.js
@@ -216,8 +216,10 @@ function ObjectObserve(object, callback, accept) {
}
var objectInfo = objectInfoMap.get(object);
- if (IS_UNDEFINED(objectInfo)) objectInfo = CreateObjectInfo(object);
- %SetIsObserved(object, true);
+ if (IS_UNDEFINED(objectInfo)) {
+ objectInfo = CreateObjectInfo(object);
+ %SetIsObserved(object);
+ }
EnsureObserverRemoved(objectInfo, callback);
@@ -241,12 +243,6 @@ function ObjectUnobserve(object, callback) {
return object;
EnsureObserverRemoved(objectInfo, callback);
-
- if (objectInfo.changeObservers.length === 0 &&
- objectInfo.inactiveObservers.length === 0) {
- %SetIsObserved(object, false);
- }
-
return object;
}
« no previous file with comments | « src/heap.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698