-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for async
/await
using Babel
#9977
Conversation
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/fe7ccce125af56e/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/404b269a2dc9dec/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/404b269a2dc9dec/output.txt Total script time: 29.35 mins
Image differences available at: http://54.215.176.217:8877/404b269a2dc9dec/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/fe7ccce125af56e/output.txt Total script time: 36.36 mins
|
The one Windows failure is strange, since the commit included here is exactly the same as the first one in PR #9944 (where all tests ran successfully). One possible explanation is that Firefox was updated on the bot (which might not show up in the logs, since the bot uses a beta version); another explanation is that it's simply an intermittent. /botio-windows test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/57b06f2b255b115/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/57b06f2b255b115/output.txt Total script time: 29.29 mins
Image differences available at: http://54.215.176.217:8877/57b06f2b255b115/reftest-analyzer.html#web=eq.log |
/botio-windows test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/1fe25d302a82c2f/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/1fe25d302a82c2f/output.txt Total script time: 29.16 mins
Image differences available at: http://54.215.176.217:8877/1fe25d302a82c2f/reftest-analyzer.html#web=eq.log |
/botio-windows test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/54ef6786685e78d/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/54ef6786685e78d/output.txt Total script time: 29.80 mins
Image differences available at: http://54.215.176.217:8877/54ef6786685e78d/reftest-analyzer.html#web=eq.log |
I don't understand what to make of these intermittent failures (on Windows), since all tests seem to pass consistently in PR #9944 and the commit hashes are identical 😕 |
Doesn't look like it's just your changes, I got it to fail over in #9567 (comment) |
/botio-windows test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 1 Live output at: http://54.215.176.217:8877/e84f0b739e5d438/output.txt |
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/e84f0b739e5d438/output.txt Total script time: 30.35 mins
|
src/display/api.js
Outdated
return this.CMapReaderFactory.fetch({ | ||
name: data.name, | ||
}); | ||
return this.CMapReaderFactory.fetch(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this was unrelated to the main objective of the patch; it's been reverted now.
3f8606d
to
783d74a
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/95b758af0bed3c8/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/95b758af0bed3c8/output.txt Total script time: 38.70 mins
|
For proof-of-concept, this patch converts a couple of `Promise` returning methods to use `async` instead. Please note that the `generic` build, based on this patch, has been successfully testing in IE11 (i.e. the viewer loads and nothing is obviously broken). Being able to use modern JavaScript features like `async`/`await` is a huge plus, but there's one (obvious) side-effect: The size of the built files will increase slightly (unless `SKIP_BABEL == true`). That's unavoidable, but seems like a small price to pay in the grand scheme of things. Finally, note that the `chromium` build target was changed to no longer skip Babel translation, since the Chrome extension still supports version `49` of the browser (where native `async` support isn't available).
783d74a
to
099ed08
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/bdc5647df240180/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/025a6c0395cbc0d/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/025a6c0395cbc0d/output.txt Total script time: 31.36 mins
Image differences available at: http://54.215.176.217:8877/025a6c0395cbc0d/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/bdc5647df240180/output.txt Total script time: 36.06 mins
|
For proof-of-concept, this patch converts a couple of
Promise
returning methods to useasync
instead.Please note that the
generic
build, based on this patch, has been successfully testing in IE11 (i.e. the viewer loads and nothing is obviously broken).Being able to use modern JavaScript features like
async
/await
is a huge plus, but there's one (obvious) side-effect: The size of the built files will increase slightly (unlessSKIP_BABEL == true
). That's unavoidable, but seems like a small price to pay in the grand scheme of things.Finally, note that the
chromium
build target was changed to no longer skip Babel translation, since the Chrome extension still supports version49
of the browser (where nativeasync
support isn't available).Split off from PR #9944 as requested by @brendandahl.
Much more manageable diff with https://github.com/mozilla/pdf.js/pull/9977/files?w=1