Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: test/mjsunit/es6/promises.js

Issue 1246933002: Remove unnecessary coupling between Promise tests and Object.observe (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use %EnqueueMicrotask Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/es6/debug-promises/throw-with-undefined-reject.js ('k') | test/promises-aplus/lib/global.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/promises.js
diff --git a/test/mjsunit/es6/promises.js b/test/mjsunit/es6/promises.js
index 63b6d2f94a9a7ec0799a7ef766845675dc8466fb..19239b601bc74e10c22565cdcfc8f16687759fdf 100644
--- a/test/mjsunit/es6/promises.js
+++ b/test/mjsunit/es6/promises.js
@@ -29,7 +29,6 @@
// Make sure we don't rely on functions patchable by monkeys.
var call = Function.prototype.call.call.bind(Function.prototype.call)
-var observe = Object.observe;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var defineProperty = Object.defineProperty;
var numberPrototype = Number.prototype;
@@ -87,19 +86,15 @@ function assertAsync(b, s) {
}
function assertAsyncDone(iteration) {
- var iteration = iteration || 0
- var dummy = {}
- observe(dummy,
- function() {
- if (asyncAssertsExpected === 0)
- assertAsync(true, "all")
- else if (iteration > 10) // Shouldn't take more.
- assertAsync(false, "all")
- else
- assertAsyncDone(iteration + 1)
- }
- )
- dummy.dummy = dummy
+ var iteration = iteration || 0;
+ %EnqueueMicrotask(function() {
+ if (asyncAssertsExpected === 0)
+ assertAsync(true, "all")
+ else if (iteration > 10) // Shouldn't take more.
+ assertAsync(false, "all")
+ else
+ assertAsyncDone(iteration + 1)
+ });
}
« no previous file with comments | « test/mjsunit/es6/debug-promises/throw-with-undefined-reject.js ('k') | test/promises-aplus/lib/global.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698