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 +26
-27
lines changed Expand file tree Collapse file tree 2 files changed +26
-27
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,32 @@ var System;
15
15
function SystemLoader ( ) {
16
16
Loader . call ( this ) ;
17
17
18
+ var baseURI ;
19
+ // environent baseURI detection
20
+ if ( typeof document != 'undefined' && document . getElementsByTagName ) {
21
+ baseURI = document . baseURI ;
22
+
23
+ if ( ! baseURI ) {
24
+ var bases = document . getElementsByTagName ( 'base' ) ;
25
+ baseURI = bases [ 0 ] && bases [ 0 ] . href || window . location . href ;
26
+ }
27
+
28
+ // sanitize out the hash and querystring
29
+ baseURI = baseURI . split ( '#' ) [ 0 ] . split ( '?' ) [ 0 ] ;
30
+ baseURI = baseURI . substr ( 0 , baseURI . lastIndexOf ( '/' ) + 1 ) ;
31
+ }
32
+ else if ( typeof process != 'undefined' && process . cwd ) {
33
+ baseURI = 'file://' + ( isWindows ? '/' : '' ) + process . cwd ( ) + '/' ;
34
+ if ( isWindows )
35
+ baseURI = baseURI . replace ( / \\ / g, '/' ) ;
36
+ }
37
+ else if ( typeof location != 'undefined' ) {
38
+ baseURI = __global . location . href ;
39
+ }
40
+ else {
41
+ throw new TypeError ( 'No environment baseURI' ) ;
42
+ }
43
+
18
44
this . baseURL = baseURI ;
19
45
this . paths = { } ;
20
46
}
Original file line number Diff line number Diff line change 57
57
}
58
58
59
59
var URL = __global . URL || URLPolyfill ;
60
-
61
- var baseURI ;
62
-
63
- // environent baseURI detection
64
- if ( typeof document != 'undefined' && document . getElementsByTagName ) {
65
- baseURI = document . baseURI ;
66
-
67
- if ( ! baseURI ) {
68
- var bases = document . getElementsByTagName ( 'base' ) ;
69
- baseURI = bases [ 0 ] && bases [ 0 ] . href || window . location . href ;
70
- }
71
-
72
- // sanitize out the hash and querystring
73
- baseURI = baseURI . split ( '#' ) [ 0 ] . split ( '?' ) [ 0 ] ;
74
- baseURI = baseURI . substr ( 0 , baseURI . lastIndexOf ( '/' ) + 1 ) ;
75
- }
76
- else if ( typeof process != 'undefined' && process . cwd ) {
77
- baseURI = 'file://' + ( isWindows ? '/' : '' ) + process . cwd ( ) + '/' ;
78
- if ( isWindows )
79
- baseURI = baseURI . replace ( / \\ / g, '/' ) ;
80
- }
81
- else if ( typeof location != 'undefined' ) {
82
- baseURI = __global . location . href ;
83
- }
84
- else {
85
- throw new TypeError ( 'No environment baseURI' ) ;
86
- }
You can’t perform that action at this time.
0 commit comments