[Workers] Satisfy JSLint

Modify example worker script to satisfy JSLint. #12.
This commit is contained in:
Victor Woeltjen 2015-06-18 11:30:47 -07:00
parent 640a399278
commit eb2cddc063

View File

@ -1,4 +1,4 @@
/*global onmessage,postMessage*/
/*global self*/
(function () {
"use strict";
@ -9,7 +9,7 @@
return n < 2 ? n : (fib(n - 1) + fib(n - 2));
}
onmessage = function (event) {
postMessage(fib(event.data));
self.onmessage = function (event) {
self.postMessage(fib(event.data));
};
}());