diff --git a/CHANGES.md b/CHANGES.md index 42ec3807a0..3ab9175c39 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,9 @@ +### v0.14.10 + +- **Mr** + + Update the Mr package to version v0.15.6. + ### v0.14.9 - Fix "url" module id. diff --git a/package.json b/package.json index 85df1ccbfb..f897280e73 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/mr/CHANGES.md b/packages/mr/CHANGES.md index c9c18df6c6..9ccd5a4be0 100644 --- a/packages/mr/CHANGES.md +++ b/packages/mr/CHANGES.md @@ -1,3 +1,7 @@ +### 0.15.6 + + - Update Q to v1.0.1 + ### 0.15.5 - Disable Firebug workaround that breaks modern Firefox diff --git a/packages/mr/package.json b/packages/mr/package.json index 753a828ff2..7200c1cba0 100644 --- a/packages/mr/package.json +++ b/packages/mr/package.json @@ -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", diff --git a/packages/mr/packages/q/LICENSE b/packages/mr/packages/q/LICENSE index 76c5fe4c01..8a706b59ca 100644 --- a/packages/mr/packages/q/LICENSE +++ b/packages/mr/packages/q/LICENSE @@ -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 diff --git a/packages/mr/packages/q/package.json b/packages/mr/packages/q/package.json index 5b12aa0a7e..1e66b76c4d 100644 --- a/packages/mr/packages/q/package.json +++ b/packages/mr/packages/q/package.json @@ -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 (https://github.com/kriskowal)", diff --git a/packages/mr/packages/q/q.js b/packages/mr/packages/q/q.js index 8f9f3d2912..5880306d85 100644 --- a/packages/mr/packages/q/q.js +++ b/packages/mr/packages/q/q.js @@ -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; @@ -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:"; @@ -529,7 +512,7 @@ function defer() { }; // XXX deprecated - promise.valueOf = deprecate(function () { + promise.valueOf = function () { if (messages) { return promise; } @@ -538,7 +521,7 @@ function defer() { resolvedPromise = nearerValue; // shorten chain } return nearerValue; - }, "valueOf", "inspect"); + }; promise.inspect = function () { if (!resolvedPromise) { @@ -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") { @@ -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. @@ -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; @@ -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); - } } } @@ -1030,7 +990,6 @@ function trackRejection(promise, reason) { } else { unhandledReasons.push("(no stack) " + reason); } - displayUnhandledReasons(); } function untrackRejection(promise) { @@ -1054,9 +1013,6 @@ Q.getUnhandledReasons = function () { Q.stopUnhandledRejectionTracking = function () { resetUnhandledRejections(); - if (typeof process !== "undefined" && process.on) { - process.removeListener("exit", logUnhandledReasons); - } trackUnhandledRejections = false; }; @@ -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) { @@ -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);