chromium/third_party/blink/web_tests/inspector-protocol/debugger/resources/dedicated-worker-step-into.js

var message_id = 1;
onmessage = function(event) {
  debugger;
  doWork();
};

function doWork() {
  postMessage("Message #" + message_id++);
}