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

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

Issue 653023004: Work in progress: allow pause-on-exceptions to work in Object.observe callbacks (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/isolate.cc ('k') | src/runtime/runtime-debug.cc » ('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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 CallbackInfoSet(callback, priority); 564 CallbackInfoSet(callback, priority);
565 565
566 var pendingObservers = GetPendingObservers(); 566 var pendingObservers = GetPendingObservers();
567 if (!IS_NULL(pendingObservers)) 567 if (!IS_NULL(pendingObservers))
568 delete pendingObservers[priority]; 568 delete pendingObservers[priority];
569 569
570 var delivered = []; 570 var delivered = [];
571 %MoveArrayContents(callbackInfo, delivered); 571 %MoveArrayContents(callbackInfo, delivered);
572 572
573 try { 573 try {
574 %DebugPushPromise(null);
aandrey 2014/10/30 10:53:01 But should not we patch Isolate::DoThrow() instead
574 %_CallFunction(UNDEFINED, delivered, callback); 575 %_CallFunction(UNDEFINED, delivered, callback);
575 } catch (ex) {} // TODO(rossberg): perhaps log uncaught exceptions. 576 } catch (ex) {
577 // TODO(rossberg): perhaps log uncaught exceptions.
578 } finally {
579 %DebugPopPromise();
580 }
576 return true; 581 return true;
577 } 582 }
578 583
579 function ObjectDeliverChangeRecords(callback) { 584 function ObjectDeliverChangeRecords(callback) {
580 if (!IS_SPEC_FUNCTION(callback)) 585 if (!IS_SPEC_FUNCTION(callback))
581 throw MakeTypeError("observe_non_function", ["deliverChangeRecords"]); 586 throw MakeTypeError("observe_non_function", ["deliverChangeRecords"]);
582 587
583 while (CallbackDeliverPending(callback)) {} 588 while (CallbackDeliverPending(callback)) {}
584 } 589 }
585 590
(...skipping 19 matching lines...) Expand all
605 "observe", ArrayObserve, 610 "observe", ArrayObserve,
606 "unobserve", ArrayUnobserve 611 "unobserve", ArrayUnobserve
607 )); 612 ));
608 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( 613 InstallFunctions(notifierPrototype, DONT_ENUM, $Array(
609 "notify", ObjectNotifierNotify, 614 "notify", ObjectNotifierNotify,
610 "performChange", ObjectNotifierPerformChange 615 "performChange", ObjectNotifierPerformChange
611 )); 616 ));
612 } 617 }
613 618
614 SetupObjectObserve(); 619 SetupObjectObserve();
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698