| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 187 } |
| 188 | 188 |
| 189 function ObserverIsActive(observer, objectInfo) { | 189 function ObserverIsActive(observer, objectInfo) { |
| 190 return TypeMapIsDisjointFrom(ObjectInfoGetPerformingTypes(objectInfo), | 190 return TypeMapIsDisjointFrom(ObjectInfoGetPerformingTypes(objectInfo), |
| 191 ObserverGetAcceptTypes(observer)); | 191 ObserverGetAcceptTypes(observer)); |
| 192 } | 192 } |
| 193 | 193 |
| 194 function ObjectInfoGetOrCreate(object) { | 194 function ObjectInfoGetOrCreate(object) { |
| 195 var objectInfo = ObjectInfoGet(object); | 195 var objectInfo = ObjectInfoGet(object); |
| 196 if (IS_UNDEFINED(objectInfo)) { | 196 if (IS_UNDEFINED(objectInfo)) { |
| 197 if (!%IsJSProxy(object)) | 197 if (!%_IsJSProxy(object)) { |
| 198 %SetIsObserved(object); | 198 %SetIsObserved(object); |
| 199 | 199 } |
| 200 objectInfo = { | 200 objectInfo = { |
| 201 object: object, | 201 object: object, |
| 202 changeObservers: null, | 202 changeObservers: null, |
| 203 notifier: null, | 203 notifier: null, |
| 204 performing: null, | 204 performing: null, |
| 205 performingCount: 0, | 205 performingCount: 0, |
| 206 }; | 206 }; |
| 207 GetObjectInfoMap().set(object, objectInfo); | 207 GetObjectInfoMap().set(object, objectInfo); |
| 208 } | 208 } |
| 209 return objectInfo; | 209 return objectInfo; |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 "observe", ArrayObserve, | 644 "observe", ArrayObserve, |
| 645 "unobserve", ArrayUnobserve | 645 "unobserve", ArrayUnobserve |
| 646 )); | 646 )); |
| 647 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( | 647 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( |
| 648 "notify", ObjectNotifierNotify, | 648 "notify", ObjectNotifierNotify, |
| 649 "performChange", ObjectNotifierPerformChange | 649 "performChange", ObjectNotifierPerformChange |
| 650 )); | 650 )); |
| 651 } | 651 } |
| 652 | 652 |
| 653 SetupObjectObserve(); | 653 SetupObjectObserve(); |
| OLD | NEW |