WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
135866
Built-in Promise API does not work with headless JSContexts
https://bugs.webkit.org/show_bug.cgi?id=135866
Summary
Built-in Promise API does not work with headless JSContexts
ide
Reported
2014-08-12 16:20:54 PDT
The built-in Promise implementation does not work with a JSContext that is not associated with a WebView/UIWebView/WKWebView and prints out the error, "Event loop not supported". For example, fulfilling a Promise calls "globalObject->queueMicrotask" which fails to invoke subscribed callbacks. Sample code: JSContext *context = [[JSContext alloc] init]; [context evaluateScript:@"Promise.resolve(42).then(function(result) { /*...*/ })"]; // Prints "ERROR: Event loop not supported."
Attachments
Add attachment
proposed patch, testcase, etc.
ide
Comment 1
2017-07-11 03:41:56 PDT
This appears to have been fixed in iOS 10.0. The original sample code behaves as expected and also doesn't print an error message. In iOS 10.3, async functions work too: [_context evaluateScript:@"(async () => 42)().then(result => { /*...*/ })"];
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug