Skip to content

Instantly share code, notes, and snippets.

@greggman
Created March 29, 2024 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greggman/63723dc1f085420a5ff3f15697af7295 to your computer and use it in GitHub Desktop.
Save greggman/63723dc1f085420a5ff3f15697af7295 to your computer and use it in GitHub Desktop.
Test post message sending error
/*bug-in-github-api-content-can-not-be-empty*/
/*bug-in-github-api-content-can-not-be-empty*/
const s = `
try {
const a = new Array(-1);
} catch (e) {
postMessage(e);
}
`;
const blob = new Blob([s], {type: 'application/javascript'});
const url = URL.createObjectURL(blob);
const w = new Worker(url);
w.onmessage = function(e) {
console.log(e.data);
console.log(e.data.stack);
}
{"name":"Test post message sending error","settings":{},"filenames":["index.html","index.css","index.js"]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment