| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 function ObjectInfoGetPerformingTypes(objectInfo) { | 264 function ObjectInfoGetPerformingTypes(objectInfo) { |
| 265 return objectInfo.performingCount > 0 ? objectInfo.performing : null; | 265 return objectInfo.performingCount > 0 ? objectInfo.performing : null; |
| 266 } | 266 } |
| 267 | 267 |
| 268 function ConvertAcceptListToTypeMap(arg) { | 268 function ConvertAcceptListToTypeMap(arg) { |
| 269 // We use undefined as a sentinel for the default accept list. | 269 // We use undefined as a sentinel for the default accept list. |
| 270 if (IS_UNDEFINED(arg)) | 270 if (IS_UNDEFINED(arg)) |
| 271 return arg; | 271 return arg; |
| 272 | 272 |
| 273 if (!IS_SPEC_OBJECT(arg)) | 273 if (!IS_SPEC_OBJECT(arg)) |
| 274 throw MakeTypeError("observe_accept_invalid"); | 274 throw MakeTypeError("observe_invalid_accept"); |
| 275 | 275 |
| 276 var len = ToInteger(arg.length); | 276 var len = ToInteger(arg.length); |
| 277 if (len < 0) len = 0; | 277 if (len < 0) len = 0; |
| 278 | 278 |
| 279 return TypeMapCreateFromList(arg, len); | 279 return TypeMapCreateFromList(arg, len); |
| 280 } | 280 } |
| 281 | 281 |
| 282 // CallbackInfo's optimized state is just a number which represents its global | 282 // CallbackInfo's optimized state is just a number which represents its global |
| 283 // priority. When a change record must be enqueued for the callback, it | 283 // priority. When a change record must be enqueued for the callback, it |
| 284 // normalizes. When delivery clears any pending change records, it re-optimizes. | 284 // normalizes. When delivery clears any pending change records, it re-optimizes. |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 "observe", ArrayObserve, | 604 "observe", ArrayObserve, |
| 605 "unobserve", ArrayUnobserve | 605 "unobserve", ArrayUnobserve |
| 606 )); | 606 )); |
| 607 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( | 607 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( |
| 608 "notify", ObjectNotifierNotify, | 608 "notify", ObjectNotifierNotify, |
| 609 "performChange", ObjectNotifierPerformChange | 609 "performChange", ObjectNotifierPerformChange |
| 610 )); | 610 )); |
| 611 } | 611 } |
| 612 | 612 |
| 613 SetupObjectObserve(); | 613 SetupObjectObserve(); |
| OLD | NEW |