Skip to content

Commit 538ef48

Browse files
author
James Halliday
committed
only use self when available
1 parent 28d5b6c commit 538ef48

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ var _vars = {
1919
}
2020
},
2121
global: function (row, basedir) {
22-
return 'self'
22+
return 'typeof self !== "undefined" ? self : '
23+
+ 'typeof window !== "undefined" ? window : {}'
24+
;
2325
},
2426
Buffer: function () {
2527
return {

0 commit comments

Comments
 (0)