Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d904070

Browse files
committed
docs(bom/webworker): fix wangdoc#207
1 parent 7094b33 commit d904070

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎docs/bom/webworker.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ importScripts('script1.js', 'script2.js');
142142
主线程可以监听 Worker 是否发生错误。如果发生错误,Worker 会触发主线程的`error`事件。
143143

144144
```javascript
145-
worker.onerror(function (event) {
146-
console.log([
145+
worker.onerror=function (event) {
146+
console.log(
147147
'ERROR: Line ', event.lineno, ' in ', event.filename, ': ', event.message
148-
].join(''));
149-
});
148+
);
149+
};
150150

151151
// 或者
152152
worker.addEventListener('error', function (event) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /