Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Use global System for script type="import" #259

Merged
merged 1 commit into from
Dec 11, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/es6-module-loader-sans-promises.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/es6-module-loader-sans-promises.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion dist/es6-module-loader-sans-promises.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,10 @@ function logloads(loads) {
var script = scripts[i];
if (script.type == 'module') {
var source = script.innerHTML.substr(1);
System.module(source)['catch'](function(err) { setTimeout(function() { throw err; }); });
// It is important to reference the global System, rather than the one
// in our closure. We want to ensure that downstream users/libraries
// can override System w/ custom behavior.
__global.System.module(source)['catch'](function(err) { setTimeout(function() { throw err; }); });
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/es6-module-loader.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/es6-module-loader.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion dist/es6-module-loader.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -2672,7 +2672,10 @@ function logloads(loads) {
var script = scripts[i];
if (script.type == 'module') {
var source = script.innerHTML.substr(1);
System.module(source)['catch'](function(err) { setTimeout(function() { throw err; }); });
// It is important to reference the global System, rather than the one
// in our closure. We want to ensure that downstream users/libraries
// can override System w/ custom behavior.
__global.System.module(source)['catch'](function(err) { setTimeout(function() { throw err; }); });
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@
var script = scripts[i];
if (script.type == 'module') {
var source = script.innerHTML.substr(1);
System.module(source)['catch'](function(err) { setTimeout(function() { throw err; }); });
// It is important to reference the global System, rather than the one
// in our closure. We want to ensure that downstream users/libraries
// can override System w/ custom behavior.
__global.System.module(source)['catch'](function(err) { setTimeout(function() { throw err; }); });
}
}
}
Expand Down