Skip to content

Commit

Permalink
fix regex to only be true for source maps
Browse files Browse the repository at this point in the history
AssemblyScript compiler can generate lines that contain the `@` symbol but have nothing to do with the source mapping (e.g., '000287d: 6e67 2e55 5446 382e 656e 636f 6465 4076  ng.UTF8.encode@v') which causes `extractLineInfo` to fail on those lines.
This commit modifies the regex to only be true for lines that start with `@ {` which ensures that `extractLineInfo` is applied to real source map lines.
  • Loading branch information
carllocos committed Jul 14, 2023
1 parent c1ab9dd commit dcf8ddc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CompilerBridges/WASMCompilerBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function createLineInfoPairs(lines: string[]): LineInfoPairs[] { // TODO update
let lastLineInfo = undefined;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
const newLine = line.match(/@/);
const newLine = line.match(/@ {/);
if (newLine) {
lastLineInfo = extractLineInfo(line);
continue;
Expand Down

0 comments on commit dcf8ddc

Please sign in to comment.