Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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(); |
| OLD | NEW |