[Pkg-javascript-commits] [node-q] 01/06: Imported Upstream version 1.2.1
Sebastiaan Couwenberg
sebastic at moszumanska.debian.org
Mon Apr 27 09:43:00 UTC 2015
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository node-q.
commit 082db6e57c470817eda1a8775143108c79db3d5b
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Mon Apr 27 11:29:19 2015 +0200
Imported Upstream version 1.2.1
---
CHANGES.md | 4 ++++
package.json | 16 ++++++++--------
q.js | 13 ++++++++++---
3 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index b138b13..b828b24 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,5 +1,9 @@
<!-- vim:ts=4:sts=4:sw=4:et:tw=70 -->
+## 1.2.1
+
+ - Fix Node.js environment detection for modern Browserify (@kahnjw).
+
## 1.2.0
- Added Q.any(promisesArray) method (@vergara).
diff --git a/package.json b/package.json
index 9df9c50..288f561 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "q",
- "version": "1.2.0",
+ "version": "1.2.1",
"description": "A library for promises (CommonJS/Promises/A,B,D)",
"homepage": "https://github.com/kriskowal/q",
"author": "Kris Kowal <kris at cixar.com> (https://github.com/kriskowal)",
@@ -47,22 +47,22 @@
},
"dependencies": {},
"devDependencies": {
- "jshint": "~2.1.9",
"cover": "*",
- "jasmine-node": "1.11.0",
- "opener": "*",
- "promises-aplus-tests": "1.x",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
- "grunt-contrib-uglify": "~0.2.2",
- "matcha": "~0.2.0"
+ "grunt-contrib-uglify": "~0.9.1",
+ "jasmine-node": "1.11.0",
+ "jshint": "~2.1.9",
+ "matcha": "~0.2.0",
+ "opener": "*",
+ "promises-aplus-tests": "1.x"
},
"scripts": {
"test": "jasmine-node spec && promises-aplus-tests spec/aplus-adapter",
"test-browser": "opener spec/q-spec.html",
"benchmark": "matcha",
"lint": "jshint q.js",
- "cover": "cover run node_modules/jasmine-node/bin/jasmine-node spec && cover report html && opener cover_html/index.html",
+ "cover": "cover run jasmine-node spec && cover report html && opener cover_html/index.html",
"minify": "grunt",
"prepublish": "grunt"
},
diff --git a/q.js b/q.js
index d9405fd..8f601ce 100644
--- a/q.js
+++ b/q.js
@@ -157,9 +157,16 @@ var nextTick =(function () {
}
};
- if (typeof process !== "undefined" && process.nextTick) {
- // Node.js before 0.9. Note that some fake-Node environments, like the
- // Mocha test runner, introduce a `process` global without a `nextTick`.
+ if (typeof process === "object" &&
+ process.toString() === "[object process]" && process.nextTick) {
+ // Ensure Q is in a real Node environment, with a `process.nextTick`.
+ // To see through fake Node environments:
+ // * Mocha test runner - exposes a `process` global without a `nextTick`
+ // * Browserify - exposes a `process.nexTick` function that uses
+ // `setTimeout`. In this case `setImmediate` is preferred because
+ // it is faster. Browserify's `process.toString()` yields
+ // "[object Object]", while in a real Node environment
+ // `process.nextTick()` yields "[object process]".
isNodeJS = true;
requestTick = function () {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-q.git
More information about the Pkg-javascript-commits
mailing list