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

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

Issue 2366863002: Mirror API for IsAsyncFunction (Closed)
Patch Set: Created 4 years, 3 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 | « src/runtime/runtime.h ('k') | test/mjsunit/mirror-function-async.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
index fa509419257045d15fa83af562258cd30182fc1f..be958764a4566772dbf5e3f3e241fc60d6885cf5 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -292,5 +292,16 @@ RUNTIME_FUNCTION(Runtime_FunctionToString) {
: *JSFunction::ToString(Handle<JSFunction>::cast(function));
}
+RUNTIME_FUNCTION(Runtime_FunctionIsAsyncFunction) {
+ SealHandleScope shs(isolate);
+ DCHECK_EQ(1, args.length());
+ CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0);
+ bool is_async = false;
+ if (function->IsFunction()) {
+ is_async = Handle<JSFunction>::cast(function)->shared()->is_async();
+ }
+ return isolate->heap()->ToBoolean(is_async);
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/mirror-function-async.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698