Skip to content

Commit ec58786

Browse files
Update to latest StarlingMonkey (#208)
* Update to latest StarlingMonkey Pulls in bytecodealliance/StarlingMonkey#231 * Strip path prefix Since for weval we can't map the build dir to something else, we instruct StarlingMonkey to strip the path prefix instead, achieving stack traces that don't depend on source location.
1 parent 7f17009 commit ec58786

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/componentize.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,17 @@ export async function componentize(opts,
215215
// component to be relative to the current working directory.
216216
// This only works in wizer, not in weval, because the latter doesn't
217217
// support --mapdir.
218-
if (!opts.enableAot && workspacePrefix.startsWith(cwd())) {
219-
workspacePrefix = cwd();
220-
sourcePath = sourcePath.slice(workspacePrefix.length + 1);
218+
if (!opts.enableAot) {
219+
if (!useOriginalSourceFile) {
220+
workspacePrefix = sourceDir;
221+
sourcePath = sourceName;
222+
}
223+
if (workspacePrefix.startsWith(cwd())) {
224+
workspacePrefix = cwd();
225+
sourcePath = sourcePath.slice(workspacePrefix.length + 1);
226+
}
221227
}
222-
let args = `--initializer-script-path ${initializerPath} ${sourcePath}`;
228+
let args = `--initializer-script-path ${initializerPath} --strip-path-prefix ${workspacePrefix}/ ${sourcePath}`;
223229
runtimeArgs = runtimeArgs ? `${runtimeArgs} ${args}` : args;
224230
let preopens = [`--dir ${sourceDir}`];
225231
if (opts.enableAot) {

0 commit comments

Comments
 (0)