Skip to content

Commit

Permalink
Merge pull request #1469 from aadsm/0.14.10
Browse files Browse the repository at this point in the history
0.14.10
  • Loading branch information
aadsm committed May 3, 2014
2 parents 05c887f + 1ec0c33 commit 0650f79
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 62 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### v0.14.10

- **Mr**

Update the Mr package to version v0.15.6.

### v0.14.9

- Fix "url" module id.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "montage",
"version": "0.14.9",
"version": "0.14.10",
"description": "Build your next application with a browser based platform that really gets the web.",
"repository": {
"type": "git",
Expand Down
4 changes: 4 additions & 0 deletions packages/mr/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 0.15.6

- Update Q to v1.0.1

### 0.15.5

- Disable Firebug workaround that breaks modern Firefox
Expand Down
2 changes: 1 addition & 1 deletion packages/mr/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mr",
"version": "0.15.5",
"version": "0.15.6",
"description": "A refresh-only CommonJS module system for browsers, used in Montage",
"keywords": [
"montage",
Expand Down
3 changes: 1 addition & 2 deletions packages/mr/packages/q/LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

Copyright 2009–2012 Kristopher Michael Kowal. All rights reserved.
Copyright 2009–2014 Kristopher Michael Kowal. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
Expand Down
2 changes: 1 addition & 1 deletion packages/mr/packages/q/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "q",
"version": "0.9.7",
"version": "1.0.1",
"description": "A library for promises (CommonJS/Promises/A,B,D)",
"homepage": "https://github.com/kriskowal/q",
"author": "Kris Kowal <[email protected]> (https://github.com/kriskowal)",
Expand Down
81 changes: 24 additions & 57 deletions packages/mr/packages/q/q.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,8 @@ var nextTick =(function () {
// If you need a security guarantee, these primordials need to be
// deeply frozen anyway, and if you don’t need a security guarantee,
// this is just plain paranoid.
// However, this does have the nice side-effect of reducing the size
// of the code by reducing x.call() to merely x(), eliminating many
// hard-to-minify characters.
// However, this **might** have the nice side-effect of reducing the size of
// the minified code by reducing x.call() to merely x()
// See Mark Miller’s explanation of what this does.
// http://wiki.ecmascript.org/doku.php?id=conventions:safe_meta_programming
var call = Function.call;
Expand Down Expand Up @@ -325,22 +324,6 @@ if (typeof ReturnValue !== "undefined") {
};
}

// Until V8 3.19 / Chromium 29 is released, SpiderMonkey is the only
// engine that has a deployed base of browsers that support generators.
// However, SM's generators use the Python-inspired semantics of
// outdated ES6 drafts. We would like to support ES6, but we'd also
// like to make it possible to use generators in deployed browsers, so
// we also support Python-style generators. At some point we can remove
// this block.
var hasES6Generators;
try {
/* jshint evil: true, nonew: false */
new Function("(function* (){ yield 1; })");
hasES6Generators = true;
} catch (e) {
hasES6Generators = false;
}

// long stack traces

var STACK_JUMP_SEPARATOR = "From previous event:";
Expand Down Expand Up @@ -529,7 +512,7 @@ function defer() {
};

// XXX deprecated
promise.valueOf = deprecate(function () {
promise.valueOf = function () {
if (messages) {
return promise;
}
Expand All @@ -538,7 +521,7 @@ function defer() {
resolvedPromise = nearerValue; // shorten chain
}
return nearerValue;
}, "valueOf", "inspect");
};

promise.inspect = function () {
if (!resolvedPromise) {
Expand Down Expand Up @@ -641,6 +624,7 @@ defer.prototype.makeNodeResolver = function () {
* @returns a promise that may be resolved with the given resolve and reject
* functions, or rejected by a thrown exception in resolver
*/
Q.Promise = promise; // ES6
Q.promise = promise;
function promise(resolver) {
if (typeof resolver !== "function") {
Expand All @@ -655,6 +639,11 @@ function promise(resolver) {
return deferred.promise;
}

promise.race = race; // ES6
promise.all = all; // ES6
promise.reject = reject; // ES6
promise.resolve = Q; // ES6

// XXX experimental. This method is a way to denote that a local value is
// serializable and should be immediately dispatched to a remote upon request,
// instead of passing a reference.
Expand Down Expand Up @@ -770,14 +759,14 @@ function Promise(descriptor, fallback, inspect) {
promise.exception = inspected.reason;
}

promise.valueOf = deprecate(function () {
promise.valueOf = function () {
var inspected = inspect();
if (inspected.state === "pending" ||
inspected.state === "rejected") {
return promise;
}
return inspected.value;
});
};
}

return promise;
Expand Down Expand Up @@ -979,43 +968,14 @@ Promise.prototype.isRejected = function () {
// shimmed environments, this would naturally be a `Set`.
var unhandledReasons = [];
var unhandledRejections = [];
var unhandledReasonsDisplayed = false;
var trackUnhandledRejections = true;
function displayUnhandledReasons() {
if (
!unhandledReasonsDisplayed &&
typeof window !== "undefined" &&
!window.Touch &&
window.console
) {
console.warn("[Q] Unhandled rejection reasons (should be empty):",
unhandledReasons);
}

unhandledReasonsDisplayed = true;
}

function logUnhandledReasons() {
for (var i = 0; i < unhandledReasons.length; i++) {
var reason = unhandledReasons[i];
console.warn("Unhandled rejection reason:", reason);
}
}

function resetUnhandledRejections() {
unhandledReasons.length = 0;
unhandledRejections.length = 0;
unhandledReasonsDisplayed = false;

if (!trackUnhandledRejections) {
trackUnhandledRejections = true;

// Show unhandled rejection reasons if Node exits without handling an
// outstanding rejection. (Note that Browserify presently produces a
// `process` global without the `EventEmitter` `on` method.)
if (typeof process !== "undefined" && process.on) {
process.on("exit", logUnhandledReasons);
}
}
}

Expand All @@ -1030,7 +990,6 @@ function trackRejection(promise, reason) {
} else {
unhandledReasons.push("(no stack) " + reason);
}
displayUnhandledReasons();
}

function untrackRejection(promise) {
Expand All @@ -1054,9 +1013,6 @@ Q.getUnhandledReasons = function () {

Q.stopUnhandledRejectionTracking = function () {
resetUnhandledRejections();
if (typeof process !== "undefined" && process.on) {
process.removeListener("exit", logUnhandledReasons);
}
trackUnhandledRejections = false;
};

Expand Down Expand Up @@ -1220,7 +1176,17 @@ function async(makeGenerator) {
// when verb is "throw", arg is an exception
function continuer(verb, arg) {
var result;
if (hasES6Generators) {

// Until V8 3.19 / Chromium 29 is released, SpiderMonkey is the only
// engine that has a deployed base of browsers that support generators.
// However, SM's generators use the Python-inspired semantics of
// outdated ES6 drafts. We would like to support ES6, but we'd also
// like to make it possible to use generators in deployed browsers, so
// we also support Python-style generators. At some point we can remove
// this block.

if (typeof StopIteration === "undefined") {
// ES6 Generators
try {
result = generator[verb](arg);
} catch (exception) {
Expand All @@ -1232,6 +1198,7 @@ function async(makeGenerator) {
return when(result.value, callback, errback);
}
} else {
// SpiderMonkey Generators
// FIXME: Remove this case when SM does ES6 generators.
try {
result = generator[verb](arg);
Expand Down

0 comments on commit 0650f79

Please sign in to comment.