-
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
Fallback to plain object for globalScope. #8761
Conversation
src/shared/compatibility.js
Outdated
@@ -24,7 +24,8 @@ if ((typeof PDFJSDev === 'undefined' || | |||
var globalScope = | |||
(typeof window !== 'undefined' && window.Math === Math) ? window : | |||
(typeof global !== 'undefined' && global.Math === Math) ? global : | |||
(typeof self !== 'undefined' && self.Math === Math) ? self : this; | |||
(typeof self !== 'undefined' && self.Math === Math) ? self : | |||
(typeof this !== 'undefined' && this.Math === Math) ? {}; |
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.
This fails linting, see https://travis-ci.org/mozilla/pdf.js/builds/262068404, since this line seems to contain a SyntaxError. I'm assuming that what you actually want here is (typeof this !== 'undefined' && this.Math === Math) ? this : {};
instead :-)
Please note that you can easily run linting locally (using gulp lint
) to catch these kind of issues, and please remember to squash the commits when fixing this.
Thats what happens if you use the GitHub web editor to make a change :). Fix follow soon. |
/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/397caa3069863d8/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/8cf77a8b22917b2/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/397caa3069863d8/output.txt Total script time: 16.45 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/8cf77a8b22917b2/output.txt Total script time: 28.92 mins
|
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.
Thanks for the patch!
Fallback to plain object for globalScope.
When loading PDF.js in non-browser,non-node,strict-mode environments (e.g. loading within a jsm module), globalScope is set to undefined. Should fallback to a plain object instead.