mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Update vendors and dev deps.
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
"docdown": "~0.3.0",
|
"docdown": "~0.3.0",
|
||||||
"dojo": "^1.10.4",
|
"dojo": "^1.10.4",
|
||||||
"ecstatic": "^1.4.0",
|
"ecstatic": "^1.4.0",
|
||||||
"fs-extra": "~0.26.4",
|
"fs-extra": "~0.26.5",
|
||||||
"glob": "^6.0.4",
|
"glob": "^6.0.4",
|
||||||
"istanbul": "0.4.2",
|
"istanbul": "0.4.2",
|
||||||
"jquery": "^2.2.0",
|
"jquery": "^2.2.0",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"platform": "^1.3.1",
|
"platform": "^1.3.1",
|
||||||
"qunit-extras": "^1.4.5",
|
"qunit-extras": "^1.4.5",
|
||||||
"qunitjs": "~1.20.0",
|
"qunitjs": "~1.20.0",
|
||||||
"request": "^2.67.0",
|
"request": "^2.69.0",
|
||||||
"requirejs": "^2.1.22",
|
"requirejs": "^2.1.22",
|
||||||
"sauce-tunnel": "2.3.0",
|
"sauce-tunnel": "2.3.0",
|
||||||
"uglify-js": "2.6.1",
|
"uglify-js": "2.6.1",
|
||||||
|
|||||||
19
vendor/backbone/backbone.js
vendored
19
vendor/backbone/backbone.js
vendored
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
// Establish the root object, `window` (`self`) in the browser, or `global` on the server.
|
// Establish the root object, `window` (`self`) in the browser, or `global` on the server.
|
||||||
// We use `self` instead of `window` for `WebWorker` support.
|
// We use `self` instead of `window` for `WebWorker` support.
|
||||||
var root = (typeof self == 'object' && self.self == self && self) ||
|
var root = (typeof self == 'object' && self.self === self && self) ||
|
||||||
(typeof global == 'object' && global.global == global && global);
|
(typeof global == 'object' && global.global === global && global);
|
||||||
|
|
||||||
// Set up Backbone appropriately for the environment. Start with AMD.
|
// Set up Backbone appropriately for the environment. Start with AMD.
|
||||||
if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
@@ -769,7 +769,8 @@
|
|||||||
at = Math.min(Math.max(at, 0), array.length);
|
at = Math.min(Math.max(at, 0), array.length);
|
||||||
var tail = Array(array.length - at);
|
var tail = Array(array.length - at);
|
||||||
var length = insert.length;
|
var length = insert.length;
|
||||||
for (var i = 0; i < tail.length; i++) tail[i] = array[i + at];
|
var i;
|
||||||
|
for (i = 0; i < tail.length; i++) tail[i] = array[i + at];
|
||||||
for (i = 0; i < length; i++) array[i + at] = insert[i];
|
for (i = 0; i < length; i++) array[i + at] = insert[i];
|
||||||
for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i];
|
for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i];
|
||||||
};
|
};
|
||||||
@@ -821,10 +822,12 @@
|
|||||||
if (models == null) return;
|
if (models == null) return;
|
||||||
|
|
||||||
options = _.defaults({}, options, setOptions);
|
options = _.defaults({}, options, setOptions);
|
||||||
if (options.parse && !this._isModel(models)) models = this.parse(models, options);
|
if (options.parse && !this._isModel(models)) {
|
||||||
|
models = this.parse(models, options) || [];
|
||||||
|
}
|
||||||
|
|
||||||
var singular = !_.isArray(models);
|
var singular = !_.isArray(models);
|
||||||
models = singular ? (models ? [models] : []) : models.slice();
|
models = singular ? [models] : models.slice();
|
||||||
|
|
||||||
var at = options.at;
|
var at = options.at;
|
||||||
if (at != null) at = +at;
|
if (at != null) at = +at;
|
||||||
@@ -845,8 +848,8 @@
|
|||||||
|
|
||||||
// Turn bare objects into model references, and prevent invalid models
|
// Turn bare objects into model references, and prevent invalid models
|
||||||
// from being added.
|
// from being added.
|
||||||
var model;
|
var model, i;
|
||||||
for (var i = 0; i < models.length; i++) {
|
for (i = 0; i < models.length; i++) {
|
||||||
model = models[i];
|
model = models[i];
|
||||||
|
|
||||||
// If a duplicate is found, prevent it from being added and
|
// If a duplicate is found, prevent it from being added and
|
||||||
@@ -890,7 +893,7 @@
|
|||||||
var orderChanged = false;
|
var orderChanged = false;
|
||||||
var replace = !sortable && add && remove;
|
var replace = !sortable && add && remove;
|
||||||
if (set.length && replace) {
|
if (set.length && replace) {
|
||||||
orderChanged = this.length != set.length || _.some(this.models, function(model, index) {
|
orderChanged = this.length !== set.length || _.some(this.models, function(model, index) {
|
||||||
return model !== set[index];
|
return model !== set[index];
|
||||||
});
|
});
|
||||||
this.models.length = 0;
|
this.models.length = 0;
|
||||||
|
|||||||
6
vendor/backbone/test/collection.js
vendored
6
vendor/backbone/test/collection.js
vendored
@@ -429,7 +429,7 @@
|
|||||||
});
|
});
|
||||||
var colE = new Backbone.Collection([e]);
|
var colE = new Backbone.Collection([e]);
|
||||||
var colF = new Backbone.Collection([f]);
|
var colF = new Backbone.Collection([f]);
|
||||||
assert.ok(e != f);
|
assert.notEqual(e, f);
|
||||||
assert.ok(colE.length === 1);
|
assert.ok(colE.length === 1);
|
||||||
assert.ok(colF.length === 1);
|
assert.ok(colF.length === 1);
|
||||||
colE.remove(e);
|
colE.remove(e);
|
||||||
@@ -857,7 +857,7 @@
|
|||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
var Model = Backbone.Model.extend({
|
var Model = Backbone.Model.extend({
|
||||||
validate: function(attrs) {
|
validate: function(attrs) {
|
||||||
if (attrs.id == 3) return "id can't be 3";
|
if (attrs.id === 3) return "id can't be 3";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1324,7 +1324,7 @@
|
|||||||
var col = new Backbone.Collection;
|
var col = new Backbone.Collection;
|
||||||
var model1 = col.push({id: 101});
|
var model1 = col.push({id: 101});
|
||||||
var model2 = col.push({id: 101});
|
var model2 = col.push({id: 101});
|
||||||
assert.ok(model2.cid == model1.cid);
|
assert.ok(model2.cid === model1.cid);
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.test('`set` with non-normal id', function(assert) {
|
QUnit.test('`set` with non-normal id', function(assert) {
|
||||||
|
|||||||
6
vendor/backbone/test/events.js
vendored
6
vendor/backbone/test/events.js
vendored
@@ -352,8 +352,8 @@
|
|||||||
_.extend(obj, Backbone.Events);
|
_.extend(obj, Backbone.Events);
|
||||||
obj.on('all', function(event) {
|
obj.on('all', function(event) {
|
||||||
obj.counter++;
|
obj.counter++;
|
||||||
if (event == 'a') a = true;
|
if (event === 'a') a = true;
|
||||||
if (event == 'b') b = true;
|
if (event === 'b') b = true;
|
||||||
})
|
})
|
||||||
.trigger('a b');
|
.trigger('a b');
|
||||||
assert.ok(a);
|
assert.ok(a);
|
||||||
@@ -477,7 +477,7 @@
|
|||||||
QUnit.test('if callback is truthy but not a function, `on` should throw an error just like jQuery', function(assert) {
|
QUnit.test('if callback is truthy but not a function, `on` should throw an error just like jQuery', function(assert) {
|
||||||
assert.expect(1);
|
assert.expect(1);
|
||||||
var view = _.extend({}, Backbone.Events).on('test', 'noop');
|
var view = _.extend({}, Backbone.Events).on('test', 'noop');
|
||||||
assert.throws(function() {
|
assert.raises(function() {
|
||||||
view.trigger('test');
|
view.trigger('test');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
14
vendor/backbone/test/model.js
vendored
14
vendor/backbone/test/model.js
vendored
@@ -89,7 +89,7 @@
|
|||||||
doc.collection.url = '/collection/';
|
doc.collection.url = '/collection/';
|
||||||
assert.equal(doc.url(), '/collection/1-the-tempest');
|
assert.equal(doc.url(), '/collection/1-the-tempest');
|
||||||
doc.collection = null;
|
doc.collection = null;
|
||||||
assert.throws(function() { doc.url(); });
|
assert.raises(function() { doc.url(); });
|
||||||
doc.collection = collection;
|
doc.collection = collection;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -251,12 +251,12 @@
|
|||||||
var changeCount = 0;
|
var changeCount = 0;
|
||||||
a.on('change:foo', function() { changeCount += 1; });
|
a.on('change:foo', function() { changeCount += 1; });
|
||||||
a.set({foo: 2});
|
a.set({foo: 2});
|
||||||
assert.ok(a.get('foo') == 2, 'Foo should have changed.');
|
assert.equal(a.get('foo'), 2, 'Foo should have changed.');
|
||||||
assert.ok(changeCount == 1, 'Change count should have incremented.');
|
assert.equal(changeCount, 1, 'Change count should have incremented.');
|
||||||
// set with value that is not new shouldn't fire change event
|
// set with value that is not new shouldn't fire change event
|
||||||
a.set({foo: 2});
|
a.set({foo: 2});
|
||||||
assert.ok(a.get('foo') == 2, 'Foo should NOT have changed, still 2');
|
assert.equal(a.get('foo'), 2, 'Foo should NOT have changed, still 2');
|
||||||
assert.ok(changeCount == 1, 'Change count should NOT have incremented.');
|
assert.equal(changeCount, 1, 'Change count should NOT have incremented.');
|
||||||
|
|
||||||
a.validate = function(attrs) {
|
a.validate = function(attrs) {
|
||||||
assert.equal(attrs.foo, void 0, 'validate:true passed while unsetting');
|
assert.equal(attrs.foo, void 0, 'validate:true passed while unsetting');
|
||||||
@@ -264,7 +264,7 @@
|
|||||||
a.unset('foo', {validate: true});
|
a.unset('foo', {validate: true});
|
||||||
assert.equal(a.get('foo'), void 0, 'Foo should have changed');
|
assert.equal(a.get('foo'), void 0, 'Foo should have changed');
|
||||||
delete a.validate;
|
delete a.validate;
|
||||||
assert.ok(changeCount == 2, 'Change count should have incremented for unset.');
|
assert.equal(changeCount, 2, 'Change count should have incremented for unset.');
|
||||||
|
|
||||||
a.unset('id');
|
a.unset('id');
|
||||||
assert.equal(a.id, undefined, 'Unsetting the id should remove the id property.');
|
assert.equal(a.id, undefined, 'Unsetting the id should remove the id property.');
|
||||||
@@ -746,7 +746,7 @@
|
|||||||
var lastError;
|
var lastError;
|
||||||
var model = new Backbone.Model();
|
var model = new Backbone.Model();
|
||||||
model.validate = function(attrs) {
|
model.validate = function(attrs) {
|
||||||
if (attrs.admin != this.get('admin')) return "Can't change admin status.";
|
if (attrs.admin !== this.get('admin')) return "Can't change admin status.";
|
||||||
};
|
};
|
||||||
model.on('invalid', function(model, error) {
|
model.on('invalid', function(model, error) {
|
||||||
lastError = error;
|
lastError = error;
|
||||||
|
|||||||
2
vendor/backbone/test/router.js
vendored
2
vendor/backbone/test/router.js
vendored
@@ -134,7 +134,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
optionalItem: function(arg){
|
optionalItem: function(arg){
|
||||||
this.arg = arg != void 0 ? arg : null;
|
this.arg = arg !== void 0 ? arg : null;
|
||||||
},
|
},
|
||||||
|
|
||||||
splat: function(args) {
|
splat: function(args) {
|
||||||
|
|||||||
2
vendor/backbone/test/sync.js
vendored
2
vendor/backbone/test/sync.js
vendored
@@ -142,7 +142,7 @@
|
|||||||
QUnit.test('urlError', function(assert) {
|
QUnit.test('urlError', function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
var model = new Backbone.Model();
|
var model = new Backbone.Model();
|
||||||
assert.throws(function() {
|
assert.raises(function() {
|
||||||
model.fetch();
|
model.fetch();
|
||||||
});
|
});
|
||||||
model.fetch({url: '/one/two'});
|
model.fetch({url: '/one/two'});
|
||||||
|
|||||||
2
vendor/benchmark.js/LICENSE
vendored
2
vendor/benchmark.js/LICENSE
vendored
@@ -1,4 +1,4 @@
|
|||||||
Copyright 2010-2015 Mathias Bynens <http://mathiasbynens.be/>
|
Copyright 2010-2016 Mathias Bynens <https://mathiasbynens.be/>
|
||||||
Based on JSLitmus.js, copyright Robert Kieffer <http://broofa.com/>
|
Based on JSLitmus.js, copyright Robert Kieffer <http://broofa.com/>
|
||||||
Modified by John-David Dalton <http://allyoucanleet.com/>
|
Modified by John-David Dalton <http://allyoucanleet.com/>
|
||||||
|
|
||||||
|
|||||||
58
vendor/benchmark.js/benchmark.js
vendored
58
vendor/benchmark.js/benchmark.js
vendored
@@ -1,9 +1,9 @@
|
|||||||
/*!
|
/*!
|
||||||
* Benchmark.js v2.0.0-pre <http://benchmarkjs.com/>
|
* Benchmark.js v2.1.0 <https://benchmarkjs.com/>
|
||||||
* Copyright 2010-2015 Mathias Bynens <http://mths.be/>
|
* Copyright 2010-2016 Mathias Bynens <https://mths.be/>
|
||||||
* Based on JSLitmus.js, copyright Robert Kieffer <http://broofa.com/>
|
* Based on JSLitmus.js, copyright Robert Kieffer <http://broofa.com/>
|
||||||
* Modified by John-David Dalton <http://allyoucanleet.com/>
|
* Modified by John-David Dalton <http://allyoucanleet.com/>
|
||||||
* Available under MIT license <http://mths.be/mit>
|
* Available under MIT license <https://mths.be/mit>
|
||||||
*/
|
*/
|
||||||
;(function() {
|
;(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
*/
|
*/
|
||||||
function runInContext(context) {
|
function runInContext(context) {
|
||||||
// Exit early if unable to acquire lodash.
|
// Exit early if unable to acquire lodash.
|
||||||
var _ = context && context._ || req('lodash-compat') || req('lodash') || root._;
|
var _ = context && context._ || req('lodash') || root._;
|
||||||
if (!_) {
|
if (!_) {
|
||||||
Benchmark.runInContext = runInContext;
|
Benchmark.runInContext = runInContext;
|
||||||
return Benchmark;
|
return Benchmark;
|
||||||
@@ -277,8 +277,7 @@
|
|||||||
* methods are:
|
* methods are:
|
||||||
* [`each/forEach`](https://lodash.com/docs#forEach), [`forOwn`](https://lodash.com/docs#forOwn),
|
* [`each/forEach`](https://lodash.com/docs#forEach), [`forOwn`](https://lodash.com/docs#forOwn),
|
||||||
* [`has`](https://lodash.com/docs#has), [`indexOf`](https://lodash.com/docs#indexOf),
|
* [`has`](https://lodash.com/docs#has), [`indexOf`](https://lodash.com/docs#indexOf),
|
||||||
* [`map`](https://lodash.com/docs#map), [`pluck`](https://lodash.com/docs#pluck),
|
* [`map`](https://lodash.com/docs#map), and [`reduce`](https://lodash.com/docs#reduce)
|
||||||
* and [`reduce`](https://lodash.com/docs#reduce)
|
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {string} name A name to identify the benchmark.
|
* @param {string} name A name to identify the benchmark.
|
||||||
@@ -355,7 +354,7 @@
|
|||||||
var bench = this;
|
var bench = this;
|
||||||
|
|
||||||
// Allow instance creation without the `new` operator.
|
// Allow instance creation without the `new` operator.
|
||||||
if (bench == null || bench.constructor != Benchmark) {
|
if (!(bench instanceof Benchmark)) {
|
||||||
return new Benchmark(name, fn, options);
|
return new Benchmark(name, fn, options);
|
||||||
}
|
}
|
||||||
// Juggle arguments.
|
// Juggle arguments.
|
||||||
@@ -396,7 +395,7 @@
|
|||||||
*/
|
*/
|
||||||
function Deferred(clone) {
|
function Deferred(clone) {
|
||||||
var deferred = this;
|
var deferred = this;
|
||||||
if (deferred == null || deferred.constructor != Deferred) {
|
if (!(deferred instanceof Deferred)) {
|
||||||
return new Deferred(clone);
|
return new Deferred(clone);
|
||||||
}
|
}
|
||||||
deferred.benchmark = clone;
|
deferred.benchmark = clone;
|
||||||
@@ -415,9 +414,9 @@
|
|||||||
if (type instanceof Event) {
|
if (type instanceof Event) {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
return (event == null || event.constructor != Event)
|
return (event instanceof Event)
|
||||||
? new Event(type)
|
? _.assign(event, { 'timeStamp': _.now() }, typeof type == 'string' ? { 'type': type } : type)
|
||||||
: _.assign(event, { 'timeStamp': _.now() }, typeof type == 'string' ? { 'type': type } : type);
|
: new Event(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -426,8 +425,7 @@
|
|||||||
* Note: Each Suite instance has a handful of wrapped lodash methods to
|
* Note: Each Suite instance has a handful of wrapped lodash methods to
|
||||||
* make working with Suites easier. The wrapped lodash methods are:
|
* make working with Suites easier. The wrapped lodash methods are:
|
||||||
* [`each/forEach`](https://lodash.com/docs#forEach), [`indexOf`](https://lodash.com/docs#indexOf),
|
* [`each/forEach`](https://lodash.com/docs#forEach), [`indexOf`](https://lodash.com/docs#indexOf),
|
||||||
* [`map`](https://lodash.com/docs#map), [`pluck`](https://lodash.com/docs#pluck),
|
* [`map`](https://lodash.com/docs#map), and [`reduce`](https://lodash.com/docs#reduce)
|
||||||
* and [`reduce`](https://lodash.com/docs#reduce)
|
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @memberOf Benchmark
|
* @memberOf Benchmark
|
||||||
@@ -467,7 +465,7 @@
|
|||||||
var suite = this;
|
var suite = this;
|
||||||
|
|
||||||
// Allow instance creation without the `new` operator.
|
// Allow instance creation without the `new` operator.
|
||||||
if (suite == null || suite.constructor != Suite) {
|
if (!(suite instanceof Suite)) {
|
||||||
return new Suite(name, options);
|
return new Suite(name, options);
|
||||||
}
|
}
|
||||||
// Juggle arguments.
|
// Juggle arguments.
|
||||||
@@ -491,7 +489,7 @@
|
|||||||
* @param {*} value The value to clone.
|
* @param {*} value The value to clone.
|
||||||
* @returns {*} The cloned value.
|
* @returns {*} The cloned value.
|
||||||
*/
|
*/
|
||||||
var cloneDeep = _.partial(_.cloneDeepWith || _.cloneDeep, _, function(value) {
|
var cloneDeep = _.partial(_.cloneDeepWith, _, function(value) {
|
||||||
// Only clone primitives, arrays, and plain objects.
|
// Only clone primitives, arrays, and plain objects.
|
||||||
return (_.isObject(value) && !_.isArray(value) && !_.isPlainObject(value))
|
return (_.isObject(value) && !_.isArray(value) && !_.isPlainObject(value))
|
||||||
? value
|
? value
|
||||||
@@ -763,7 +761,7 @@
|
|||||||
if (callback === 'successful') {
|
if (callback === 'successful') {
|
||||||
// Callback to exclude those that are errored, unrun, or have hz of Infinity.
|
// Callback to exclude those that are errored, unrun, or have hz of Infinity.
|
||||||
callback = function(bench) {
|
callback = function(bench) {
|
||||||
return bench.cycles && _.isFinite(bench.hz);
|
return bench.cycles && _.isFinite(bench.hz) && !bench.error;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if (callback === 'fastest' || callback === 'slowest') {
|
else if (callback === 'fastest' || callback === 'slowest') {
|
||||||
@@ -914,7 +912,7 @@
|
|||||||
function isAsync(object) {
|
function isAsync(object) {
|
||||||
// Avoid using `instanceof` here because of IE memory leak issues with host objects.
|
// Avoid using `instanceof` here because of IE memory leak issues with host objects.
|
||||||
var async = args[0] && args[0].async;
|
var async = args[0] && args[0].async;
|
||||||
return Object(object).constructor == Benchmark && name == 'run' &&
|
return name == 'run' && (object instanceof Benchmark) &&
|
||||||
((async == null ? object.options.async : async) && support.timeout || object.defer);
|
((async == null ? object.options.async : async) && support.timeout || object.defer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -933,7 +931,6 @@
|
|||||||
? index
|
? index
|
||||||
: (index = false);
|
: (index = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Juggle arguments.
|
// Juggle arguments.
|
||||||
if (_.isString(name)) {
|
if (_.isString(name)) {
|
||||||
// 2 arguments (array, name).
|
// 2 arguments (array, name).
|
||||||
@@ -945,7 +942,6 @@
|
|||||||
args = _.isArray(args = 'args' in options ? options.args : []) ? args : [args];
|
args = _.isArray(args = 'args' in options ? options.args : []) ? args : [args];
|
||||||
queued = options.queued;
|
queued = options.queued;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start iterating over the array.
|
// Start iterating over the array.
|
||||||
if (raiseIndex() !== false) {
|
if (raiseIndex() !== false) {
|
||||||
// Emit "start" event.
|
// Emit "start" event.
|
||||||
@@ -955,7 +951,7 @@
|
|||||||
options.onStart.call(benches, Event(eventProps));
|
options.onStart.call(benches, Event(eventProps));
|
||||||
|
|
||||||
// End early if the suite was aborted in an "onStart" listener.
|
// End early if the suite was aborted in an "onStart" listener.
|
||||||
if (benches.aborted && benches.constructor == Suite && name == 'run') {
|
if (name == 'run' && (benches instanceof Suite) && benches.aborted) {
|
||||||
// Emit "cycle" event.
|
// Emit "cycle" event.
|
||||||
eventProps.type = 'cycle';
|
eventProps.type = 'cycle';
|
||||||
options.onCycle.call(benches, Event(eventProps));
|
options.onCycle.call(benches, Event(eventProps));
|
||||||
@@ -1794,7 +1790,7 @@
|
|||||||
timers.push({ 'ns': timer.ns, 'res': getRes('us'), 'unit': 'us' });
|
timers.push({ 'ns': timer.ns, 'res': getRes('us'), 'unit': 'us' });
|
||||||
}
|
}
|
||||||
// Pick timer with highest resolution.
|
// Pick timer with highest resolution.
|
||||||
timer = (_.minBy || _.min)(timers, 'res');
|
timer = _.minBy(timers, 'res');
|
||||||
|
|
||||||
// Error if there are no working timers.
|
// Error if there are no working timers.
|
||||||
if (timer.res == Infinity) {
|
if (timer.res == Infinity) {
|
||||||
@@ -1977,7 +1973,6 @@
|
|||||||
deferred = clone;
|
deferred = clone;
|
||||||
clone = clone.benchmark;
|
clone = clone.benchmark;
|
||||||
}
|
}
|
||||||
|
|
||||||
var clocked,
|
var clocked,
|
||||||
cycles,
|
cycles,
|
||||||
divisor,
|
divisor,
|
||||||
@@ -2008,7 +2003,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Continue, if not errored.
|
// Continue, if not errored.
|
||||||
if (clone.running) {
|
if (clone.running) {
|
||||||
// Compute the time taken to complete last test cycle.
|
// Compute the time taken to complete last test cycle.
|
||||||
@@ -2257,7 +2251,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Platform object with properties describing things like browser name,
|
* Platform object with properties describing things like browser name,
|
||||||
* version, and operating system. See [`platform.js`](http://mths.be/platform).
|
* version, and operating system. See [`platform.js`](https://mths.be/platform).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf Benchmark
|
* @memberOf Benchmark
|
||||||
@@ -2284,7 +2278,7 @@
|
|||||||
* @memberOf Benchmark
|
* @memberOf Benchmark
|
||||||
* @type string
|
* @type string
|
||||||
*/
|
*/
|
||||||
'version': '2.0.0-pre'
|
'version': '2.1.0'
|
||||||
});
|
});
|
||||||
|
|
||||||
_.assign(Benchmark, {
|
_.assign(Benchmark, {
|
||||||
@@ -2297,7 +2291,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Add lodash methods to Benchmark.
|
// Add lodash methods to Benchmark.
|
||||||
_.each(['each', 'forEach', 'forOwn', 'has', 'indexOf', 'map', 'pluck', 'reduce'], function(methodName) {
|
_.each(['each', 'forEach', 'forOwn', 'has', 'indexOf', 'map', 'reduce'], function(methodName) {
|
||||||
Benchmark[methodName] = _[methodName];
|
Benchmark[methodName] = _[methodName];
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2745,7 +2739,7 @@
|
|||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// Add lodash methods as Suite methods.
|
// Add lodash methods as Suite methods.
|
||||||
_.each(['each', 'forEach', 'indexOf', 'map', 'pluck', 'reduce'], function(methodName) {
|
_.each(['each', 'forEach', 'indexOf', 'map', 'reduce'], function(methodName) {
|
||||||
var func = _[methodName];
|
var func = _[methodName];
|
||||||
Suite.prototype[methodName] = function() {
|
Suite.prototype[methodName] = function() {
|
||||||
var args = [this];
|
var args = [this];
|
||||||
@@ -2799,17 +2793,15 @@
|
|||||||
|
|
||||||
// Check for `exports` after `define` in case a build optimizer adds an `exports` object.
|
// Check for `exports` after `define` in case a build optimizer adds an `exports` object.
|
||||||
if (freeExports && freeModule) {
|
if (freeExports && freeModule) {
|
||||||
// Export for Node.js or RingoJS.
|
// Export for Node.js.
|
||||||
if (moduleExports) {
|
if (moduleExports) {
|
||||||
(freeModule.exports = Benchmark).Benchmark = Benchmark;
|
(freeModule.exports = Benchmark).Benchmark = Benchmark;
|
||||||
}
|
}
|
||||||
// Export for Rhino with CommonJS support.
|
// Export for CommonJS support.
|
||||||
else {
|
freeExports.Benchmark = Benchmark;
|
||||||
freeExports.Benchmark = Benchmark;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Export for a browser or Rhino.
|
// Export to the global object.
|
||||||
root.Benchmark = Benchmark;
|
root.Benchmark = Benchmark;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
vendor/underscore/test/objects.js
vendored
11
vendor/underscore/test/objects.js
vendored
@@ -639,6 +639,17 @@
|
|||||||
assert.strictEqual(_.isString(1), false);
|
assert.strictEqual(_.isString(1), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QUnit.test('isSymbol', function(assert) {
|
||||||
|
assert.ok(!_.isSymbol(0), 'numbers are not symbols');
|
||||||
|
assert.ok(!_.isSymbol(''), 'strings are not symbols');
|
||||||
|
assert.ok(!_.isSymbol(_.isSymbol), 'functions are not symbols');
|
||||||
|
if (typeof Symbol === 'function') {
|
||||||
|
assert.ok(_.isSymbol(Symbol()), 'symbols are symbols');
|
||||||
|
assert.ok(_.isSymbol(Symbol('description')), 'described symbols are symbols');
|
||||||
|
assert.ok(_.isSymbol(Object(Symbol())), 'boxed symbols are symbols');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
QUnit.test('isNumber', function(assert) {
|
QUnit.test('isNumber', function(assert) {
|
||||||
assert.ok(!_.isNumber('string'), 'a string is not a number');
|
assert.ok(!_.isNumber('string'), 'a string is not a number');
|
||||||
assert.ok(!_.isNumber(arguments), 'the arguments object is not a number');
|
assert.ok(!_.isNumber(arguments), 'the arguments object is not a number');
|
||||||
|
|||||||
2
vendor/underscore/underscore.js
vendored
2
vendor/underscore/underscore.js
vendored
@@ -1286,7 +1286,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.
|
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.
|
||||||
_.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {
|
_.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error', 'Symbol'], function(name) {
|
||||||
_['is' + name] = function(obj) {
|
_['is' + name] = function(obj) {
|
||||||
return toString.call(obj) === '[object ' + name + ']';
|
return toString.call(obj) === '[object ' + name + ']';
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user