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

Unified Diff: src/object-observe.js

Issue 11593028: Object.observe: Change semantics of deliverChangeRecords to iterate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 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 3ed27716837d9980a818f6c8d30cd665692eb78b..9f20f22b6955fcadd8532810b49a57bc76ea156e 100644
--- a/src/object-observe.js
+++ b/src/object-observe.js
@@ -197,11 +197,11 @@ function ObjectGetNotifier(object) {
function DeliverChangeRecordsForObserver(observer) {
var observerInfo = observerInfoMap.get(observer);
if (IS_UNDEFINED(observerInfo))
- return;
+ return false;
Yang 2012/12/19 09:37:06 This formatting looks very WebKit-ish. We usually
var pendingChangeRecords = observerInfo.pendingChangeRecords;
if (IS_NULL(pendingChangeRecords))
- return;
+ return false;
Yang 2012/12/19 09:37:06 Ditto.
observerInfo.pendingChangeRecords = null;
delete observationState.pendingObservers[observerInfo.priority];
@@ -210,13 +210,14 @@ function DeliverChangeRecordsForObserver(observer) {
try {
%Call(void 0, delivered, observer);
} catch (ex) {}
+ return true;
}
function ObjectDeliverChangeRecords(callback) {
if (!IS_SPEC_FUNCTION(callback))
throw MakeTypeError("observe_non_function", ["deliverChangeRecords"]);
- DeliverChangeRecordsForObserver(callback);
+ while (DeliverChangeRecordsForObserver(callback)) {}
}
function DeliverChangeRecords() {
« 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