-
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
Output pdf.scripting.js
as a JavaScript module (PR 17055 follow-up)
#17080
Conversation
The sandbox is initialized with some code: Line 61 in 905ad1f
and the generated code (the value of PDFJSDev.eval("PDF_SCRIPTING_JS_SOURCE") ) contains at the end:
and it's likely why it isn't working correctly. |
I wonder if that demo is just outdated, since the "Introduction"-section at https://bellard.org/quickjs/ contains (emphasis mine):
|
8053078
to
8c65739
Compare
It appears that removing that, and manually exposing the necessary object globally, works; note the updated patch. |
/botio unittest |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/fd8e9263e5e3ba9/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/f6379de308978f0/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/f6379de308978f0/output.txt Total script time: 2.50 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/fd8e9263e5e3ba9/output.txt Total script time: 10.72 mins
|
d548419
to
808e63d
Compare
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.
The last commit here looks good to me, with one optional comment. Thanks!
808e63d
to
32c46bf
Compare
To avoid problems with `export` statements in the QuickJS Javascript Engine, we can work-around that by *explicitly* exposing `pdfjsScripting` globally instead.
32c46bf
to
4b489cd
Compare
/botio xfatest |
From: Bot.io (Windows)ReceivedCommand cmd_xfatest from @Snuffleupagus received. Current queue size: 1 Live output at: http://54.193.163.58:8877/3c7a1b26b910079/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_xfatest from @Snuffleupagus received. Current queue size: 1 Live output at: http://54.241.84.105:8877/7a1d688b5468e3b/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/7a1d688b5468e3b/output.txt Total script time: 10.52 mins
Image differences available at: http://54.241.84.105:8877/7a1d688b5468e3b/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/3c7a1b26b910079/output.txt Total script time: 19.94 mins
Image differences available at: http://54.193.163.58:8877/3c7a1b26b910079/reftest-analyzer.html#web=eq.log |
To avoid problems with
export
statements in the QuickJS Javascript Engine, we can work-around that by explicitly exposingpdfjsScripting
globally instead.