OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 // Drop all splice records on the floor for access-checked objects | 427 // Drop all splice records on the floor for access-checked objects |
428 (changeRecord.type == 'splice' || | 428 (changeRecord.type == 'splice' || |
429 !%IsAccessAllowedForObserver( | 429 !%IsAccessAllowedForObserver( |
430 callback, changeRecord.object, changeRecord.name))) { | 430 callback, changeRecord.object, changeRecord.name))) { |
431 return; | 431 return; |
432 } | 432 } |
433 | 433 |
434 var callbackInfo = CallbackInfoNormalize(callback); | 434 var callbackInfo = CallbackInfoNormalize(callback); |
435 if (IS_NULL(GetPendingObservers())) { | 435 if (IS_NULL(GetPendingObservers())) { |
436 SetPendingObservers(nullProtoObject()) | 436 SetPendingObservers(nullProtoObject()) |
437 GetMicrotaskQueue().push(ObserveMicrotaskRunner); | 437 EnqueueMicrotask(ObserveMicrotaskRunner); |
438 %SetMicrotaskPending(true); | |
439 } | 438 } |
440 GetPendingObservers()[callbackInfo.priority] = callback; | 439 GetPendingObservers()[callbackInfo.priority] = callback; |
441 callbackInfo.push(changeRecord); | 440 callbackInfo.push(changeRecord); |
442 } | 441 } |
443 | 442 |
444 function ObjectInfoEnqueueExternalChangeRecord(objectInfo, changeRecord, type) { | 443 function ObjectInfoEnqueueExternalChangeRecord(objectInfo, changeRecord, type) { |
445 if (!ObjectInfoHasActiveObservers(objectInfo)) | 444 if (!ObjectInfoHasActiveObservers(objectInfo)) |
446 return; | 445 return; |
447 | 446 |
448 var hasType = !IS_UNDEFINED(type); | 447 var hasType = !IS_UNDEFINED(type); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 "observe", ArrayObserve, | 639 "observe", ArrayObserve, |
641 "unobserve", ArrayUnobserve | 640 "unobserve", ArrayUnobserve |
642 )); | 641 )); |
643 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( | 642 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( |
644 "notify", ObjectNotifierNotify, | 643 "notify", ObjectNotifierNotify, |
645 "performChange", ObjectNotifierPerformChange | 644 "performChange", ObjectNotifierPerformChange |
646 )); | 645 )); |
647 } | 646 } |
648 | 647 |
649 SetupObjectObserve(); | 648 SetupObjectObserve(); |
OLD | NEW |