Skip to content
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

Fix issue with relative path in web worker #169

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ rustflags = [
"-Clink-arg=--pre-js=js/embed/pre.js",
"-Clink-arg=-sNODEJS_CATCH_EXIT=0",
"-Clink-arg=-sDISABLE_EXCEPTION_CATCHING=0",
"-Clink-arg=-sSINGLE_FILE=1",
"-Copt-level=3"
]
15 changes: 1 addition & 14 deletions js/embed/soljson_interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,7 @@ mergeInto(LibraryManager.library, {
},
resolc_compile: function(inputPtr, inputLen) {
const inputJson = UTF8ToString(inputPtr, inputLen);

// Check if running in a web worker or node.js
if (typeof importScripts === 'function') {
// Running in a web worker
importScripts('./resolc.js');
var revive = createRevive()
} else if (typeof require === 'function') {
// Running in Node.js
const path = require('path');
createRevive = require(path.resolve(__dirname, './resolc.js'));
var revive = createRevive();
} else {
throw new Error('Unknown environment: Unable to load resolc.js');
}
var revive = createRevive();
revive.writeToStdin(inputJson);

// Call main on the new instance
Expand Down
2 changes: 1 addition & 1 deletion js/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = defineConfig({
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},
timeout: 120000,
timeout: 480000,
/* Configure projects for major browsers */
projects: [
{
Expand Down
Loading