Skip to content

Commit

Permalink
fix: show SyntaxError line/column in alert
Browse files Browse the repository at this point in the history
  • Loading branch information
j4k0xb committed Sep 24, 2024
1 parent 0ff80b6 commit 646b724
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion apps/playground/src/context/DeobfuscateContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ function useProviderValue(props: Props) {
} else if (data.type === 'error') {
setDeobfuscating(false);
setAlert(data.error.toString());
console.error(data.error);
}
};
}
Expand Down
3 changes: 3 additions & 0 deletions apps/playground/src/webcrack.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ self.onmessage = async ({ data }: MessageEvent<WorkerRequest>) => {

postMessage({ type: 'result', code: result.code, files });
} catch (error) {
// Babel SyntaxError dynamically sets `error.message`, has to be
// accessed/logged before postMessage to be properly cloned.
console.error(error);
postMessage({ type: 'error', error: error as Error });
}
};
Expand Down

0 comments on commit 646b724

Please sign in to comment.