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

Unified Diff: src/runtime/runtime-promise.cc

Issue 2752043002: [promises] Add %WaitForPromise runtime call to allow tests to reliably wait for promises to be fini… (Closed)
Patch Set: Add ForTesting Created 3 years, 9 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
Index: src/runtime/runtime-promise.cc
diff --git a/src/runtime/runtime-promise.cc b/src/runtime/runtime-promise.cc
index 7f8419940af2640570200c154262513962e80266..d31b05f58b6e0c32be4bd4c80bf5cd924ac3528b 100644
--- a/src/runtime/runtime-promise.cc
+++ b/src/runtime/runtime-promise.cc
@@ -162,14 +162,23 @@ RUNTIME_FUNCTION(Runtime_PromiseHookBefore) {
RUNTIME_FUNCTION(Runtime_PromiseHookAfter) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
- CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0);
- if (promise->IsJSPromise()) {
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, arg, 0);
+ if (arg->IsJSPromise()) {
isolate->RunPromiseHook(PromiseHookType::kAfter,
- Handle<JSPromise>::cast(promise),
+ Handle<JSPromise>::cast(arg),
isolate->factory()->undefined_value());
}
return isolate->heap()->undefined_value();
}
+RUNTIME_FUNCTION(Runtime_IncrementWaitCount) {
gsathya 2017/03/16 17:39:04 Can you move these to runtime-test.cc?
+ isolate->IncrementWaitCountForTesting();
+ return isolate->heap()->undefined_value();
+}
+
+RUNTIME_FUNCTION(Runtime_DecrementWaitCount) {
+ isolate->DecrementWaitCountForTesting();
+ return isolate->heap()->undefined_value();
+}
} // namespace internal
} // namespace v8
« src/d8.cc ('K') | « src/runtime/runtime.h ('k') | test/mjsunit/basic-promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698