Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 719e762

Browse files
committed
Patch initEvent too
1 parent 547b2df commit 719e762

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ if (!global.document) {
3636
}
3737

3838
function Event(type) { this.type = type; }
39+
Event.prototype.initEvent = Object;
3940
if (!global.document.createEvent) {
4041
global.document.createEvent = function(type) {
4142
let Ctor = global[type] || Event;
@@ -76,7 +77,6 @@ global.Worker = function Worker(url) {
7677
.then( code => {
7778
let vars = 'var self=this,global=self';
7879
for (let k in scope) vars += `,${k}=self.${k}`;
79-
// eval('(function() {'+vars+'\n'+code+'\n})').call(scope);
8080
getScopeVar = eval('(function() {'+vars+'\n'+code+'\nreturn function(__){return eval(__)}})').call(scope);
8181
let q = messageQueue;
8282
messageQueue = null;

0 commit comments

Comments
 (0)