update dependencies

This commit is contained in:
Jeff Williams 2015-07-29 16:30:49 -07:00
parent 6d3be696f6
commit 3ad5be44fe
42 changed files with 2127 additions and 1270 deletions

View File

@ -226,7 +226,8 @@ https://github.com/mhevery/jasmine-node
## js2xmlparser ## ## js2xmlparser ##
js2xmlparser is distributed under the MIT license, which is reproduced above. js2xmlparser is distributed under the Apache License 2.0, which is
included with this package.
Copyright (c) 2012 Michael Kourlas. Copyright (c) 2012 Michael Kourlas.
@ -374,7 +375,7 @@ https://github.com/geraintluff/tv4
Underscore.js is distributed under the MIT license, which is reproduced above. Underscore.js is distributed under the MIT license, which is reproduced above.
Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Copyright (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative
Reporters & Editors. Reporters & Editors.
The source code for Underscore.js is available at: The source code for Underscore.js is available at:

View File

@ -82,11 +82,13 @@ var parserOptions = exports.parserOptions = {
classes: true, classes: true,
defaultParams: true, defaultParams: true,
destructuring: true, destructuring: true,
experimentalObjectRestSpread: true,
forOf: true, forOf: true,
generators: true, generators: true,
globalReturn: true, globalReturn: true,
jsx: false, jsx: false,
modules: true, modules: true,
newTarget: true,
objectLiteralComputedProperties: true, objectLiteralComputedProperties: true,
objectLiteralDuplicateProperties: true, objectLiteralDuplicateProperties: true,
objectLiteralShorthandMethods: true, objectLiteralShorthandMethods: true,

View File

@ -22,6 +22,8 @@ exports.Syntax = {
DebuggerStatement: 'DebuggerStatement', DebuggerStatement: 'DebuggerStatement',
DoWhileStatement: 'DoWhileStatement', DoWhileStatement: 'DoWhileStatement',
EmptyStatement: 'EmptyStatement', EmptyStatement: 'EmptyStatement',
ExperimentalRestProperty: 'ExperimentalRestProperty',
ExperimentalSpreadProperty: 'ExperimentalSpreadProperty',
ExportAllDeclaration: 'ExportAllDeclaration', ExportAllDeclaration: 'ExportAllDeclaration',
ExportDefaultDeclaration: 'ExportDefaultDeclaration', ExportDefaultDeclaration: 'ExportDefaultDeclaration',
ExportNamedDeclaration: 'ExportNamedDeclaration', ExportNamedDeclaration: 'ExportNamedDeclaration',
@ -43,6 +45,7 @@ exports.Syntax = {
Literal: 'Literal', Literal: 'Literal',
LogicalExpression: 'LogicalExpression', LogicalExpression: 'LogicalExpression',
MemberExpression: 'MemberExpression', MemberExpression: 'MemberExpression',
MetaProperty: 'MetaProperty',
MethodDefinition: 'MethodDefinition', MethodDefinition: 'MethodDefinition',
NewExpression: 'NewExpression', NewExpression: 'NewExpression',
ObjectExpression: 'ObjectExpression', ObjectExpression: 'ObjectExpression',

View File

@ -163,6 +163,12 @@ walkers[Syntax.DoWhileStatement] = function(node, parent, state, cb) {
walkers[Syntax.EmptyStatement] = leafNode; walkers[Syntax.EmptyStatement] = leafNode;
walkers[Syntax.ExperimentalRestProperty] = function(node, parent, state, cb) {
cb(node.argument);
};
walkers[Syntax.ExperimentalSpreadProperty] = walkers[Syntax.ExperimentalRestProperty];
walkers[Syntax.ExportAllDeclaration] = function(node, parent, state, cb) { walkers[Syntax.ExportAllDeclaration] = function(node, parent, state, cb) {
if (node.source) { if (node.source) {
cb(node.source, node, state); cb(node.source, node, state);
@ -297,6 +303,8 @@ walkers[Syntax.MemberExpression] = function(node, parent, state, cb) {
} }
}; };
walkers[Syntax.MetaProperty] = leafNode;
walkers[Syntax.MethodDefinition] = function(node, parent, state, cb) { walkers[Syntax.MethodDefinition] = function(node, parent, state, cb) {
if (node.key) { if (node.key) {
cb(node.key, node, state); cb(node.key, node, state);

1221
node_modules/async/lib/async.js generated vendored Executable file → Normal file

File diff suppressed because it is too large Load Diff

98
node_modules/async/package.json generated vendored

File diff suppressed because one or more lines are too long

2
node_modules/bluebird/LICENSE generated vendored
View File

@ -7,7 +7,7 @@ of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:</p> furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.

View File

@ -3,12 +3,13 @@ var firstLineError;
try {throw new Error(); } catch (e) {firstLineError = e;} try {throw new Error(); } catch (e) {firstLineError = e;}
var schedule = require("./schedule.js"); var schedule = require("./schedule.js");
var Queue = require("./queue.js"); var Queue = require("./queue.js");
var _process = typeof process !== "undefined" ? process : undefined; var util = require("./util.js");
function Async() { function Async() {
this._isTickUsed = false; this._isTickUsed = false;
this._lateQueue = new Queue(16); this._lateQueue = new Queue(16);
this._normalQueue = new Queue(16); this._normalQueue = new Queue(16);
this._trampolineEnabled = true;
var self = this; var self = this;
this.drainQueues = function () { this.drainQueues = function () {
self._drainQueues(); self._drainQueues();
@ -17,17 +18,23 @@ function Async() {
schedule.isStatic ? schedule(this.drainQueues) : schedule; schedule.isStatic ? schedule(this.drainQueues) : schedule;
} }
Async.prototype.haveItemsQueued = function () { Async.prototype.disableTrampolineIfNecessary = function() {
return this._normalQueue.length() > 0; if (util.hasDevTools) {
this._trampolineEnabled = false;
}
}; };
Async.prototype._withDomain = function(fn) { Async.prototype.enableTrampoline = function() {
if (_process !== undefined && if (!this._trampolineEnabled) {
_process.domain != null && this._trampolineEnabled = true;
!fn.domain) { this._schedule = function(fn) {
fn = _process.domain.bind(fn); setTimeout(fn, 0);
};
} }
return fn; };
Async.prototype.haveItemsQueued = function () {
return this._normalQueue.length() > 0;
}; };
Async.prototype.throwLater = function(fn, arg) { Async.prototype.throwLater = function(fn, arg) {
@ -35,7 +42,6 @@ Async.prototype.throwLater = function(fn, arg) {
arg = fn; arg = fn;
fn = function () { throw arg; }; fn = function () { throw arg; };
} }
fn = this._withDomain(fn);
if (typeof setTimeout !== "undefined") { if (typeof setTimeout !== "undefined") {
setTimeout(function() { setTimeout(function() {
fn(arg); fn(arg);
@ -49,27 +55,65 @@ Async.prototype.throwLater = function(fn, arg) {
} }
}; };
Async.prototype.invokeLater = function (fn, receiver, arg) { function AsyncInvokeLater(fn, receiver, arg) {
fn = this._withDomain(fn);
this._lateQueue.push(fn, receiver, arg); this._lateQueue.push(fn, receiver, arg);
this._queueTick(); this._queueTick();
}; }
Async.prototype.invokeFirst = function (fn, receiver, arg) { function AsyncInvoke(fn, receiver, arg) {
fn = this._withDomain(fn);
this._normalQueue.unshift(fn, receiver, arg);
this._queueTick();
};
Async.prototype.invoke = function (fn, receiver, arg) {
fn = this._withDomain(fn);
this._normalQueue.push(fn, receiver, arg); this._normalQueue.push(fn, receiver, arg);
this._queueTick(); this._queueTick();
}; }
Async.prototype.settlePromises = function(promise) { function AsyncSettlePromises(promise) {
this._normalQueue._pushOne(promise); this._normalQueue._pushOne(promise);
this._queueTick(); this._queueTick();
}
if (!util.hasDevTools) {
Async.prototype.invokeLater = AsyncInvokeLater;
Async.prototype.invoke = AsyncInvoke;
Async.prototype.settlePromises = AsyncSettlePromises;
} else {
if (schedule.isStatic) {
schedule = function(fn) { setTimeout(fn, 0); };
}
Async.prototype.invokeLater = function (fn, receiver, arg) {
if (this._trampolineEnabled) {
AsyncInvokeLater.call(this, fn, receiver, arg);
} else {
this._schedule(function() {
setTimeout(function() {
fn.call(receiver, arg);
}, 100);
});
}
};
Async.prototype.invoke = function (fn, receiver, arg) {
if (this._trampolineEnabled) {
AsyncInvoke.call(this, fn, receiver, arg);
} else {
this._schedule(function() {
fn.call(receiver, arg);
});
}
};
Async.prototype.settlePromises = function(promise) {
if (this._trampolineEnabled) {
AsyncSettlePromises.call(this, promise);
} else {
this._schedule(function() {
promise._settlePromises();
});
}
};
}
Async.prototype.invokeFirst = function (fn, receiver, arg) {
this._normalQueue.unshift(fn, receiver, arg);
this._queueTick();
}; };
Async.prototype._drainQueue = function(queue) { Async.prototype._drainQueue = function(queue) {

View File

@ -10,7 +10,6 @@ var targetRejected = function(e, context) {
}; };
var bindingResolved = function(thisArg, context) { var bindingResolved = function(thisArg, context) {
this._setBoundTo(thisArg);
if (this._isPending()) { if (this._isPending()) {
this._resolveCallback(context.target); this._resolveCallback(context.target);
} }
@ -25,6 +24,8 @@ Promise.prototype.bind = function (thisArg) {
var ret = new Promise(INTERNAL); var ret = new Promise(INTERNAL);
ret._propagateFrom(this, 1); ret._propagateFrom(this, 1);
var target = this._target(); var target = this._target();
ret._setBoundTo(maybePromise);
if (maybePromise instanceof Promise) { if (maybePromise instanceof Promise) {
var context = { var context = {
promiseRejectionQueued: false, promiseRejectionQueued: false,
@ -36,7 +37,6 @@ Promise.prototype.bind = function (thisArg) {
maybePromise._then( maybePromise._then(
bindingResolved, bindingRejected, ret._progress, ret, context); bindingResolved, bindingRejected, ret._progress, ret, context);
} else { } else {
ret._setBoundTo(thisArg);
ret._resolveCallback(target); ret._resolveCallback(target);
} }
return ret; return ret;
@ -59,13 +59,12 @@ Promise.bind = function (thisArg, value) {
var maybePromise = tryConvertToPromise(thisArg); var maybePromise = tryConvertToPromise(thisArg);
var ret = new Promise(INTERNAL); var ret = new Promise(INTERNAL);
ret._setBoundTo(maybePromise);
if (maybePromise instanceof Promise) { if (maybePromise instanceof Promise) {
maybePromise._then(function(thisArg) { maybePromise._then(function() {
ret._setBoundTo(thisArg);
ret._resolveCallback(value); ret._resolveCallback(value);
}, ret._reject, ret._progress, ret, null); }, ret._reject, ret._progress, ret, null);
} else { } else {
ret._setBoundTo(thisArg);
ret._resolveCallback(value); ret._resolveCallback(value);
} }
return ret; return ret;

View File

@ -25,6 +25,7 @@ Promise.prototype.cancel = function (reason) {
Promise.prototype.cancellable = function () { Promise.prototype.cancellable = function () {
if (this._cancellable()) return this; if (this._cancellable()) return this;
async.enableTrampoline();
this._setCancellable(); this._setCancellable();
this._cancellationParent = undefined; this._cancellationParent = undefined;
return this; return this;

View File

@ -87,7 +87,7 @@ CapturedTrace.prototype.attachExtraTrace = function(error) {
} }
removeCommonRoots(stacks); removeCommonRoots(stacks);
removeDuplicateOrEmptyJumps(stacks); removeDuplicateOrEmptyJumps(stacks);
error.stack = reconstructStack(message, stacks); util.notEnumerableProp(error, "stack", reconstructStack(message, stacks));
util.notEnumerableProp(error, "__stackCleaned__", true); util.notEnumerableProp(error, "__stackCleaned__", true);
}; };
@ -382,7 +382,8 @@ var captureStackTrace = (function stackDetection() {
catch(e) { catch(e) {
hasStackAfterThrow = ("stack" in e); hasStackAfterThrow = ("stack" in e);
} }
if (!("stack" in err) && hasStackAfterThrow) { if (!("stack" in err) && hasStackAfterThrow &&
typeof Error.stackTraceLimit === "number") {
stackFramePattern = v8stackFramePattern; stackFramePattern = v8stackFramePattern;
formatStack = v8stackFormatter; formatStack = v8stackFormatter;
return function captureStackTrace(o) { return function captureStackTrace(o) {

View File

@ -30,7 +30,7 @@ function safePredicate(predicate, e) {
CatchFilter.prototype.doFilter = function (e) { CatchFilter.prototype.doFilter = function (e) {
var cb = this._callback; var cb = this._callback;
var promise = this._promise; var promise = this._promise;
var boundTo = promise._boundTo; var boundTo = promise._boundValue();
for (var i = 0, len = this._instances.length; i < len; ++i) { for (var i = 0, len = this._instances.length; i < len; ++i) {
var item = this._instances[i]; var item = this._instances[i];
var itemIsErrorType = item === Error || var itemIsErrorType = item === Error ||

View File

@ -1,5 +1,6 @@
"use strict"; "use strict";
module.exports = function(Promise, CapturedTrace) { module.exports = function(Promise, CapturedTrace) {
var getDomain = Promise._getDomain;
var async = require("./async.js"); var async = require("./async.js");
var Warning = require("./errors.js").Warning; var Warning = require("./errors.js").Warning;
var util = require("./util.js"); var util = require("./util.js");
@ -10,7 +11,17 @@ var debugging = false || (util.isNode &&
(!!process.env["BLUEBIRD_DEBUG"] || (!!process.env["BLUEBIRD_DEBUG"] ||
process.env["NODE_ENV"] === "development")); process.env["NODE_ENV"] === "development"));
if (debugging) {
async.disableTrampolineIfNecessary();
}
Promise.prototype._ignoreRejections = function() {
this._unsetRejectionIsUnhandled();
this._bitField = this._bitField | 16777216;
};
Promise.prototype._ensurePossibleRejectionHandled = function () { Promise.prototype._ensurePossibleRejectionHandled = function () {
if ((this._bitField & 16777216) !== 0) return;
this._setRejectionIsUnhandled(); this._setRejectionIsUnhandled();
async.invokeLater(this._notifyUnhandledRejection, this, undefined); async.invokeLater(this._notifyUnhandledRejection, this, undefined);
}; };
@ -89,7 +100,8 @@ Promise.prototype._attachExtraTrace = function (error, ignoreSelf) {
trace.attachExtraTrace(error); trace.attachExtraTrace(error);
} else if (!error.__stackCleaned__) { } else if (!error.__stackCleaned__) {
var parsed = CapturedTrace.parseStackAndMessage(error); var parsed = CapturedTrace.parseStackAndMessage(error);
error.stack = parsed.message + "\n" + parsed.stack.join("\n"); util.notEnumerableProp(error, "stack",
parsed.message + "\n" + parsed.stack.join("\n"));
util.notEnumerableProp(error, "__stackCleaned__", true); util.notEnumerableProp(error, "__stackCleaned__", true);
} }
} }
@ -108,11 +120,17 @@ Promise.prototype._warn = function(message) {
}; };
Promise.onPossiblyUnhandledRejection = function (fn) { Promise.onPossiblyUnhandledRejection = function (fn) {
possiblyUnhandledRejection = typeof fn === "function" ? fn : undefined; var domain = getDomain();
possiblyUnhandledRejection =
typeof fn === "function" ? (domain === null ? fn : domain.bind(fn))
: undefined;
}; };
Promise.onUnhandledRejectionHandled = function (fn) { Promise.onUnhandledRejectionHandled = function (fn) {
unhandledRejectionHandled = typeof fn === "function" ? fn : undefined; var domain = getDomain();
unhandledRejectionHandled =
typeof fn === "function" ? (domain === null ? fn : domain.bind(fn))
: undefined;
}; };
Promise.longStackTraces = function () { Promise.longStackTraces = function () {
@ -122,6 +140,9 @@ Promise.longStackTraces = function () {
throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/DT1qyG\u000a"); throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/DT1qyG\u000a");
} }
debugging = CapturedTrace.isSupported(); debugging = CapturedTrace.isSupported();
if (debugging) {
async.disableTrampolineIfNecessary();
}
}; };
Promise.hasLongStackTraces = function () { Promise.hasLongStackTraces = function () {

View File

@ -1,7 +1,6 @@
"use strict"; "use strict";
var util = require("./util.js"); var util = require("./util.js");
var isPrimitive = util.isPrimitive; var isPrimitive = util.isPrimitive;
var wrapsPrimitiveReceiver = util.wrapsPrimitiveReceiver;
module.exports = function(Promise) { module.exports = function(Promise) {
var returner = function () { var returner = function () {
@ -10,6 +9,10 @@ var returner = function () {
var thrower = function () { var thrower = function () {
throw this; throw this;
}; };
var returnUndefined = function() {};
var throwUndefined = function() {
throw undefined;
};
var wrapper = function (value, action) { var wrapper = function (value, action) {
if (action === 1) { if (action === 1) {
@ -26,7 +29,9 @@ var wrapper = function (value, action) {
Promise.prototype["return"] = Promise.prototype["return"] =
Promise.prototype.thenReturn = function (value) { Promise.prototype.thenReturn = function (value) {
if (wrapsPrimitiveReceiver && isPrimitive(value)) { if (value === undefined) return this.then(returnUndefined);
if (isPrimitive(value)) {
return this._then( return this._then(
wrapper(value, 2), wrapper(value, 2),
undefined, undefined,
@ -40,7 +45,9 @@ Promise.prototype.thenReturn = function (value) {
Promise.prototype["throw"] = Promise.prototype["throw"] =
Promise.prototype.thenThrow = function (reason) { Promise.prototype.thenThrow = function (reason) {
if (wrapsPrimitiveReceiver && isPrimitive(reason)) { if (reason === undefined) return this.then(throwUndefined);
if (isPrimitive(reason)) {
return this._then( return this._then(
wrapper(reason, 1), wrapper(reason, 1),
undefined, undefined,

View File

@ -1,7 +1,6 @@
"use strict"; "use strict";
module.exports = function(Promise, NEXT_FILTER, tryConvertToPromise) { module.exports = function(Promise, NEXT_FILTER, tryConvertToPromise) {
var util = require("./util.js"); var util = require("./util.js");
var wrapsPrimitiveReceiver = util.wrapsPrimitiveReceiver;
var isPrimitive = util.isPrimitive; var isPrimitive = util.isPrimitive;
var thrower = util.thrower; var thrower = util.thrower;
@ -23,7 +22,7 @@ function throw$(r) {
} }
function promisedFinally(ret, reasonOrValue, isFulfilled) { function promisedFinally(ret, reasonOrValue, isFulfilled) {
var then; var then;
if (wrapsPrimitiveReceiver && isPrimitive(reasonOrValue)) { if (isPrimitive(reasonOrValue)) {
then = isFulfilled ? return$(reasonOrValue) : throw$(reasonOrValue); then = isFulfilled ? return$(reasonOrValue) : throw$(reasonOrValue);
} else { } else {
then = isFulfilled ? returnThis : throwThis; then = isFulfilled ? returnThis : throwThis;
@ -36,7 +35,7 @@ function finallyHandler(reasonOrValue) {
var handler = this.handler; var handler = this.handler;
var ret = promise._isBound() var ret = promise._isBound()
? handler.call(promise._boundTo) ? handler.call(promise._boundValue())
: handler(); : handler();
if (ret !== undefined) { if (ret !== undefined) {
@ -61,7 +60,7 @@ function tapHandler(value) {
var handler = this.handler; var handler = this.handler;
var ret = promise._isBound() var ret = promise._isBound()
? handler.call(promise._boundTo, value) ? handler.call(promise._boundValue(), value)
: handler(value); : handler(value);
if (ret !== undefined) { if (ret !== undefined) {

View File

@ -4,6 +4,7 @@ module.exports = function(Promise,
apiRejection, apiRejection,
tryConvertToPromise, tryConvertToPromise,
INTERNAL) { INTERNAL) {
var getDomain = Promise._getDomain;
var async = require("./async.js"); var async = require("./async.js");
var util = require("./util.js"); var util = require("./util.js");
var tryCatch = util.tryCatch; var tryCatch = util.tryCatch;
@ -14,7 +15,8 @@ var EMPTY_ARRAY = [];
function MappingPromiseArray(promises, fn, limit, _filter) { function MappingPromiseArray(promises, fn, limit, _filter) {
this.constructor$(promises); this.constructor$(promises);
this._promise._captureStackTrace(); this._promise._captureStackTrace();
this._callback = fn; var domain = getDomain();
this._callback = domain === null ? fn : domain.bind(fn);
this._preservedValues = _filter === INTERNAL this._preservedValues = _filter === INTERNAL
? new Array(this.length()) ? new Array(this.length())
: null; : null;
@ -49,7 +51,7 @@ MappingPromiseArray.prototype._promiseFulfilled = function (value, index) {
if (preservedValues !== null) preservedValues[index] = value; if (preservedValues !== null) preservedValues[index] = value;
var callback = this._callback; var callback = this._callback;
var receiver = this._promise._boundTo; var receiver = this._promise._boundValue();
this._promise._pushContext(); this._promise._pushContext();
var ret = tryCatch(callback).call(receiver, value, index, length); var ret = tryCatch(callback).call(receiver, value, index, length);
this._promise._popContext(); this._promise._popContext();

View File

@ -8,7 +8,8 @@ var errorObj = util.errorObj;
function spreadAdapter(val, nodeback) { function spreadAdapter(val, nodeback) {
var promise = this; var promise = this;
if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback);
var ret = tryCatch(nodeback).apply(promise._boundTo, [null].concat(val)); var ret =
tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val));
if (ret === errorObj) { if (ret === errorObj) {
async.throwLater(ret.e); async.throwLater(ret.e);
} }
@ -16,7 +17,7 @@ function spreadAdapter(val, nodeback) {
function successAdapter(val, nodeback) { function successAdapter(val, nodeback) {
var promise = this; var promise = this;
var receiver = promise._boundTo; var receiver = promise._boundValue();
var ret = val === undefined var ret = val === undefined
? tryCatch(nodeback).call(receiver, null) ? tryCatch(nodeback).call(receiver, null)
: tryCatch(nodeback).call(receiver, null, val); : tryCatch(nodeback).call(receiver, null, val);
@ -32,12 +33,13 @@ function errorAdapter(reason, nodeback) {
newReason.cause = reason; newReason.cause = reason;
reason = newReason; reason = newReason;
} }
var ret = tryCatch(nodeback).call(promise._boundTo, reason); var ret = tryCatch(nodeback).call(promise._boundValue(), reason);
if (ret === errorObj) { if (ret === errorObj) {
async.throwLater(ret.e); async.throwLater(ret.e);
} }
} }
Promise.prototype.asCallback =
Promise.prototype.nodeify = function (nodeback, options) { Promise.prototype.nodeify = function (nodeback, options) {
if (typeof nodeback == "function") { if (typeof nodeback == "function") {
var adapter = successAdapter; var adapter = successAdapter;

View File

@ -9,7 +9,23 @@ var reflect = function() {
var apiRejection = function(msg) { var apiRejection = function(msg) {
return Promise.reject(new TypeError(msg)); return Promise.reject(new TypeError(msg));
}; };
var util = require("./util.js"); var util = require("./util.js");
var getDomain;
if (util.isNode) {
getDomain = function() {
var ret = process.domain;
if (ret === undefined) ret = null;
return ret;
};
} else {
getDomain = function() {
return null;
};
}
util.notEnumerableProp(Promise, "_getDomain", getDomain);
var async = require("./async.js"); var async = require("./async.js");
var errors = require("./errors.js"); var errors = require("./errors.js");
var TypeError = Promise.TypeError = errors.TypeError; var TypeError = Promise.TypeError = errors.TypeError;
@ -208,8 +224,12 @@ Promise.prototype._then = function (
if (!haveInternalData) ret._setIsMigrated(); if (!haveInternalData) ret._setIsMigrated();
} }
var callbackIndex = var callbackIndex = target._addCallbacks(didFulfill,
target._addCallbacks(didFulfill, didReject, didProgress, ret, receiver); didReject,
didProgress,
ret,
receiver,
getDomain());
if (target._isResolved() && !target._isSettlePromisesQueued()) { if (target._isResolved() && !target._isSettlePromisesQueued()) {
async.invoke( async.invoke(
@ -291,7 +311,7 @@ Promise.prototype._receiverAt = function (index) {
: this[ : this[
index * 5 - 5 + 4]; index * 5 - 5 + 4];
if (ret === undefined && this._isBound()) { if (ret === undefined && this._isBound()) {
return this._boundTo; return this._boundValue();
} }
return ret; return ret;
}; };
@ -314,6 +334,20 @@ Promise.prototype._rejectionHandlerAt = function (index) {
: this[index * 5 - 5 + 1]; : this[index * 5 - 5 + 1];
}; };
Promise.prototype._boundValue = function() {
var ret = this._boundTo;
if (ret !== undefined) {
if (ret instanceof Promise) {
if (ret.isFulfilled()) {
return ret.value();
} else {
return undefined;
}
}
}
return ret;
};
Promise.prototype._migrateCallbacks = function (follower, index) { Promise.prototype._migrateCallbacks = function (follower, index) {
var fulfill = follower._fulfillmentHandlerAt(index); var fulfill = follower._fulfillmentHandlerAt(index);
var reject = follower._rejectionHandlerAt(index); var reject = follower._rejectionHandlerAt(index);
@ -321,7 +355,7 @@ Promise.prototype._migrateCallbacks = function (follower, index) {
var promise = follower._promiseAt(index); var promise = follower._promiseAt(index);
var receiver = follower._receiverAt(index); var receiver = follower._receiverAt(index);
if (promise instanceof Promise) promise._setIsMigrated(); if (promise instanceof Promise) promise._setIsMigrated();
this._addCallbacks(fulfill, reject, progress, promise, receiver); this._addCallbacks(fulfill, reject, progress, promise, receiver, null);
}; };
Promise.prototype._addCallbacks = function ( Promise.prototype._addCallbacks = function (
@ -329,7 +363,8 @@ Promise.prototype._addCallbacks = function (
reject, reject,
progress, progress,
promise, promise,
receiver receiver,
domain
) { ) {
var index = this._length(); var index = this._length();
@ -341,20 +376,34 @@ Promise.prototype._addCallbacks = function (
if (index === 0) { if (index === 0) {
this._promise0 = promise; this._promise0 = promise;
if (receiver !== undefined) this._receiver0 = receiver; if (receiver !== undefined) this._receiver0 = receiver;
if (typeof fulfill === "function" && !this._isCarryingStackTrace()) if (typeof fulfill === "function" && !this._isCarryingStackTrace()) {
this._fulfillmentHandler0 = fulfill; this._fulfillmentHandler0 =
if (typeof reject === "function") this._rejectionHandler0 = reject; domain === null ? fulfill : domain.bind(fulfill);
if (typeof progress === "function") this._progressHandler0 = progress; }
if (typeof reject === "function") {
this._rejectionHandler0 =
domain === null ? reject : domain.bind(reject);
}
if (typeof progress === "function") {
this._progressHandler0 =
domain === null ? progress : domain.bind(progress);
}
} else { } else {
var base = index * 5 - 5; var base = index * 5 - 5;
this[base + 3] = promise; this[base + 3] = promise;
this[base + 4] = receiver; this[base + 4] = receiver;
if (typeof fulfill === "function") if (typeof fulfill === "function") {
this[base + 0] = fulfill; this[base + 0] =
if (typeof reject === "function") domain === null ? fulfill : domain.bind(fulfill);
this[base + 1] = reject; }
if (typeof progress === "function") if (typeof reject === "function") {
this[base + 2] = progress; this[base + 1] =
domain === null ? reject : domain.bind(reject);
}
if (typeof progress === "function") {
this[base + 2] =
domain === null ? progress : domain.bind(progress);
}
} }
this._setLength(index + 1); this._setLength(index + 1);
return index; return index;
@ -449,7 +498,7 @@ Promise.prototype._settlePromiseFromHandler = function (
promise._pushContext(); promise._pushContext();
var x; var x;
if (receiver === APPLY && !this._isRejected()) { if (receiver === APPLY && !this._isRejected()) {
x = tryCatch(handler).apply(this._boundTo, value); x = tryCatch(handler).apply(this._boundValue(), value);
} else { } else {
x = tryCatch(handler).call(receiver, value); x = tryCatch(handler).call(receiver, value);
} }
@ -519,8 +568,6 @@ Promise.prototype._settlePromiseAt = function (index) {
this._isCarryingStackTrace() ? this._getCarriedStackTrace() : undefined; this._isCarryingStackTrace() ? this._getCarriedStackTrace() : undefined;
var value = this._settledValue; var value = this._settledValue;
var receiver = this._receiverAt(index); var receiver = this._receiverAt(index);
this._clearCallbackDataAtIndex(index); this._clearCallbackDataAtIndex(index);
if (typeof handler === "function") { if (typeof handler === "function") {
@ -647,7 +694,11 @@ Promise.prototype._settlePromises = function () {
} }
}; };
Promise._makeSelfResolutionError = makeSelfResolutionError; util.notEnumerableProp(Promise,
"_makeSelfResolutionError",
makeSelfResolutionError);
require("./progress.js")(Promise, PromiseArray);
require("./method.js")(Promise, INTERNAL, tryConvertToPromise, apiRejection); require("./method.js")(Promise, INTERNAL, tryConvertToPromise, apiRejection);
require("./bind.js")(Promise, INTERNAL, tryConvertToPromise); require("./bind.js")(Promise, INTERNAL, tryConvertToPromise);
require("./finally.js")(Promise, NEXT_FILTER, tryConvertToPromise); require("./finally.js")(Promise, NEXT_FILTER, tryConvertToPromise);
@ -656,18 +707,17 @@ require("./synchronous_inspection.js")(Promise);
require("./join.js")(Promise, PromiseArray, tryConvertToPromise, INTERNAL); require("./join.js")(Promise, PromiseArray, tryConvertToPromise, INTERNAL);
Promise.Promise = Promise; Promise.Promise = Promise;
require('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL); require('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL);
require('./cancel.js')(Promise);
require('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext); require('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext);
require('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise); require('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise);
require('./nodeify.js')(Promise); require('./nodeify.js')(Promise);
require('./cancel.js')(Promise); require('./call_get.js')(Promise);
require('./promisify.js')(Promise, INTERNAL);
require('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); require('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection);
require('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); require('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection);
require('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL); require('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL);
require('./settle.js')(Promise, PromiseArray); require('./settle.js')(Promise, PromiseArray);
require('./call_get.js')(Promise);
require('./some.js')(Promise, PromiseArray, apiRejection); require('./some.js')(Promise, PromiseArray, apiRejection);
require('./progress.js')(Promise, PromiseArray); require('./promisify.js')(Promise, INTERNAL);
require('./any.js')(Promise); require('./any.js')(Promise);
require('./each.js')(Promise, INTERNAL); require('./each.js')(Promise, INTERNAL);
require('./timers.js')(Promise, INTERNAL); require('./timers.js')(Promise, INTERNAL);

View File

@ -80,7 +80,7 @@ PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {
if (maybePromise instanceof Promise) { if (maybePromise instanceof Promise) {
maybePromise = maybePromise._target(); maybePromise = maybePromise._target();
if (isResolved) { if (isResolved) {
maybePromise._unsetRejectionIsUnhandled(); maybePromise._ignoreRejections();
} else if (maybePromise._isPending()) { } else if (maybePromise._isPending()) {
maybePromise._proxyPromiseArray(this, i); maybePromise._proxyPromiseArray(this, i);
} else if (maybePromise._isFulfilled()) { } else if (maybePromise._isFulfilled()) {

View File

@ -10,12 +10,21 @@ var canEvaluate = util.canEvaluate;
var TypeError = require("./errors").TypeError; var TypeError = require("./errors").TypeError;
var defaultSuffix = "Async"; var defaultSuffix = "Async";
var defaultPromisified = {__isPromisified__: true}; var defaultPromisified = {__isPromisified__: true};
var noCopyPropsPattern = var noCopyProps = [
/^(?:length|name|arguments|caller|prototype|__isPromisified__)$/; "arity", "length",
var defaultFilter = function(name, func) { "name",
"arguments",
"caller",
"callee",
"prototype",
"__isPromisified__"
];
var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$");
var defaultFilter = function(name) {
return util.isIdentifier(name) && return util.isIdentifier(name) &&
name.charAt(0) !== "_" && name.charAt(0) !== "_" &&
!util.isClass(func); name !== "constructor";
}; };
function propsFilter(key) { function propsFilter(key) {
@ -159,6 +168,7 @@ function(callback, receiver, originalName, fn) {
"nodebackForPromise", "nodebackForPromise",
"tryCatch", "tryCatch",
"errorObj", "errorObj",
"notEnumerableProp",
"INTERNAL","'use strict'; \n\ "INTERNAL","'use strict'; \n\
var ret = function (Parameters) { \n\ var ret = function (Parameters) { \n\
'use strict'; \n\ 'use strict'; \n\
@ -176,7 +186,7 @@ function(callback, receiver, originalName, fn) {
} \n\ } \n\
return promise; \n\ return promise; \n\
}; \n\ }; \n\
ret.__isPromisified__ = true; \n\ notEnumerableProp(ret, '__isPromisified__', true); \n\
return ret; \n\ return ret; \n\
" "
.replace("Parameters", parameterDeclaration(newParameterCount)) .replace("Parameters", parameterDeclaration(newParameterCount))
@ -190,6 +200,7 @@ function(callback, receiver, originalName, fn) {
nodebackForPromise, nodebackForPromise,
util.tryCatch, util.tryCatch,
util.errorObj, util.errorObj,
util.notEnumerableProp,
INTERNAL INTERNAL
); );
}; };
@ -216,7 +227,7 @@ function makeNodePromisifiedClosure(callback, receiver, _, fn) {
} }
return promise; return promise;
} }
promisified.__isPromisified__ = true; util.notEnumerableProp(promisified, "__isPromisified__", true);
return promisified; return promisified;
} }

View File

@ -4,6 +4,7 @@ module.exports = function(Promise,
apiRejection, apiRejection,
tryConvertToPromise, tryConvertToPromise,
INTERNAL) { INTERNAL) {
var getDomain = Promise._getDomain;
var async = require("./async.js"); var async = require("./async.js");
var util = require("./util.js"); var util = require("./util.js");
var tryCatch = util.tryCatch; var tryCatch = util.tryCatch;
@ -32,7 +33,8 @@ function ReductionPromiseArray(promises, fn, accum, _each) {
} }
} }
if (!(isPromise || this._zerothIsAccum)) this._gotAccum = true; if (!(isPromise || this._zerothIsAccum)) this._gotAccum = true;
this._callback = fn; var domain = getDomain();
this._callback = domain === null ? fn : domain.bind(fn);
this._accum = accum; this._accum = accum;
if (!rejected) async.invoke(init, this, undefined); if (!rejected) async.invoke(init, this, undefined);
} }
@ -86,7 +88,7 @@ ReductionPromiseArray.prototype._promiseFulfilled = function (value, index) {
if (!gotAccum) return; if (!gotAccum) return;
var callback = this._callback; var callback = this._callback;
var receiver = this._promise._boundTo; var receiver = this._promise._boundValue();
var ret; var ret;
for (var i = this._reducingIndex; i < length; ++i) { for (var i = this._reducingIndex; i < length; ++i) {

View File

@ -1,8 +1,19 @@
"use strict"; "use strict";
var schedule; var schedule;
if (require("./util.js").isNode) { var util = require("./util");
schedule = process.nextTick; var noAsyncScheduler = function() {
} else if (typeof MutationObserver !== "undefined") { throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/m3OTXk\u000a");
};
if (util.isNode && typeof MutationObserver === "undefined") {
var GlobalSetImmediate = global.setImmediate;
var ProcessNextTick = process.nextTick;
schedule = util.isRecentNode
? function(fn) { GlobalSetImmediate.call(global, fn); }
: function(fn) { ProcessNextTick.call(process, fn); };
} else if ((typeof MutationObserver !== "undefined") &&
!(typeof window !== "undefined" &&
window.navigator &&
window.navigator.standalone)) {
schedule = function(fn) { schedule = function(fn) {
var div = document.createElement("div"); var div = document.createElement("div");
var observer = new MutationObserver(fn); var observer = new MutationObserver(fn);
@ -10,13 +21,15 @@ if (require("./util.js").isNode) {
return function() { div.classList.toggle("foo"); }; return function() { div.classList.toggle("foo"); };
}; };
schedule.isStatic = true; schedule.isStatic = true;
} else if (typeof setImmediate !== "undefined") {
schedule = function (fn) {
setImmediate(fn);
};
} else if (typeof setTimeout !== "undefined") { } else if (typeof setTimeout !== "undefined") {
schedule = function (fn) { schedule = function (fn) {
setTimeout(fn, 0); setTimeout(fn, 0);
}; };
} else { } else {
schedule = function() { schedule = noAsyncScheduler;
throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/m3OTXk\u000a");
};
} }
module.exports = schedule; module.exports = schedule;

View File

@ -61,12 +61,7 @@ function doThenable(x, then, context) {
function resolveFromThenable(value) { function resolveFromThenable(value) {
if (!promise) return; if (!promise) return;
if (x === value) {
promise._rejectCallback(
Promise._makeSelfResolutionError(), false, true);
} else {
promise._resolveCallback(value); promise._resolveCallback(value);
}
promise = null; promise = null;
} }

View File

@ -21,7 +21,9 @@ var errorObj = {e: {}};
var tryCatchTarget; var tryCatchTarget;
function tryCatcher() { function tryCatcher() {
try { try {
return tryCatchTarget.apply(this, arguments); var target = tryCatchTarget;
tryCatchTarget = null;
return target.apply(this, arguments);
} catch (e) { } catch (e) {
errorObj.e = e; errorObj.e = e;
return errorObj; return errorObj;
@ -82,6 +84,7 @@ function withAppended(target, appendee) {
function getDataPropertyOrDefault(obj, key, defaultValue) { function getDataPropertyOrDefault(obj, key, defaultValue) {
if (es5.isES5) { if (es5.isES5) {
var desc = Object.getOwnPropertyDescriptor(obj, key); var desc = Object.getOwnPropertyDescriptor(obj, key);
if (desc != null) { if (desc != null) {
return desc.get == null && desc.set == null return desc.get == null && desc.set == null
? desc.value ? desc.value
@ -104,23 +107,32 @@ function notEnumerableProp(obj, name, value) {
return obj; return obj;
} }
var wrapsPrimitiveReceiver = (function() {
return this !== "string";
}).call("string");
function thrower(r) { function thrower(r) {
throw r; throw r;
} }
var inheritedDataKeys = (function() { var inheritedDataKeys = (function() {
var excludedPrototypes = [
Array.prototype,
Object.prototype,
Function.prototype
];
var isExcludedProto = function(val) {
for (var i = 0; i < excludedPrototypes.length; ++i) {
if (excludedPrototypes[i] === val) {
return true;
}
}
return false;
};
if (es5.isES5) { if (es5.isES5) {
var oProto = Object.prototype;
var getKeys = Object.getOwnPropertyNames; var getKeys = Object.getOwnPropertyNames;
return function(obj) { return function(obj) {
var ret = []; var ret = [];
var visitedKeys = Object.create(null); var visitedKeys = Object.create(null);
while (obj != null && obj !== oProto) { while (obj != null && !isExcludedProto(obj)) {
var keys; var keys;
try { try {
keys = getKeys(obj); keys = getKeys(obj);
@ -141,11 +153,23 @@ var inheritedDataKeys = (function() {
return ret; return ret;
}; };
} else { } else {
var hasProp = {}.hasOwnProperty;
return function(obj) { return function(obj) {
if (isExcludedProto(obj)) return [];
var ret = []; var ret = [];
/*jshint forin:false */ /*jshint forin:false */
for (var key in obj) { enumeration: for (var key in obj) {
if (hasProp.call(obj, key)) {
ret.push(key); ret.push(key);
} else {
for (var i = 0; i < excludedPrototypes.length; ++i) {
if (hasProp.call(excludedPrototypes[i], key)) {
continue enumeration;
}
}
ret.push(key);
}
} }
return ret; return ret;
}; };
@ -153,13 +177,22 @@ var inheritedDataKeys = (function() {
})(); })();
var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/;
function isClass(fn) { function isClass(fn) {
try { try {
if (typeof fn === "function") { if (typeof fn === "function") {
var keys = es5.names(fn.prototype); var keys = es5.names(fn.prototype);
if (es5.isES5) return keys.length > 1;
return keys.length > 0 && var hasMethods = es5.isES5 && keys.length > 1;
var hasMethodsOtherThanConstructor = keys.length > 0 &&
!(keys.length === 1 && keys[0] === "constructor"); !(keys.length === 1 && keys[0] === "constructor");
var hasThisAssignmentAndStaticMethods =
thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0;
if (hasMethods || hasMethodsOtherThanConstructor ||
hasThisAssignmentAndStaticMethods) {
return true;
}
} }
return false; return false;
} catch (e) { } catch (e) {
@ -168,10 +201,12 @@ function isClass(fn) {
} }
function toFastProperties(obj) { function toFastProperties(obj) {
/*jshint -W027*/ /*jshint -W027,-W055,-W031*/
function f() {} function f() {}
f.prototype = obj; f.prototype = obj;
return f; var l = 8;
while (l--) new f();
return obj;
eval(obj); eval(obj);
} }
@ -237,7 +272,9 @@ function copyDescriptors(from, to, filter) {
for (var i = 0; i < keys.length; ++i) { for (var i = 0; i < keys.length; ++i) {
var key = keys[i]; var key = keys[i];
if (filter(key)) { if (filter(key)) {
try {
es5.defineProperty(to, key, es5.getDescriptor(from, key)); es5.defineProperty(to, key, es5.getDescriptor(from, key));
} catch (ignore) {}
} }
} }
} }
@ -259,7 +296,6 @@ var ret = {
inherits: inherits, inherits: inherits,
withAppended: withAppended, withAppended: withAppended,
maybeWrapAsError: maybeWrapAsError, maybeWrapAsError: maybeWrapAsError,
wrapsPrimitiveReceiver: wrapsPrimitiveReceiver,
toFastProperties: toFastProperties, toFastProperties: toFastProperties,
filledRange: filledRange, filledRange: filledRange,
toString: safeToString, toString: safeToString,
@ -269,8 +305,17 @@ var ret = {
markAsOriginatingFromRejection: markAsOriginatingFromRejection, markAsOriginatingFromRejection: markAsOriginatingFromRejection,
classString: classString, classString: classString,
copyDescriptors: copyDescriptors, copyDescriptors: copyDescriptors,
hasDevTools: typeof chrome !== "undefined" && chrome &&
typeof chrome.loadTimes === "function",
isNode: typeof process !== "undefined" && isNode: typeof process !== "undefined" &&
classString(process).toLowerCase() === "[object process]" classString(process).toLowerCase() === "[object process]"
}; };
ret.isRecentNode = ret.isNode && (function() {
var version = process.versions.node.split(".").map(Number);
return (version[0] === 0 && version[1] > 10) || (version[0] > 0);
})();
if (ret.isNode) ret.toFastProperties(process);
try {throw new Error(); } catch (e) {ret.lastLineError = e;} try {throw new Error(); } catch (e) {ret.lastLineError = e;}
module.exports = ret; module.exports = ret;

30
node_modules/bluebird/package.json generated vendored
View File

@ -1,7 +1,7 @@
{ {
"name": "bluebird", "name": "bluebird",
"description": "Full featured Promises/A+ implementation with exceptionally good performance", "description": "Full featured Promises/A+ implementation with exceptionally good performance",
"version": "2.9.14", "version": "2.9.34",
"keywords": [ "keywords": [
"promise", "promise",
"performance", "performance",
@ -15,7 +15,10 @@
"future", "future",
"flow control", "flow control",
"dsl", "dsl",
"fluent interface" "fluent interface",
"parallel",
"thread",
"concurrency"
], ],
"scripts": { "scripts": {
"lint": "node scripts/jshint.js", "lint": "node scripts/jshint.js",
@ -60,7 +63,8 @@
"rx": "^2.3.25", "rx": "^2.3.25",
"serve-static": "^1.7.1", "serve-static": "^1.7.1",
"sinon": "~1.7.3", "sinon": "~1.7.3",
"uglify-js": "~2.4.16" "uglify-js": "~2.4.16",
"kefir": "^2.4.1"
}, },
"main": "./js/main/bluebird.js", "main": "./js/main/bluebird.js",
"browser": "./js/browser/bluebird.js", "browser": "./js/browser/bluebird.js",
@ -68,15 +72,14 @@
"js/browser", "js/browser",
"js/main", "js/main",
"js/zalgo", "js/zalgo",
"LICENSE",
"zalgo.js" "zalgo.js"
], ],
"gitHead": "b61407f36f0051efc1b49d07ef9b9fba5ac31e10", "gitHead": "386ba4f7d588693e5d675290a6b7fade08e0d626",
"_id": "bluebird@2.9.14", "_id": "bluebird@2.9.34",
"_shasum": "5ead2aedbb783f93cf0bdfce5391f179ecab497e", "_shasum": "2f7b4ec80216328a9fddebdf69c8d4942feff7d8",
"_from": "bluebird@>=2.9.14 <3.0.0", "_from": "bluebird@>=2.9.34 <2.10.0",
"_npmVersion": "2.7.0", "_npmVersion": "2.11.1",
"_nodeVersion": "1.5.1", "_nodeVersion": "2.3.0",
"_npmUser": { "_npmUser": {
"name": "esailija", "name": "esailija",
"email": "petka_antonov@hotmail.com" "email": "petka_antonov@hotmail.com"
@ -88,10 +91,9 @@
} }
], ],
"dist": { "dist": {
"shasum": "5ead2aedbb783f93cf0bdfce5391f179ecab497e", "shasum": "2f7b4ec80216328a9fddebdf69c8d4942feff7d8",
"tarball": "http://registry.npmjs.org/bluebird/-/bluebird-2.9.14.tgz" "tarball": "http://registry.npmjs.org/bluebird/-/bluebird-2.9.34.tgz"
}, },
"directories": {}, "directories": {},
"_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.14.tgz", "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.34.tgz"
"readme": "ERROR: No README data found!"
} }

View File

@ -1,17 +1,27 @@
{ {
"name": "escape-string-regexp", "name": "escape-string-regexp",
"version": "1.0.2", "version": "1.0.3",
"description": "Escape RegExp special characters", "description": "Escape RegExp special characters",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/sindresorhus/escape-string-regexp" "url": "git+https://github.com/sindresorhus/escape-string-regexp.git"
}, },
"author": { "author": {
"name": "Sindre Sorhus", "name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com", "email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com" "url": "http://sindresorhus.com"
}, },
"maintainers": [
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
{
"name": "jbnicolai",
"email": "jappelman@xebia.com"
}
],
"engines": { "engines": {
"node": ">=0.8.0" "node": ">=0.8.0"
}, },
@ -36,34 +46,25 @@
"devDependencies": { "devDependencies": {
"mocha": "*" "mocha": "*"
}, },
"gitHead": "0587ee0ee03ea3fcbfa3c15cf67b47f214e20987", "gitHead": "1e446e6b4449b5f1f8868cd31bf8fd25ee37fb4b",
"bugs": { "bugs": {
"url": "https://github.com/sindresorhus/escape-string-regexp/issues" "url": "https://github.com/sindresorhus/escape-string-regexp/issues"
}, },
"homepage": "https://github.com/sindresorhus/escape-string-regexp", "homepage": "https://github.com/sindresorhus/escape-string-regexp",
"_id": "escape-string-regexp@1.0.2", "_id": "escape-string-regexp@1.0.3",
"_shasum": "4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1", "_shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5",
"_from": "escape-string-regexp@~1.0.2", "_from": "escape-string-regexp@>=1.0.3 <1.1.0",
"_npmVersion": "1.4.23", "_npmVersion": "2.1.16",
"_nodeVersion": "0.10.35",
"_npmUser": { "_npmUser": {
"name": "jbnicolai", "name": "jbnicolai",
"email": "jappelman@xebia.com" "email": "jappelman@xebia.com"
}, },
"maintainers": [
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
{
"name": "jbnicolai",
"email": "jappelman@xebia.com"
}
],
"dist": { "dist": {
"shasum": "4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1", "shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5",
"tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz" "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz"
}, },
"directories": {}, "directories": {},
"_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz",
"readme": "ERROR: No README data found!" "readme": "ERROR: No README data found!"
} }

64
node_modules/espree/espree.js generated vendored
View File

@ -580,6 +580,7 @@ function scanPunctuator() {
// The ... operator (spread, restParams, JSX, etc.) // The ... operator (spread, restParams, JSX, etc.)
if (extra.ecmaFeatures.spread || if (extra.ecmaFeatures.spread ||
extra.ecmaFeatures.restParams || extra.ecmaFeatures.restParams ||
extra.ecmaFeatures.experimentalObjectRestSpread ||
(extra.ecmaFeatures.jsx && state.inJSXSpreadAttribute) (extra.ecmaFeatures.jsx && state.inJSXSpreadAttribute)
) { ) {
if (ch1 === "." && ch2 === "." && ch3 === ".") { if (ch1 === "." && ch2 === "." && ch3 === ".") {
@ -2069,7 +2070,7 @@ function throwError(token, messageFormat) {
error = new Error("Line " + token.lineNumber + ": " + msg); error = new Error("Line " + token.lineNumber + ": " + msg);
error.index = token.range[0]; error.index = token.range[0];
error.lineNumber = token.lineNumber; error.lineNumber = token.lineNumber;
error.column = token.range[0] - lineStart + 1; error.column = token.range[0] - token.lineStart + 1;
} else { } else {
error = new Error("Line " + lineNumber + ": " + msg); error = new Error("Line " + lineNumber + ": " + msg);
error.index = index; error.index = index;
@ -2117,7 +2118,7 @@ function throwUnexpected(token) {
if (token.type === Token.Keyword) { if (token.type === Token.Keyword) {
if (syntax.isFutureReservedWord(token.value)) { if (syntax.isFutureReservedWord(token.value)) {
throwError(token, Messages.UnexpectedReserved); throwError(token, Messages.UnexpectedReserved);
} else if (strict && syntax.isStrictModeReservedWord(token.value)) { } else if (strict && syntax.isStrictModeReservedWord(token.value, extra.ecmaFeatures)) {
throwErrorTolerant(token, Messages.StrictReservedWord); throwErrorTolerant(token, Messages.StrictReservedWord);
return; return;
} }
@ -2464,6 +2465,7 @@ function parseObjectProperty() {
allowShorthand = extra.ecmaFeatures.objectLiteralShorthandProperties, allowShorthand = extra.ecmaFeatures.objectLiteralShorthandProperties,
allowGenerators = extra.ecmaFeatures.generators, allowGenerators = extra.ecmaFeatures.generators,
allowDestructuring = extra.ecmaFeatures.destructuring, allowDestructuring = extra.ecmaFeatures.destructuring,
allowSpread = extra.ecmaFeatures.experimentalObjectRestSpread,
marker = markerCreate(); marker = markerCreate();
token = lookahead; token = lookahead;
@ -2612,6 +2614,12 @@ function parseObjectProperty() {
); );
} }
// object spread property
if (allowSpread && match("...")) {
lex();
return markerApply(marker, astNodeFactory.createExperimentalSpreadProperty(parseAssignmentExpression()));
}
// only possibility in this branch is a shorthand generator // only possibility in this branch is a shorthand generator
if (token.type === Token.EOF || token.type === Token.Punctuator) { if (token.type === Token.EOF || token.type === Token.Punctuator) {
if (!allowGenerators || !match("*") || !allowMethod) { if (!allowGenerators || !match("*") || !allowMethod) {
@ -2696,7 +2704,7 @@ function parseObjectInitialiser() {
property = parseObjectProperty(); property = parseObjectProperty();
if (!property.computed) { if (!property.computed && property.type.indexOf("Experimental") === -1) {
name = getFieldName(property.key); name = getFieldName(property.key);
propertyFn = (property.kind === "get") ? PropertyKind.Get : PropertyKind.Set; propertyFn = (property.kind === "get") ? PropertyKind.Get : PropertyKind.Set;
@ -2959,6 +2967,19 @@ function parseNewExpression() {
marker = markerCreate(); marker = markerCreate();
expectKeyword("new"); expectKeyword("new");
if (extra.ecmaFeatures.newTarget && match(".")) {
lex();
if (lookahead.type === Token.Identifier && lookahead.value === "target") {
if (state.inFunctionBody) {
lex();
return markerApply(marker, astNodeFactory.createMetaProperty("new", "target"));
}
}
throwUnexpected(lookahead);
}
callee = parseLeftHandSideExpression(); callee = parseLeftHandSideExpression();
args = match("(") ? parseArguments() : []; args = match("(") ? parseArguments() : [];
@ -3300,6 +3321,17 @@ function reinterpretAsCoverFormalsList(expressions) {
param.type = astNodeTypes.AssignmentPattern; param.type = astNodeTypes.AssignmentPattern;
delete param.operator; delete param.operator;
if (param.right.type === astNodeTypes.YieldExpression) {
if (param.right.argument) {
throwUnexpected(lookahead);
}
param.right.type = astNodeTypes.Identifier;
param.right.name = "yield";
delete param.right.argument;
delete param.right.delegate;
}
params.push(param); params.push(param);
validateParam(options, param.left, param.left.name); validateParam(options, param.left, param.left.name);
} else { } else {
@ -3351,7 +3383,8 @@ function parseArrowFunctionExpression(options, marker) {
function reinterpretAsAssignmentBindingPattern(expr) { function reinterpretAsAssignmentBindingPattern(expr) {
var i, len, property, element, var i, len, property, element,
allowDestructuring = extra.ecmaFeatures.destructuring; allowDestructuring = extra.ecmaFeatures.destructuring,
allowRest = extra.ecmaFeatures.experimentalObjectRestSpread;
if (!allowDestructuring) { if (!allowDestructuring) {
throwUnexpected(lex()); throwUnexpected(lex());
@ -3361,6 +3394,18 @@ function reinterpretAsAssignmentBindingPattern(expr) {
expr.type = astNodeTypes.ObjectPattern; expr.type = astNodeTypes.ObjectPattern;
for (i = 0, len = expr.properties.length; i < len; i += 1) { for (i = 0, len = expr.properties.length; i < len; i += 1) {
property = expr.properties[i]; property = expr.properties[i];
if (allowRest && property.type === astNodeTypes.ExperimentalSpreadProperty) {
// only allow identifiers
if (property.argument.type !== astNodeTypes.Identifier) {
throwErrorTolerant({}, "Invalid object rest.");
}
property.type = astNodeTypes.ExperimentalRestProperty;
return;
}
if (property.kind !== "init") { if (property.kind !== "init") {
throwErrorTolerant({}, Messages.InvalidLHSInAssignment); throwErrorTolerant({}, Messages.InvalidLHSInAssignment);
} }
@ -3594,7 +3639,7 @@ function parseVariableIdentifier() {
token = lex(); token = lex();
if (token.type !== Token.Identifier) { if (token.type !== Token.Identifier) {
if (strict && token.type === Token.Keyword && syntax.isStrictModeReservedWord(token.value)) { if (strict && token.type === Token.Keyword && syntax.isStrictModeReservedWord(token.value, extra.ecmaFeatures)) {
throwErrorTolerant(token, Messages.StrictReservedWord); throwErrorTolerant(token, Messages.StrictReservedWord);
} else { } else {
throwUnexpected(token); throwUnexpected(token);
@ -4402,7 +4447,7 @@ function validateParam(options, param, name) {
if (syntax.isRestrictedWord(name)) { if (syntax.isRestrictedWord(name)) {
options.firstRestricted = param; options.firstRestricted = param;
options.message = Messages.StrictParamName; options.message = Messages.StrictParamName;
} else if (syntax.isStrictModeReservedWord(name)) { } else if (syntax.isStrictModeReservedWord(name, extra.ecmaFeatures)) {
options.firstRestricted = param; options.firstRestricted = param;
options.message = Messages.StrictReservedWord; options.message = Messages.StrictReservedWord;
} else if (options.paramSet.has(name)) { } else if (options.paramSet.has(name)) {
@ -4532,7 +4577,7 @@ function parseFunctionDeclaration(identifierIsOptional) {
if (syntax.isRestrictedWord(token.value)) { if (syntax.isRestrictedWord(token.value)) {
firstRestricted = token; firstRestricted = token;
message = Messages.StrictFunctionName; message = Messages.StrictFunctionName;
} else if (syntax.isStrictModeReservedWord(token.value)) { } else if (syntax.isStrictModeReservedWord(token.value, extra.ecmaFeatures)) {
firstRestricted = token; firstRestricted = token;
message = Messages.StrictReservedWord; message = Messages.StrictReservedWord;
} }
@ -4597,7 +4642,7 @@ function parseFunctionExpression() {
if (syntax.isRestrictedWord(token.value)) { if (syntax.isRestrictedWord(token.value)) {
firstRestricted = token; firstRestricted = token;
message = Messages.StrictFunctionName; message = Messages.StrictFunctionName;
} else if (syntax.isStrictModeReservedWord(token.value)) { } else if (syntax.isStrictModeReservedWord(token.value, extra.ecmaFeatures)) {
firstRestricted = token; firstRestricted = token;
message = Messages.StrictReservedWord; message = Messages.StrictReservedWord;
} }
@ -5403,7 +5448,8 @@ function parse(code, options) {
generators: true, generators: true,
destructuring: true, destructuring: true,
classes: true, classes: true,
modules: true modules: true,
newTarget: true
}; };
} }

View File

@ -212,6 +212,14 @@ module.exports = {
}; };
}, },
createMetaProperty: function(meta, property) {
return {
type: astNodeTypes.MetaProperty,
meta: meta,
property: property
};
},
/** /**
* Create an ASTNode representation of a conditional expression * Create an ASTNode representation of a conditional expression
* @param {ASTNode} test The conditional to evaluate * @param {ASTNode} test The conditional to evaluate
@ -498,6 +506,30 @@ module.exports = {
}; };
}, },
/**
* Create an ASTNode representation of an experimental rest property
* @param {ASTNode} argument The identifier being rested
* @returns {ASTNode} An ASTNode representing a rest element
*/
createExperimentalRestProperty: function(argument) {
return {
type: astNodeTypes.ExperimentalRestProperty,
argument: argument
};
},
/**
* Create an ASTNode representation of an experimental spread property
* @param {ASTNode} argument The identifier being spread
* @returns {ASTNode} An ASTNode representing a spread element
*/
createExperimentalSpreadProperty: function(argument) {
return {
type: astNodeTypes.ExperimentalSpreadProperty,
argument: argument
};
},
/** /**
* Create an ASTNode tagged template expression * Create an ASTNode tagged template expression
* @param {ASTNode} tag The tag expression * @param {ASTNode} tag The tag expression

View File

@ -56,6 +56,8 @@ module.exports = {
DoWhileStatement: "DoWhileStatement", DoWhileStatement: "DoWhileStatement",
DebuggerStatement: "DebuggerStatement", DebuggerStatement: "DebuggerStatement",
EmptyStatement: "EmptyStatement", EmptyStatement: "EmptyStatement",
ExperimentalRestProperty: "ExperimentalRestProperty",
ExperimentalSpreadProperty: "ExperimentalSpreadProperty",
ExpressionStatement: "ExpressionStatement", ExpressionStatement: "ExpressionStatement",
ForStatement: "ForStatement", ForStatement: "ForStatement",
ForInStatement: "ForInStatement", ForInStatement: "ForInStatement",
@ -68,6 +70,7 @@ module.exports = {
LabeledStatement: "LabeledStatement", LabeledStatement: "LabeledStatement",
LogicalExpression: "LogicalExpression", LogicalExpression: "LogicalExpression",
MemberExpression: "MemberExpression", MemberExpression: "MemberExpression",
MetaProperty: "MetaProperty",
MethodDefinition: "MethodDefinition", MethodDefinition: "MethodDefinition",
NewExpression: "NewExpression", NewExpression: "NewExpression",
ObjectExpression: "ObjectExpression", ObjectExpression: "ObjectExpression",

View File

@ -109,9 +109,21 @@ module.exports = {
} }
if (lastChild) { if (lastChild) {
if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) { if (lastChild.leadingComments) {
if (lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) {
node.leadingComments = lastChild.leadingComments; node.leadingComments = lastChild.leadingComments;
delete lastChild.leadingComments; delete lastChild.leadingComments;
} else {
// A leading comment for an anonymous class had been stolen by its first MethodDefinition,
// so this takes back the leading comment.
// See Also: https://github.com/eslint/espree/issues/158
for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {
if (lastChild.leadingComments[i].range[1] <= node.range[0]) {
node.leadingComments = lastChild.leadingComments.splice(0, i + 1);
break;
}
}
}
} }
} else if (extra.leadingComments.length > 0) { } else if (extra.leadingComments.length > 0) {

View File

@ -100,6 +100,9 @@ module.exports = {
// enable parsing of classes // enable parsing of classes
classes: false, classes: false,
// enable parsing of new.target
newTarget: false,
// enable parsing of modules // enable parsing of modules
modules: false, modules: false,
@ -107,5 +110,8 @@ module.exports = {
jsx: false, jsx: false,
// allow return statement in global scope // allow return statement in global scope
globalReturn: false globalReturn: false,
// allow experimental object rest/spread
experimentalObjectRestSpread: false
}; };

6
node_modules/espree/lib/syntax.js generated vendored
View File

@ -113,7 +113,7 @@ module.exports = {
} }
}, },
isStrictModeReservedWord: function(id) { isStrictModeReservedWord: function(id, ecmaFeatures) {
switch (id) { switch (id) {
case "implements": case "implements":
case "interface": case "interface":
@ -125,6 +125,8 @@ module.exports = {
case "yield": case "yield":
case "let": case "let":
return true; return true;
case "await":
return ecmaFeatures.modules;
default: default:
return false; return false;
} }
@ -138,7 +140,7 @@ module.exports = {
isKeyword: function(id, strict, ecmaFeatures) { isKeyword: function(id, strict, ecmaFeatures) {
if (strict && this.isStrictModeReservedWord(id)) { if (strict && this.isStrictModeReservedWord(id, ecmaFeatures)) {
return true; return true;
} }

21
node_modules/espree/package.json generated vendored
View File

@ -11,7 +11,7 @@
"esparse": "./bin/esparse.js", "esparse": "./bin/esparse.js",
"esvalidate": "./bin/esvalidate.js" "esvalidate": "./bin/esvalidate.js"
}, },
"version": "2.0.3", "version": "2.2.3",
"files": [ "files": [
"bin", "bin",
"lib", "lib",
@ -27,7 +27,7 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+ssh://git@github.com/eslint/espree.git" "url": "http://github.com/eslint/espree.git"
}, },
"bugs": { "bugs": {
"url": "http://github.com/eslint/espree.git" "url": "http://github.com/eslint/espree.git"
@ -44,7 +44,7 @@
"complexity-report": "~0.6.1", "complexity-report": "~0.6.1",
"dateformat": "^1.0.11", "dateformat": "^1.0.11",
"eslint": "^0.9.2", "eslint": "^0.9.2",
"esprima": "git://github.com/jquery/esprima.git", "esprima": "git://github.com/jquery/esprima",
"esprima-fb": "^8001.2001.0-dev-harmony-fb", "esprima-fb": "^8001.2001.0-dev-harmony-fb",
"istanbul": "~0.2.6", "istanbul": "~0.2.6",
"json-diff": "~0.3.1", "json-diff": "~0.3.1",
@ -83,10 +83,10 @@
"benchmark-quick": "node test/benchmarks.js quick" "benchmark-quick": "node test/benchmarks.js quick"
}, },
"dependencies": {}, "dependencies": {},
"gitHead": "b60b597cfe4834aacd16c90179ce73e22705c132", "gitHead": "4e72bb00332dbbced9a77d7c281962a46a6759cc",
"_id": "espree@2.0.3", "_id": "espree@2.2.3",
"_shasum": "1fbdff60a410bd0d416b1ab3d6230d34b7a450e1", "_shasum": "158cfc10f6e57c6bbc5a7438eb8bc40f267f9b54",
"_from": "espree@>=2.0.3 <2.1.0", "_from": "espree@>=2.2.3 <2.3.0",
"_npmVersion": "1.4.28", "_npmVersion": "1.4.28",
"_npmUser": { "_npmUser": {
"name": "nzakas", "name": "nzakas",
@ -99,10 +99,9 @@
} }
], ],
"dist": { "dist": {
"shasum": "1fbdff60a410bd0d416b1ab3d6230d34b7a450e1", "shasum": "158cfc10f6e57c6bbc5a7438eb8bc40f267f9b54",
"tarball": "http://registry.npmjs.org/espree/-/espree-2.0.3.tgz" "tarball": "http://registry.npmjs.org/espree/-/espree-2.2.3.tgz"
}, },
"directories": {}, "directories": {},
"_resolved": "https://registry.npmjs.org/espree/-/espree-2.0.3.tgz", "_resolved": "https://registry.npmjs.org/espree/-/espree-2.2.3.tgz"
"readme": "ERROR: No README data found!"
} }

208
node_modules/js2xmlparser/LICENSE.md generated vendored
View File

@ -1,16 +1,194 @@
js2xmlparser is licensed under the MIT license: Apache License
==============
> Copyright © 2012 Michael Kourlas and other contributors _Version 2.0, January 2004_
> _&lt;<http://www.apache.org/licenses/>&gt;_
> 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 ### Terms and Conditions for use, reproduction, and distribution
> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
> persons to whom the Software is furnished to do so, subject to the following conditions: #### 1. Definitions
>
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the “License” shall mean the terms and conditions for use, reproduction, and
> Software. distribution as defined by Sections 1 through 9 of this document.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE “Licensor” shall mean the copyright owner or entity authorized by the copyright
> WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR owner that is granting the License.
> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
> OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. “Legal Entity” shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, “control” means **(i)** the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
outstanding shares, or **(iii)** beneficial ownership of such entity.
“You” (or “Your”) shall mean an individual or Legal Entity exercising
permissions granted by this License.
“Source” form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
“Object” form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
“Work” shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
“Derivative Works” shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
“Contribution” shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
“submitted” means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as “Not a Contribution.”
“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
#### 2. Grant of Copyright License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
#### 3. Grant of Patent License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
#### 4. Redistribution
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
* **(a)** You must give any other recipients of the Work or Derivative Works a copy of
this License; and
* **(b)** You must cause any modified files to carry prominent notices stating that You
changed the files; and
* **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
#### 5. Submission of Contributions
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
#### 6. Trademarks
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
#### 7. Disclaimer of Warranty
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
#### 8. Limitation of Liability
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
#### 9. Accepting Warranty or Additional Liability
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
_END OF TERMS AND CONDITIONS_
### APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets `[]` replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same “printed page” as the copyright notice for easier identification within
third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -30,6 +30,7 @@
var prettyPrinting = true; var prettyPrinting = true;
var indentString = "\t"; var indentString = "\t";
var convertMap = {}; var convertMap = {};
var arrayMap = {};
var useCDATA = false; var useCDATA = false;
module.exports = function (root, data, options) { module.exports = function (root, data, options) {
@ -121,6 +122,14 @@
throw new Error("convertMap option must be an object"); throw new Error("convertMap option must be an object");
} }
} }
if ("arrayMap" in options) {
if (Object.prototype.toString.call(options.arrayMap) === "[object Object]") {
arrayMap = options.arrayMap;
}
else {
throw new Error("arrayMap option must be an object");
}
}
if ("useCDATA" in options) { if ("useCDATA" in options) {
if (typeof options.useCDATA === "boolean") { if (typeof options.useCDATA === "boolean") {
useCDATA = options.useCDATA; useCDATA = options.useCDATA;
@ -141,8 +150,8 @@
throw new Error("data must be an object (excluding arrays) or a JSON string"); throw new Error("data must be an object (excluding arrays) or a JSON string");
} }
if (Object.prototype.toString.call(data) === "[object Array]") { if (Object.prototype.toString.call(data) === "[object Array]" && !(arrayMap && arrayMap[root])) {
throw new Error("data must be an object (excluding arrays) or a JSON string"); throw new Error("data must be an object (excluding arrays) or a JSON string, unless an arrayMap option exists for root");
} }
if (typeof data === "string") { if (typeof data === "string") {
@ -185,12 +194,31 @@
// Arrays // Arrays
if (Object.prototype.toString.call(object[property]) === "[object Array]") { if (Object.prototype.toString.call(object[property]) === "[object Array]") {
// Wrap array with outer tag if arrayMap is used
if (arrayMap[property]) {
xml += addIndent("<" + elementName, level);
xml += addBreak(">");
}
// Create separate XML elements for each array element // Create separate XML elements for each array element
for (i = 0; i < object[property].length; i++) { for (i = 0; i < object[property].length; i++) {
tempObject = {}; tempObject = {};
tempObject[property] = object[property][i]; var newLevel = level;
xml = toXML(tempObject, xml, level); // When arrayMap is used, use the arrayMap tag instead and increment level
if (arrayMap[property]) {
tempObject[arrayMap[property]] = object[property][i];
newLevel = level + 1;
} else {
tempObject[property] = object[property][i];
}
xml = toXML(tempObject, xml, newLevel);
}
// Wrap array with outer tag if arrayMap is used
if (arrayMap[property]) {
xml += addBreak(addIndent("</" + elementName + ">", level));
} }
} }
// JSON-type objects with properties // JSON-type objects with properties
@ -341,6 +369,7 @@
var setOptionDefaults = function () { var setOptionDefaults = function () {
useCDATA = false; useCDATA = false;
convertMap = {}; convertMap = {};
arrayMap = {};
xmlDeclaration = true; xmlDeclaration = true;
xmlVersion = "1.0"; xmlVersion = "1.0";
xmlEncoding = "UTF-8"; xmlEncoding = "UTF-8";

File diff suppressed because one or more lines are too long

45
node_modules/marked/lib/marked.js generated vendored
View File

@ -20,7 +20,7 @@ var block = {
lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/, html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
table: noop, table: noop,
paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
@ -75,8 +75,9 @@ block.normal = merge({}, block);
*/ */
block.gfm = merge({}, block.normal, { block.gfm = merge({}, block.normal, {
fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,
paragraph: /^/ paragraph: /^/,
heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/
}); });
block.gfm.paragraph = replace(block.paragraph) block.gfm.paragraph = replace(block.paragraph)
@ -359,7 +360,8 @@ Lexer.prototype.token = function(src, top, bq) {
type: this.options.sanitize type: this.options.sanitize
? 'paragraph' ? 'paragraph'
: 'html', : 'html',
pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style', pre: !this.options.sanitizer
&& (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
text: cap[0] text: cap[0]
}); });
continue; continue;
@ -454,7 +456,7 @@ var inline = {
reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
br: /^ {2,}\n(?!\s*$)/, br: /^ {2,}\n(?!\s*$)/,
del: noop, del: noop,
@ -606,8 +608,10 @@ InlineLexer.prototype.output = function(src) {
} }
src = src.substring(cap[0].length); src = src.substring(cap[0].length);
out += this.options.sanitize out += this.options.sanitize
? escape(cap[0]) ? this.options.sanitizer
: cap[0]; ? this.options.sanitizer(cap[0])
: escape(cap[0])
: cap[0]
continue; continue;
} }
@ -678,7 +682,7 @@ InlineLexer.prototype.output = function(src) {
// text // text
if (cap = this.rules.text.exec(src)) { if (cap = this.rules.text.exec(src)) {
src = src.substring(cap[0].length); src = src.substring(cap[0].length);
out += escape(this.smartypants(cap[0])); out += this.renderer.text(escape(this.smartypants(cap[0])));
continue; continue;
} }
@ -712,7 +716,9 @@ InlineLexer.prototype.smartypants = function(text) {
if (!this.options.smartypants) return text; if (!this.options.smartypants) return text;
return text return text
// em-dashes // em-dashes
.replace(/--/g, '\u2014') .replace(/---/g, '\u2014')
// en-dashes
.replace(/--/g, '\u2013')
// opening singles // opening singles
.replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
// closing singles & apostrophes // closing singles & apostrophes
@ -730,6 +736,7 @@ InlineLexer.prototype.smartypants = function(text) {
*/ */
InlineLexer.prototype.mangle = function(text) { InlineLexer.prototype.mangle = function(text) {
if (!this.options.mangle) return text;
var out = '' var out = ''
, l = text.length , l = text.length
, i = 0 , i = 0
@ -868,7 +875,7 @@ Renderer.prototype.link = function(href, title, text) {
} catch (e) { } catch (e) {
return ''; return '';
} }
if (prot.indexOf('javascript:') === 0) { if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) {
return ''; return '';
} }
} }
@ -889,6 +896,10 @@ Renderer.prototype.image = function(href, title, text) {
return out; return out;
}; };
Renderer.prototype.text = function(text) {
return text;
};
/** /**
* Parsing & Compiling * Parsing & Compiling
*/ */
@ -1154,8 +1165,13 @@ function marked(src, opt, callback) {
pending = tokens.length; pending = tokens.length;
var done = function() { var done = function(err) {
var out, err; if (err) {
opt.highlight = highlight;
return callback(err);
}
var out;
try { try {
out = Parser.parse(tokens, opt); out = Parser.parse(tokens, opt);
@ -1184,6 +1200,7 @@ function marked(src, opt, callback) {
return --pending || done(); return --pending || done();
} }
return highlight(token.text, token.lang, function(err, code) { return highlight(token.text, token.lang, function(err, code) {
if (err) return done(err);
if (code == null || code === token.text) { if (code == null || code === token.text) {
return --pending || done(); return --pending || done();
} }
@ -1226,6 +1243,8 @@ marked.defaults = {
breaks: false, breaks: false,
pedantic: false, pedantic: false,
sanitize: false, sanitize: false,
sanitizer: null,
mangle: true,
smartLists: false, smartLists: false,
silent: false, silent: false,
highlight: null, highlight: null,
@ -1253,7 +1272,7 @@ marked.inlineLexer = InlineLexer.output;
marked.parse = marked; marked.parse = marked;
if (typeof exports === 'object') { if (typeof module !== 'undefined' && typeof exports === 'object') {
module.exports = marked; module.exports = marked;
} else if (typeof define === 'function' && define.amd) { } else if (typeof define === 'function' && define.amd) {
define(function() { return marked; }); define(function() { return marked; });

35
node_modules/marked/package.json generated vendored

File diff suppressed because one or more lines are too long

2
node_modules/underscore/LICENSE generated vendored
View File

@ -1,4 +1,4 @@
Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Copyright (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative
Reporters & Editors Reporters & Editors
Permission is hereby granted, free of charge, to any person Permission is hereby granted, free of charge, to any person

42
node_modules/underscore/package.json generated vendored
View File

@ -18,37 +18,38 @@
"url": "git://github.com/jashkenas/underscore.git" "url": "git://github.com/jashkenas/underscore.git"
}, },
"main": "underscore.js", "main": "underscore.js",
"version": "1.7.0", "version": "1.8.3",
"devDependencies": { "devDependencies": {
"docco": "0.6.x", "docco": "*",
"phantomjs": "1.9.7-1", "eslint": "0.6.x",
"uglify-js": "2.4.x", "karma": "~0.12.31",
"eslint": "0.6.x" "karma-qunit": "~0.1.4",
"qunit-cli": "~0.2.0",
"uglify-js": "2.4.x"
}, },
"scripts": { "scripts": {
"test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true && eslint underscore.js test/*.js test/vendor/runner.js", "test": "npm run test-node && npm run lint",
"lint": "eslint underscore.js test/*.js",
"test-node": "qunit-cli test/*.js",
"test-browser": "npm i karma-phantomjs-launcher && ./node_modules/karma/bin/karma start",
"build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js", "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js",
"doc": "docco underscore.js" "doc": "docco underscore.js"
}, },
"licenses": [ "license": "MIT",
{
"type": "MIT",
"url": "https://raw.github.com/jashkenas/underscore/master/LICENSE"
}
],
"files": [ "files": [
"underscore.js", "underscore.js",
"underscore-min.js", "underscore-min.js",
"underscore-min.map",
"LICENSE" "LICENSE"
], ],
"gitHead": "da996e665deb0b69b257e80e3e257c04fde4191c", "gitHead": "e4743ab712b8ab42ad4ccb48b155034d02394e4d",
"bugs": { "bugs": {
"url": "https://github.com/jashkenas/underscore/issues" "url": "https://github.com/jashkenas/underscore/issues"
}, },
"_id": "underscore@1.7.0", "_id": "underscore@1.8.3",
"_shasum": "6bbaf0877500d36be34ecaa584e0db9fef035209", "_shasum": "4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022",
"_from": "underscore@~1.7.0", "_from": "underscore@1.8.3",
"_npmVersion": "1.4.24", "_npmVersion": "1.4.28",
"_npmUser": { "_npmUser": {
"name": "jashkenas", "name": "jashkenas",
"email": "jashkenas@gmail.com" "email": "jashkenas@gmail.com"
@ -60,10 +61,9 @@
} }
], ],
"dist": { "dist": {
"shasum": "6bbaf0877500d36be34ecaa584e0db9fef035209", "shasum": "4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022",
"tarball": "http://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz" "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz"
}, },
"directories": {}, "directories": {},
"_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz"
"readme": "ERROR: No README data found!"
} }

731
node_modules/underscore/underscore.js generated vendored

File diff suppressed because it is too large Load Diff

View File

@ -13,24 +13,24 @@
"url": "https://github.com/jsdoc3/jsdoc" "url": "https://github.com/jsdoc3/jsdoc"
}, },
"dependencies": { "dependencies": {
"async": "~0.9.0", "async": "~1.4.0",
"bluebird": "~2.9.14", "bluebird": "~2.9.34",
"catharsis": "~0.8.7", "catharsis": "~0.8.7",
"escape-string-regexp": "~1.0.2", "escape-string-regexp": "~1.0.3",
"espree": "~2.0.3", "espree": "~2.2.3",
"js2xmlparser": "~0.1.7", "js2xmlparser": "~1.0.0",
"marked": "~0.3.2", "marked": "~0.3.4",
"requizzle": "~0.2.0", "requizzle": "~0.2.0",
"strip-json-comments": "~1.0.2", "strip-json-comments": "~1.0.2",
"taffydb": "https://github.com/hegemonic/taffydb/tarball/7d100bcee0e997ee4977e273cdce60bd8933050e", "taffydb": "https://github.com/hegemonic/taffydb/tarball/7d100bcee0e997ee4977e273cdce60bd8933050e",
"underscore": "~1.7.0", "underscore": "~1.8.3",
"wrench": "~1.5.8" "wrench": "~1.5.8"
}, },
"devDependencies": { "devDependencies": {
"gulp": "~3.8.5", "gulp": "~3.9.0",
"gulp-eslint": "~0.13.2", "gulp-eslint": "~0.15.0",
"gulp-json-editor": "~2.0.2", "gulp-json-editor": "~2.2.1",
"istanbul": "~0.2.16", "istanbul": "~0.3.17",
"tv4": "https://github.com/hegemonic/tv4/tarball/own-properties" "tv4": "https://github.com/hegemonic/tv4/tarball/own-properties"
}, },
"engines": { "engines": {