File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -781,21 +781,27 @@ function namespace(ns) {
781
781
function exportAce ( ns , modules , requireBase , extModules ) {
782
782
requireBase = requireBase || "window" ;
783
783
return function ( text ) {
784
- /*globals REQUIRE_NS, MODULES*/
784
+ /*globals REQUIRE_NS, MODULES, self */
785
785
var template = function ( ) {
786
786
( function ( ) {
787
787
REQUIRE_NS . require ( MODULES , function ( a ) {
788
788
if ( a ) {
789
789
a . config . init ( true ) ;
790
790
a . define = REQUIRE_NS . define ;
791
791
}
792
- if ( ! window . NS )
793
- window . NS = a ;
792
+ var global = ( function ( ) {
793
+ return this ;
794
+ } ) ( ) ;
795
+ if ( ! global && typeof window != "undefined" ) global = window ; // can happen in strict mode
796
+ if ( ! global && typeof self != "undefined" ) global = self ; // can happen in webworker
797
+
798
+ if ( ! global . NS )
799
+ global . NS = a ;
794
800
for ( var key in a ) if ( a . hasOwnProperty ( key ) )
795
- window . NS [ key ] = a [ key ] ;
796
- window . NS [ "default" ] = window . NS ;
801
+ global . NS [ key ] = a [ key ] ;
802
+ global . NS [ "default" ] = global . NS ;
797
803
if ( typeof module == "object" && typeof exports == "object" && module ) {
798
- module . exports = window . NS ;
804
+ module . exports = global . NS ;
799
805
}
800
806
} ) ;
801
807
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments