This repository was archived by the owner on Jul 13, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1414
1515 var isWorker = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ;
1616 var isBrowser = typeof window != 'undefined' && ! isWorker ;
17+ var isWindows = typeof process != 'undefined' && ! ! process . platform . match ( / ^ w i n / ) ;
1718 var Promise = __global . Promise || require ( 'when/es6-shim/Promise' ) ;
1819
1920 // Helpers
105106 else if ( typeof require != 'undefined' ) {
106107 var fs ;
107108 fetchTextFromURL = function ( url , fulfill , reject ) {
109+ if ( url . substr ( 0 , 5 ) != 'file:' )
110+ throw 'Only file URLs of the form file: allowed running in Node.' ;
108111 fs = fs || require ( 'fs' ) ;
112+ url = url . substr ( 5 ) ;
113+ if ( isWindows )
114+ url = url . replace ( / \/ / g, '\\' ) ;
109115 return fs . readFile ( url , function ( err , data ) {
110116 if ( err )
111117 return reject ( err ) ;
129135 this . baseURL = href . substring ( 0 , href . lastIndexOf ( '/' ) + 1 ) ;
130136 }
131137 else if ( typeof process != 'undefined' && process . cwd ) {
132- this . baseURL = process . cwd ( ) + '/' ;
138+ this . baseURL = 'file:' + process . cwd ( ) + '/' ;
139+ if ( isWindows )
140+ this . baseURL = this . baseURL . replace ( / \\ / g, '/' ) ;
133141 }
134142 else {
135143 throw new TypeError ( 'No environment baseURL' ) ;
Original file line number Diff line number Diff line change 1515
1616 < script src ="../node_modules/when/es6-shim/Promise.js "> </ script >
1717
18- < script src ="../dist/es6-module-loader.src. js "> </ script >
18+ < script src ="../dist/es6-module-loader.js "> </ script >
1919 < script >
2020 // test traceurOptions and anonymous errors
2121 // System.traceurOptions = { classes: false };
You can’t perform that action at this time.
0 commit comments