| 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 var $observeEnqueueSpliceRecord; | 5 var $observeEnqueueSpliceRecord; |
| 6 var $observeBeginPerformSplice; | 6 var $observeBeginPerformSplice; |
| 7 var $observeEndPerformSplice; | 7 var $observeEndPerformSplice; |
| 8 | 8 |
| 9 var $observeObjectMethods; | 9 var $observeObjectMethods; |
| 10 var $observeArrayMethods; | 10 var $observeArrayMethods; |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 } | 381 } |
| 382 return callbackInfo; | 382 return callbackInfo; |
| 383 } | 383 } |
| 384 | 384 |
| 385 | 385 |
| 386 function ObjectObserve(object, callback, acceptList) { | 386 function ObjectObserve(object, callback, acceptList) { |
| 387 if (!IS_SPEC_OBJECT(object)) | 387 if (!IS_SPEC_OBJECT(object)) |
| 388 throw MakeTypeError(kObserveNonObject, "observe", "observe"); | 388 throw MakeTypeError(kObserveNonObject, "observe", "observe"); |
| 389 if (%IsJSGlobalProxy(object)) | 389 if (%IsJSGlobalProxy(object)) |
| 390 throw MakeTypeError(kObserveGlobalProxy, "observe"); | 390 throw MakeTypeError(kObserveGlobalProxy, "observe"); |
| 391 if (%IsAccessCheckNeeded(object)) |
| 392 throw MakeTypeError(kObserveAccessChecked, "observe"); |
| 391 if (!IS_SPEC_FUNCTION(callback)) | 393 if (!IS_SPEC_FUNCTION(callback)) |
| 392 throw MakeTypeError(kObserveNonFunction, "observe"); | 394 throw MakeTypeError(kObserveNonFunction, "observe"); |
| 393 if (ObjectIsFrozen(callback)) | 395 if (ObjectIsFrozen(callback)) |
| 394 throw MakeTypeError(kObserveCallbackFrozen); | 396 throw MakeTypeError(kObserveCallbackFrozen); |
| 395 | 397 |
| 396 var objectObserveFn = %GetObjectContextObjectObserve(object); | 398 var objectObserveFn = %GetObjectContextObjectObserve(object); |
| 397 return objectObserveFn(object, callback, acceptList); | 399 return objectObserveFn(object, callback, acceptList); |
| 398 } | 400 } |
| 399 | 401 |
| 400 | 402 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 if (IS_SPEC_OBJECT(changeRecord)) | 611 if (IS_SPEC_OBJECT(changeRecord)) |
| 610 ObjectInfoEnqueueExternalChangeRecord(objectInfo, changeRecord, changeType); | 612 ObjectInfoEnqueueExternalChangeRecord(objectInfo, changeRecord, changeType); |
| 611 } | 613 } |
| 612 | 614 |
| 613 | 615 |
| 614 function ObjectGetNotifier(object) { | 616 function ObjectGetNotifier(object) { |
| 615 if (!IS_SPEC_OBJECT(object)) | 617 if (!IS_SPEC_OBJECT(object)) |
| 616 throw MakeTypeError(kObserveNonObject, "getNotifier", "getNotifier"); | 618 throw MakeTypeError(kObserveNonObject, "getNotifier", "getNotifier"); |
| 617 if (%IsJSGlobalProxy(object)) | 619 if (%IsJSGlobalProxy(object)) |
| 618 throw MakeTypeError(kObserveGlobalProxy, "getNotifier"); | 620 throw MakeTypeError(kObserveGlobalProxy, "getNotifier"); |
| 621 if (%IsAccessCheckNeeded(object)) |
| 622 throw MakeTypeError(kObserveAccessChecked, "getNotifier"); |
| 619 | 623 |
| 620 if (ObjectIsFrozen(object)) return null; | 624 if (ObjectIsFrozen(object)) return null; |
| 621 | 625 |
| 622 if (!%ObjectWasCreatedInCurrentOrigin(object)) return null; | 626 if (!%ObjectWasCreatedInCurrentOrigin(object)) return null; |
| 623 | 627 |
| 624 var getNotifierFn = %GetObjectContextObjectGetNotifier(object); | 628 var getNotifierFn = %GetObjectContextObjectGetNotifier(object); |
| 625 return getNotifierFn(object); | 629 return getNotifierFn(object); |
| 626 } | 630 } |
| 627 | 631 |
| 628 | 632 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 to.ObserveEnqueueSpliceRecord = EnqueueSpliceRecord; | 712 to.ObserveEnqueueSpliceRecord = EnqueueSpliceRecord; |
| 709 to.ObserveBeginPerformSplice = BeginPerformSplice; | 713 to.ObserveBeginPerformSplice = BeginPerformSplice; |
| 710 to.ObserveEndPerformSplice = EndPerformSplice; | 714 to.ObserveEndPerformSplice = EndPerformSplice; |
| 711 to.ObserveNativeObjectObserve = NativeObjectObserve; | 715 to.ObserveNativeObjectObserve = NativeObjectObserve; |
| 712 to.ObserveNativeObjectGetNotifier = NativeObjectGetNotifier; | 716 to.ObserveNativeObjectGetNotifier = NativeObjectGetNotifier; |
| 713 to.ObserveNativeObjectNotifierPerformChange = | 717 to.ObserveNativeObjectNotifierPerformChange = |
| 714 NativeObjectNotifierPerformChange; | 718 NativeObjectNotifierPerformChange; |
| 715 }); | 719 }); |
| 716 | 720 |
| 717 }) | 721 }) |
| OLD | NEW |