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

Commit c8e8ad4

Browse files
committed
0.9.3 with dependency updates
1 parent 32b9c9f commit c8e8ad4

9 files changed

+59
-26
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ See the [demo folder](https://github.com/ModuleLoader/es6-module-loader/blob/mas
1717

1818
For an example of a universal module loader based on this polyfill for loading AMD, CommonJS and globals, see [SystemJS](https://github.com/systemjs/systemjs).
1919

20-
_The current version is tested against **[Traceur 0.0.66](https://github.com/google/traceur-compiler/tree/0.0.66)**._
20+
_The current version is tested against **[Traceur 0.0.72](https://github.com/google/traceur-compiler/tree/0.0.72)**._
2121

2222
_Note the ES6 module specification is still in draft, and subject to change._
2323

2424
### Basic Use
2525

26-
Download both [es6-module-loader.js](https://raw.githubusercontent.com/ModuleLoader/es6-module-loader/v0.9.2/dist/es6-module-loader.js) and traceur.js into the same folder.
26+
Download both [es6-module-loader.js](https://raw.githubusercontent.com/ModuleLoader/es6-module-loader/v0.9.3/dist/es6-module-loader.js) and traceur.js into the same folder.
2727

28-
If using ES6 syntax (optional), include [`traceur.js`](https://raw.githubusercontent.com/jmcriffey/bower-traceur/0.0.66/traceur.js) in the page first then include `es6-module-loader.js`:
28+
If using ES6 syntax (optional), include [`traceur.js`](https://raw.githubusercontent.com/jmcriffey/bower-traceur/0.0.72/traceur.js) in the page first then include `es6-module-loader.js`:
2929

3030
```html
3131
<script src="traceur.js"></script>
@@ -177,7 +177,7 @@ A basic example of using this extension with a build would be the following:
177177
traceur --out app-build.js app/app.js --modules=instantiate
178178
```
179179

180-
2. If using additional ES6 features apart from modules syntax, load [`traceur-runtime.js`](https://raw.githubusercontent.com/jmcriffey/bower-traceur/0.0.66/traceur-runtime.js) (also included in the `bin` folder when installing Traceur through Bower or npm). Then include `es6-module-loader.js` and then apply the register extension before doing the import or loading the bundle as a script:
180+
2. If using additional ES6 features apart from modules syntax, load [`traceur-runtime.js`](https://raw.githubusercontent.com/jmcriffey/bower-traceur/0.0.72/traceur-runtime.js) (also included in the `bin` folder when installing Traceur through Bower or npm). Then include `es6-module-loader.js` and then apply the register extension before doing the import or loading the bundle as a script:
181181

182182
```html
183183
<script src="traceur-runtime.js"></script>

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "es6-module-loader",
3-
"version": "0.9.2",
3+
"version": "0.9.3",
44
"description": "An ES6 Module Loader polyfill based on the latest spec.",
55
"homepage": "https://github.com/ModuleLoader/es6-module-loader",
66
"main": "dist/es6-module-loader-sans-promises.js",
77
"dependencies": {
8-
"traceur": "0.0.66"
8+
"traceur": "0.0.72"
99
},
1010
"keywords": [
1111
"es6",

dist/es6-module-loader-sans-promises.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6-module-loader-sans-promises.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6-module-loader-sans-promises.src.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,7 @@ function logloads(loads) {
10771077

10781078
var options = traceur.options || {};
10791079
options.modules = 'instantiate';
1080+
options.script = false;
10801081
options.sourceMaps = true;
10811082
options.filename = load.address;
10821083

@@ -1184,6 +1185,10 @@ function logloads(loads) {
11841185
xhr.onload = load;
11851186
xhr.onerror = error;
11861187
xhr.ontimeout = error;
1188+
// IE8/IE9 bug may hang requests unless all properties are defined.
1189+
// See: http://stackoverflow.com/a/9928073/3949247
1190+
xhr.onprogress = function() {};
1191+
xhr.timeout = 0;
11871192
}
11881193
function load() {
11891194
fulfill(xhr.responseText);
@@ -1424,6 +1429,7 @@ function logloads(loads) {
14241429
}
14251430
})();
14261431

1432+
14271433
// Define our eval outside of the scope of any other reference defined in this
14281434
// file to avoid adding those references to the evaluation scope.
14291435
function __eval(__source, __global, load) {

dist/es6-module-loader.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6-module-loader.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6-module-loader.src.js

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ define(function() {
428428
}
429429

430430
/**
431+
* @deprecated
431432
* Issue a progress event, notifying all progress listeners
432433
* @param {*} x progress event payload to pass to all listeners
433434
*/
@@ -571,8 +572,7 @@ define(function() {
571572
results[i] = h.value;
572573
--pending;
573574
} else {
574-
unreportRemaining(promises, i+1, h);
575-
resolver.become(h);
575+
resolveAndObserveRemaining(promises, i+1, h, resolver);
576576
break;
577577
}
578578

@@ -597,14 +597,15 @@ define(function() {
597597
}
598598
}
599599

600-
function unreportRemaining(promises, start, rejectedHandler) {
600+
function resolveAndObserveRemaining(promises, start, handler, resolver) {
601+
resolver.become(handler);
602+
601603
var i, h, x;
602604
for(i=start; i<promises.length; ++i) {
603605
x = promises[i];
604606
if(maybeThenable(x)) {
605607
h = getHandlerMaybeThenable(x);
606-
607-
if(h !== rejectedHandler) {
608+
if(h !== handler) {
608609
h.visit(h, void 0, h._unreport);
609610
}
610611
}
@@ -632,15 +633,23 @@ define(function() {
632633
return never();
633634
}
634635

635-
var h = new Pending();
636-
var i, x;
636+
var resolver = new Pending();
637+
var i, x, h;
637638
for(i=0; i<promises.length; ++i) {
638639
x = promises[i];
639-
if (x !== void 0 && i in promises) {
640-
getHandler(x).visit(h, h.resolve, h.reject);
640+
if (x === void 0 && !(i in promises)) {
641+
continue;
642+
}
643+
644+
h = getHandler(x);
645+
if(h.state() !== 0) {
646+
resolveAndObserveRemaining(promises, i+1, h, resolver);
647+
break;
641648
}
649+
650+
h.visit(resolver, resolver.resolve, resolver.reject);
642651
}
643-
return new Promise(Handler, h);
652+
return new Promise(Handler, resolver);
644653
}
645654

646655
// Promise internals
@@ -692,7 +701,7 @@ define(function() {
692701

693702
Handler.prototype.when
694703
= Handler.prototype.become
695-
= Handler.prototype.notify
704+
= Handler.prototype.notify // deprecated
696705
= Handler.prototype.fail
697706
= Handler.prototype._unreport
698707
= Handler.prototype._report
@@ -835,6 +844,9 @@ define(function() {
835844
}
836845
};
837846

847+
/**
848+
* @deprecated
849+
*/
838850
Pending.prototype.notify = function(x) {
839851
if(!this.resolved) {
840852
tasks.enqueue(new ProgressTask(x, this));
@@ -1107,6 +1119,9 @@ define(function() {
11071119
Promise.exitContext();
11081120
}
11091121

1122+
/**
1123+
* @deprecated
1124+
*/
11101125
function runNotify(f, x, h, receiver, next) {
11111126
if(typeof f !== 'function') {
11121127
return next.notify(x);
@@ -1141,6 +1156,7 @@ define(function() {
11411156
}
11421157

11431158
/**
1159+
* @deprecated
11441160
* Return f.call(thisArg, x), or if it throws, *return* the exception
11451161
*/
11461162
function tryCatchReturn(f, x, thisArg, next) {
@@ -1173,12 +1189,17 @@ define(function(require) {
11731189
/*global setTimeout,clearTimeout*/
11741190
var cjsRequire, vertx, setTimer, clearTimer;
11751191

1192+
// Check for vertx environment by attempting to load vertx module.
1193+
// Doing the check in two steps ensures compatibility with RaveJS,
1194+
// which will return an empty module when browser: { vertx: false }
1195+
// is set in package.json
11761196
cjsRequire = require;
11771197

11781198
try {
11791199
vertx = cjsRequire('vertx');
1180-
} catch (e) { }
1200+
} catch (ignored) {}
11811201

1202+
// If vertx loaded and has the timer features we expect, try to support it
11821203
if (vertx && typeof vertx.setTimer === 'function') {
11831204
setTimer = function (f, ms) { return vertx.setTimer(ms, f); };
11841205
clearTimer = vertx.cancelTimer;
@@ -2280,6 +2301,7 @@ function logloads(loads) {
22802301

22812302
var options = traceur.options || {};
22822303
options.modules = 'instantiate';
2304+
options.script = false;
22832305
options.sourceMaps = true;
22842306
options.filename = load.address;
22852307

@@ -2387,6 +2409,10 @@ function logloads(loads) {
23872409
xhr.onload = load;
23882410
xhr.onerror = error;
23892411
xhr.ontimeout = error;
2412+
// IE8/IE9 bug may hang requests unless all properties are defined.
2413+
// See: http://stackoverflow.com/a/9928073/3949247
2414+
xhr.onprogress = function() {};
2415+
xhr.timeout = 0;
23902416
}
23912417
function load() {
23922418
fulfill(xhr.responseText);
@@ -2627,6 +2653,7 @@ function logloads(loads) {
26272653
}
26282654
})();
26292655

2656+
26302657
// Define our eval outside of the scope of any other reference defined in this
26312658
// file to avoid adding those references to the evaluation scope.
26322659
function __eval(__source, __global, load) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "es6-module-loader",
33
"description": "An ES6 Module Loader shim",
4-
"version": "0.9.2",
4+
"version": "0.9.3",
55
"homepage": "https://github.com/ModuleLoader/es6-module-loader",
66
"author": {
77
"name": "Guy Bedford, Luke Hoban, Addy Osmani",
@@ -44,7 +44,7 @@
4444
},
4545
"dependencies": {
4646
"grunt-contrib-uglify": "^0.6.0",
47-
"traceur": "0.0.66",
47+
"traceur": "0.0.72",
4848
"when": "^3.4.6"
4949
}
5050
}

0 commit comments

Comments
 (0)