Skip to content

Commit 7326543

Browse files
committed
get rid of eval
1 parent 02ae06d commit 7326543

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

index.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,19 @@ module.exports = function (fn, options) {
2929
wcache[key] = key;
3030
}
3131
sources[wkey] = [
32-
Function(['require','module','exports'], '(' + fn + ')(self)'),
32+
'function(require,module,exports){' + fn + '(self); }',
3333
wcache
3434
];
3535
}
3636
var skey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);
3737

3838
var scache = {}; scache[wkey] = wkey;
3939
sources[skey] = [
40-
Function(['require'], (
41-
// try to call default if defined to also support babel esmodule
42-
// exports
40+
'function(require,module,exports){' +
41+
// try to call default if defined to also support babel esmodule exports
4342
'var f = require(' + stringify(wkey) + ');' +
44-
'(f.default ? f.default : f)(self);'
45-
)),
43+
'(f.default ? f.default : f)(self);' +
44+
'}',
4645
scache
4746
];
4847

0 commit comments

Comments
 (0)