Skip to content

Commit

Permalink
0.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Aug 21, 2014
1 parent c786edd commit 324aa27
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "system.js",
"version": "0.8.1",
"version": "0.8.2",
"main": "dist/system.js",
"dependencies": {
"es6-module-loader": "~0.8.2"
Expand Down
56 changes: 47 additions & 9 deletions dist/system-production-csp.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ $__global.upgradeSystemLoader = function() {
$__global.System = System.originalSystem;
}

/*

/*
* Script tag fetch
*/

Expand Down Expand Up @@ -542,6 +543,9 @@ function register(loader) {
depModule.importers.push(module);
module.dependencies.push(depModule);
}
else {
module.dependencies.push(null);
}

// run the setter for this dependency
if (module.setters[i])
Expand Down Expand Up @@ -847,9 +851,14 @@ function core(loader) {

// override locate to allow baseURL to be document-relative
var baseURI;
if (typeof window == 'undefined') {
if (typeof window == 'undefined' &&
typeof WorkerGlobalScope == 'undefined') {
baseURI = process.cwd() + '/';
}
// Inside of a Web Worker
else if(typeof window == 'undefined') {
baseURI = loader.global.location.href;
}
else {
baseURI = document.baseURI;
if (!baseURI) {
Expand Down Expand Up @@ -1112,14 +1121,18 @@ function cjs(loader) {
__dirname: dirname
};

load.source = '(function(global, exports, module, require, __filename, __dirname) { ' + load.source
var source = '(function(global, exports, module, require, __filename, __dirname) { ' + load.source
+ '\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);';

// disable AMD detection
var define = loader.global.define;
loader.global.define = undefined;

loader.__exec(load);
loader.__exec({
name: load.name,
address: load.address,
source: source
});

loader.global.define = define;

Expand All @@ -1135,7 +1148,6 @@ function cjs(loader) {
as well as a RequireJS-style require on System.require
*/
function amd(loader) {

// by default we only enforce AMD noConflict mode in Node
var isNode = typeof module != 'undefined' && module.exports;

Expand Down Expand Up @@ -1953,7 +1965,11 @@ var $__curScript, __eval;
}
};

if (typeof window != 'undefined') {
var isWorker = typeof WorkerGlobalScope !== 'undefined' &&
self instanceof WorkerGlobalScope;
var isBrowser = typeof window != 'undefined';

if (isBrowser) {
var head;

var scripts = document.getElementsByTagName('script');
Expand Down Expand Up @@ -1990,6 +2006,29 @@ var $__curScript, __eval;
$__global.upgradeSystemLoader();
}
}
else if(isWorker) {
doEval = function(source) {
try {
eval(source);
} catch(e) {
throw e;
}
};

if (!$__global.System || !$__global.LoaderPolyfill) {
var basePath = '';
try {
throw new Error('Getting the path');
} catch(err) {
var idx = err.stack.indexOf('at ') + 3;
var withSystem = err.stack.substr(idx, err.stack.substr(idx).indexOf('\n'));
basePath = withSystem.substr(0, withSystem.lastIndexOf('/') + 1);
}
importScripts(basePath + 'es6-module-loader.js');
} else {
$__global.upgradeSystemLoader();
}
}
else {
var es6ModuleLoader = require('es6-module-loader');
$__global.System = es6ModuleLoader.System;
Expand All @@ -2005,6 +2044,5 @@ var $__curScript, __eval;
}
})();

})(typeof window != 'undefined' ? window : global);


})(typeof window != 'undefined' ? window : (typeof WorkerGlobalScope != 'undefined' ?
self : global));
2 changes: 1 addition & 1 deletion dist/system-production-csp.min.js

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions dist/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,9 @@ function register(loader) {
depModule.importers.push(module);
module.dependencies.push(depModule);
}
else {
module.dependencies.push(null);
}

// run the setter for this dependency
if (module.setters[i])
Expand Down Expand Up @@ -1056,14 +1059,18 @@ function cjs(loader) {
__dirname: dirname
};

load.source = '(function(global, exports, module, require, __filename, __dirname) { ' + load.source
var source = '(function(global, exports, module, require, __filename, __dirname) { ' + load.source
+ '\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);';

// disable AMD detection
var define = loader.global.define;
loader.global.define = undefined;

loader.__exec(load);
loader.__exec({
name: load.name,
address: load.address,
source: source
});

loader.global.define = define;

Expand Down
2 changes: 1 addition & 1 deletion dist/system.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/banner.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
* SystemJS v0.8.1
* SystemJS v0.8.2
*/

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "systemjs",
"version": "0.8.1",
"version": "0.8.2",
"description": "System loader extension for flexible AMD & CommonJS support",
"main": "dist/system.js",
"repository": {
Expand Down

0 comments on commit 324aa27

Please sign in to comment.