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

Commit

Permalink
v0.17.10
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jan 5, 2016
1 parent 45aad0b commit 0d96992
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 42 deletions.
6 changes: 3 additions & 3 deletions dist/es6-module-loader-dev.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

43 changes: 25 additions & 18 deletions dist/es6-module-loader-dev.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ global.URLPolyfill = URLPolyfill;

var isWorker = typeof window == 'undefined' && typeof self != 'undefined' && typeof importScripts != 'undefined';
var isBrowser = typeof window != 'undefined' && typeof document != 'undefined';
var isWindows = typeof process != 'undefined' && !!process.platform.match(/^win/);
var isWindows = typeof process != 'undefined' && typeof process.platform != 'undefined' && !!process.platform.match(/^win/);

if (!__global.console)
__global.console = { assert: function() {} };
Expand Down Expand Up @@ -106,7 +106,7 @@ global.URLPolyfill = URLPolyfill;
function addToError(err, msg) {
var newErr;
if (err instanceof Error) {
var newErr = new Error(err.message, err.fileName, err.lineNumber);
newErr = new Error(err.message, err.fileName, err.lineNumber);
if (isBrowser) {
newErr.message = err.message + '\n\t' + msg;
newErr.stack = err.stack;
Expand Down Expand Up @@ -873,18 +873,21 @@ function logloads(loads) {
},
// 26.3.3.9 keys not implemented
// 26.3.3.10
load: function(name, options) {
load: function(name) {
var loader = this._loader;
if (loader.modules[name]) {
doEnsureEvaluated(loader.modules[name], [], loader);
return Promise.resolve(loader.modules[name].module);
}
return loader.importPromises[name] || createImportPromise(this, name,
loadModule(loader, name, {})
.then(function(load) {
delete loader.importPromises[name];
return evaluateLoadedModule(loader, load);
}));
if (loader.modules[name])
return Promise.resolve();
return loader.importPromises[name] || createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({
step: 'locate',
loader: loader,
moduleName: name,
moduleMetadata: {},
moduleSource: undefined,
moduleAddress: undefined
}))
.then(function() {
delete loader.importPromises[name];
}));
},
// 26.3.3.11
module: function(source, options) {
Expand Down Expand Up @@ -1119,7 +1122,7 @@ function logloads(loads) {

module.locked = false;
return value;
}, load.name);
}, { id: load.name });

// setup our setters and execution function
module.setters = registryEntry.setters;
Expand Down Expand Up @@ -1306,8 +1309,12 @@ var transpile = (function() {
return compiler.compile(source, filename);
}
catch(e) {
// traceur throws an error array
throw e[0];
// on older versions of traceur (<0.9.3), an array of errors is thrown
// rather than a single error.
if (e.length) {
throw e[0];
}
throw e;
}
}

Expand Down Expand Up @@ -1390,7 +1397,7 @@ function applyPaths(paths, name) {
}
}

var outPath = paths[pathMatch] || name;
var outPath = paths[pathMatch];
if (typeof wildcard == 'string')
outPath = outPath.replace('*', wildcard);

Expand All @@ -1412,7 +1419,7 @@ SystemLoader.prototype.normalize = function(name, parentName, parentAddress) {

// not absolute or relative -> apply paths (what will be sites)
if (!name.match(absURLRegEx) && name[0] != '.')
name = new URL(applyPaths(this.paths, name), baseURI).href;
name = new URL(applyPaths(this.paths, name) || name, baseURI).href;
// apply parent-relative normalization, parentAddress is already normalized
else
name = new URL(name, parentName || baseURI).href;
Expand Down
6 changes: 3 additions & 3 deletions 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.

33 changes: 18 additions & 15 deletions dist/es6-module-loader.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ global.URLPolyfill = URLPolyfill;

var isWorker = typeof window == 'undefined' && typeof self != 'undefined' && typeof importScripts != 'undefined';
var isBrowser = typeof window != 'undefined' && typeof document != 'undefined';
var isWindows = typeof process != 'undefined' && !!process.platform.match(/^win/);
var isWindows = typeof process != 'undefined' && typeof process.platform != 'undefined' && !!process.platform.match(/^win/);

if (!__global.console)
__global.console = { assert: function() {} };
Expand Down Expand Up @@ -106,7 +106,7 @@ global.URLPolyfill = URLPolyfill;
function addToError(err, msg) {
var newErr;
if (err instanceof Error) {
var newErr = new Error(err.message, err.fileName, err.lineNumber);
newErr = new Error(err.message, err.fileName, err.lineNumber);
if (isBrowser) {
newErr.message = err.message + '\n\t' + msg;
newErr.stack = err.stack;
Expand Down Expand Up @@ -873,18 +873,21 @@ function logloads(loads) {
},
// 26.3.3.9 keys not implemented
// 26.3.3.10
load: function(name, options) {
load: function(name) {
var loader = this._loader;
if (loader.modules[name]) {
doEnsureEvaluated(loader.modules[name], [], loader);
return Promise.resolve(loader.modules[name].module);
}
return loader.importPromises[name] || createImportPromise(this, name,
loadModule(loader, name, {})
.then(function(load) {
delete loader.importPromises[name];
return evaluateLoadedModule(loader, load);
}));
if (loader.modules[name])
return Promise.resolve();
return loader.importPromises[name] || createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({
step: 'locate',
loader: loader,
moduleName: name,
moduleMetadata: {},
moduleSource: undefined,
moduleAddress: undefined
}))
.then(function() {
delete loader.importPromises[name];
}));
},
// 26.3.3.11
module: function(source, options) {
Expand Down Expand Up @@ -1048,7 +1051,7 @@ function applyPaths(paths, name) {
}
}

var outPath = paths[pathMatch] || name;
var outPath = paths[pathMatch];
if (typeof wildcard == 'string')
outPath = outPath.replace('*', wildcard);

Expand All @@ -1070,7 +1073,7 @@ SystemLoader.prototype.normalize = function(name, parentName, parentAddress) {

// not absolute or relative -> apply paths (what will be sites)
if (!name.match(absURLRegEx) && name[0] != '.')
name = new URL(applyPaths(this.paths, name), baseURI).href;
name = new URL(applyPaths(this.paths, name) || name, baseURI).href;
// apply parent-relative normalization, parentAddress is already normalized
else
name = new URL(name, parentName || baseURI).href;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "es6-module-loader",
"description": "An ES6 Module Loader shim",
"version": "0.17.9",
"version": "0.17.10",
"homepage": "https://github.com/ModuleLoader/es6-module-loader",
"author": {
"name": "Guy Bedford, Luke Hoban, Addy Osmani",
Expand Down

0 comments on commit 0d96992

Please sign in to comment.