Skip to content

Commit 9a5fafc

Browse files
committed
docs(bom): fix web worker
1 parent afa0e2e commit 9a5fafc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/bom/webworker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ worker.onmessage = function (e) {
238238

239239
```javascript
240240
function createWorker(f) {
241-
var blob = new Blob([f.toString()]);
241+
var blob = new Blob(['(' + f.toString() + ')()']);
242242
var url = window.URL.createObjectURL(blob);
243243
var worker = new Worker(url);
244244
return worker;

0 commit comments

Comments
 (0)