mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Consistent empty bracket style.
This commit is contained in:
24
lodash.js
24
lodash.js
@@ -398,7 +398,7 @@
|
|||||||
var index = -1,
|
var index = -1,
|
||||||
length = string.length;
|
length = string.length;
|
||||||
|
|
||||||
while (++index < length && chars.indexOf(string.charAt(index)) > -1) { }
|
while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -414,7 +414,7 @@
|
|||||||
function charsRightIndex(string, chars) {
|
function charsRightIndex(string, chars) {
|
||||||
var index = string.length;
|
var index = string.length;
|
||||||
|
|
||||||
while (index-- && chars.indexOf(string.charAt(index)) > -1) { }
|
while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -556,7 +556,7 @@
|
|||||||
var index = -1,
|
var index = -1,
|
||||||
length = string.length;
|
length = string.length;
|
||||||
|
|
||||||
while (++index < length && isWhitespace(string.charCodeAt(index))) { }
|
while (++index < length && isWhitespace(string.charCodeAt(index))) {}
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -571,7 +571,7 @@
|
|||||||
function trimmedRightIndex(string) {
|
function trimmedRightIndex(string) {
|
||||||
var index = string.length;
|
var index = string.length;
|
||||||
|
|
||||||
while (index-- && isWhitespace(string.charCodeAt(index))) { }
|
while (index-- && isWhitespace(string.charCodeAt(index))) {}
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -682,7 +682,7 @@
|
|||||||
try {
|
try {
|
||||||
var func = isNative(func = context.Float64Array) && func,
|
var func = isNative(func = context.Float64Array) && func,
|
||||||
result = new func(new ArrayBuffer(10), 0, 1) && func;
|
result = new func(new ArrayBuffer(10), 0, 1) && func;
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
return result;
|
return result;
|
||||||
}());
|
}());
|
||||||
|
|
||||||
@@ -693,7 +693,7 @@
|
|||||||
var o = {},
|
var o = {},
|
||||||
func = isNative(func = Object.defineProperty) && func,
|
func = isNative(func = Object.defineProperty) && func,
|
||||||
result = func(o, o, o) && func;
|
result = func(o, o, o) && func;
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
return result;
|
return result;
|
||||||
}());
|
}());
|
||||||
|
|
||||||
@@ -852,8 +852,8 @@
|
|||||||
|
|
||||||
Ctor.prototype = { 'valueOf': 1, 'y': 1 };
|
Ctor.prototype = { 'valueOf': 1, 'y': 1 };
|
||||||
for (var key in new Ctor) { props.push(key); }
|
for (var key in new Ctor) { props.push(key); }
|
||||||
for (var argsKey in arguments) { }
|
for (var argsKey in arguments) {}
|
||||||
for (var strKey in 'x') { }
|
for (var strKey in 'x') {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detect if the `[[Class]]` of `arguments` objects is resolvable
|
* Detect if the `[[Class]]` of `arguments` objects is resolvable
|
||||||
@@ -3315,7 +3315,7 @@
|
|||||||
index = length;
|
index = length;
|
||||||
|
|
||||||
predicate = getCallback(predicate, thisArg, 3);
|
predicate = getCallback(predicate, thisArg, 3);
|
||||||
while (index-- && predicate(array[index], index, array)) { }
|
while (index-- && predicate(array[index], index, array)) {}
|
||||||
return slice(array, 0, index + 1);
|
return slice(array, 0, index + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3364,7 +3364,7 @@
|
|||||||
length = array ? array.length : 0;
|
length = array ? array.length : 0;
|
||||||
|
|
||||||
predicate = getCallback(predicate, thisArg, 3);
|
predicate = getCallback(predicate, thisArg, 3);
|
||||||
while (++index < length && predicate(array[index], index, array)) { }
|
while (++index < length && predicate(array[index], index, array)) {}
|
||||||
return slice(array, index);
|
return slice(array, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4076,7 +4076,7 @@
|
|||||||
index = length;
|
index = length;
|
||||||
|
|
||||||
predicate = getCallback(predicate, thisArg, 3);
|
predicate = getCallback(predicate, thisArg, 3);
|
||||||
while (index-- && predicate(array[index], index, array)) { }
|
while (index-- && predicate(array[index], index, array)) {}
|
||||||
return slice(array, index + 1);
|
return slice(array, index + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4125,7 +4125,7 @@
|
|||||||
length = array ? array.length : 0;
|
length = array ? array.length : 0;
|
||||||
|
|
||||||
predicate = getCallback(predicate, thisArg, 3);
|
predicate = getCallback(predicate, thisArg, 3);
|
||||||
while (++index < length && predicate(array[index], index, array)) { }
|
while (++index < length && predicate(array[index], index, array)) {}
|
||||||
return slice(array, 0, index);
|
return slice(array, 0, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
// is the applet permitted?
|
// is the applet permitted?
|
||||||
if (!/[?&]nojava=true(?:&|$)/.test(location.search)) {
|
if (!/[?&]nojava=true(?:&|$)/.test(location.search)) {
|
||||||
// is the applet really needed?
|
// is the applet really needed?
|
||||||
while (!(measured = new Date - begin)) { }
|
while (!(measured = new Date - begin)) {}
|
||||||
if (measured != 1 && !((perfNow = window.performance) && typeof (perfNow.now || perfNow.webkitNow) == 'function')) {
|
if (measured != 1 && !((perfNow = window.performance) && typeof (perfNow.now || perfNow.webkitNow) == 'function')) {
|
||||||
// load applet
|
// load applet
|
||||||
document.write('<applet code="nano" archive="../vendor/benchmark.js/nano.jar"></applet>');
|
document.write('<applet code="nano" archive="../vendor/benchmark.js/nano.jar"></applet>');
|
||||||
@@ -79,4 +79,4 @@
|
|||||||
}());
|
}());
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -43,11 +43,11 @@
|
|||||||
if (!amd) {
|
if (!amd) {
|
||||||
try {
|
try {
|
||||||
result = require('fs').realpathSync(result);
|
result = require('fs').realpathSync(result);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = require.resolve(result);
|
result = require.resolve(result);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}());
|
}());
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
var hasOwnProperty = objectProto.hasOwnProperty,
|
var hasOwnProperty = objectProto.hasOwnProperty,
|
||||||
fnToString = funcProto.toString,
|
fnToString = funcProto.toString,
|
||||||
nativeString = fnToString.call(objectProto.toString),
|
nativeString = fnToString.call(objectProto.toString),
|
||||||
|
noop = function() {},
|
||||||
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
||||||
reToString = /toString/g,
|
reToString = /toString/g,
|
||||||
whitespace = ' \t\x0B\f\xA0\ufeff\n\r\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000';
|
whitespace = ' \t\x0B\f\xA0\ufeff\n\r\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000';
|
||||||
@@ -78,26 +79,26 @@
|
|||||||
}()));
|
}()));
|
||||||
|
|
||||||
// add extensions
|
// add extensions
|
||||||
funcProto._method = function() {};
|
funcProto._method = noop;
|
||||||
|
|
||||||
// set bad shims
|
// set bad shims
|
||||||
setProperty(Array, '_isArray', Array.isArray);
|
setProperty(Array, '_isArray', Array.isArray);
|
||||||
setProperty(Array, 'isArray', function() {});
|
setProperty(Array, 'isArray', noop);
|
||||||
|
|
||||||
setProperty(Date, '_now', Date.now);
|
setProperty(Date, '_now', Date.now);
|
||||||
setProperty(Date, 'now', function() {});
|
setProperty(Date, 'now', noop);
|
||||||
|
|
||||||
setProperty(Object, '_create', Object.create);
|
setProperty(Object, '_create', Object.create);
|
||||||
setProperty(Object, 'create', function() {});
|
setProperty(Object, 'create', noop);
|
||||||
|
|
||||||
setProperty(Object, '_defineProperty', Object.defineProperty);
|
setProperty(Object, '_defineProperty', Object.defineProperty);
|
||||||
setProperty(Object, 'defineProperty', function() {});
|
setProperty(Object, 'defineProperty', noop);
|
||||||
|
|
||||||
setProperty(Object, '_getPrototypeOf', Object.getPrototypeOf);
|
setProperty(Object, '_getPrototypeOf', Object.getPrototypeOf);
|
||||||
setProperty(Object, 'getPrototypeOf', function() {});
|
setProperty(Object, 'getPrototypeOf', noop);
|
||||||
|
|
||||||
setProperty(Object, '_keys', Object.keys);
|
setProperty(Object, '_keys', Object.keys);
|
||||||
setProperty(Object, 'keys', function() {});
|
setProperty(Object, 'keys', noop);
|
||||||
|
|
||||||
setProperty(objectProto, 'hasOwnProperty', (function() {
|
setProperty(objectProto, 'hasOwnProperty', (function() {
|
||||||
function wrapper(key) {
|
function wrapper(key) {
|
||||||
@@ -114,13 +115,13 @@
|
|||||||
}()));
|
}()));
|
||||||
|
|
||||||
setProperty(Number, '_isFinite', Number.isFinite);
|
setProperty(Number, '_isFinite', Number.isFinite);
|
||||||
setProperty(Number, 'isFinite', function() {});
|
setProperty(Number, 'isFinite', noop);
|
||||||
|
|
||||||
setProperty(stringProto, '_contains', stringProto.contains);
|
setProperty(stringProto, '_contains', stringProto.contains);
|
||||||
setProperty(stringProto, 'contains', stringProto._contains ? function() {} : Boolean);
|
setProperty(stringProto, 'contains', stringProto._contains ? noop : Boolean);
|
||||||
|
|
||||||
setProperty(document, '_createDocumentFragment', document.createDocumentFragment);
|
setProperty(document, '_createDocumentFragment', document.createDocumentFragment);
|
||||||
document.createDocumentFragment = function() {};
|
document.createDocumentFragment = noop;
|
||||||
|
|
||||||
setProperty(window, '_ArrayBuffer', window.ArrayBuffer);
|
setProperty(window, '_ArrayBuffer', window.ArrayBuffer);
|
||||||
if (window.ArrayBuffer && window.Uint8Array) {
|
if (window.ArrayBuffer && window.Uint8Array) {
|
||||||
|
|||||||
74
test/test.js
74
test/test.js
@@ -62,11 +62,11 @@
|
|||||||
if (!amd) {
|
if (!amd) {
|
||||||
try {
|
try {
|
||||||
result = require('fs').realpathSync(result);
|
result = require('fs').realpathSync(result);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = require.resolve(result);
|
result = require.resolve(result);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}());
|
}());
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
/** Used to test host objects in IE */
|
/** Used to test host objects in IE */
|
||||||
try {
|
try {
|
||||||
var xml = new ActiveXObject('Microsoft.XMLDOM');
|
var xml = new ActiveXObject('Microsoft.XMLDOM');
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
|
|
||||||
/** Use a single "load" function */
|
/** Use a single "load" function */
|
||||||
var load = (typeof require == 'function' && !amd)
|
var load = (typeof require == 'function' && !amd)
|
||||||
@@ -212,7 +212,7 @@
|
|||||||
var o = {},
|
var o = {},
|
||||||
func = Object.defineProperty,
|
func = Object.defineProperty,
|
||||||
result = func(o, o, o) && func;
|
result = func(o, o, o) && func;
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
return result;
|
return result;
|
||||||
}());
|
}());
|
||||||
|
|
||||||
@@ -992,7 +992,7 @@
|
|||||||
try {
|
try {
|
||||||
var bound = _.bind(fn, value);
|
var bound = _.bind(fn, value);
|
||||||
return bound();
|
return bound();
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
ok(_.every(actual, function(value, index) {
|
ok(_.every(actual, function(value, index) {
|
||||||
@@ -1531,8 +1531,8 @@
|
|||||||
|
|
||||||
test('`_.cloneDeep` should deep clone objects with circular references', 1, function() {
|
test('`_.cloneDeep` should deep clone objects with circular references', 1, function() {
|
||||||
var object = {
|
var object = {
|
||||||
'foo': { 'b': { 'foo': { 'c': { } } } },
|
'foo': { 'b': { 'foo': { 'c': {} } } },
|
||||||
'bar': { }
|
'bar': {}
|
||||||
};
|
};
|
||||||
|
|
||||||
object.foo.b.foo.c = object;
|
object.foo.b.foo.c = object;
|
||||||
@@ -2025,7 +2025,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should accept a falsey `prototype` argument', 1, function() {
|
test('should accept a falsey `prototype` argument', 1, function() {
|
||||||
var expected = _.map(falsey, function() { return {}; });
|
var expected = _.map(falsey, _.constant({}));
|
||||||
|
|
||||||
var actual = _.map(falsey, function(value, index) {
|
var actual = _.map(falsey, function(value, index) {
|
||||||
return index ? _.create(value) : _.create();
|
return index ? _.create(value) : _.create();
|
||||||
@@ -3212,7 +3212,7 @@
|
|||||||
var actual = _.map(empties, function(value) {
|
var actual = _.map(empties, function(value) {
|
||||||
try {
|
try {
|
||||||
return _.every(value, _.identity);
|
return _.every(value, _.identity);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -3360,7 +3360,7 @@
|
|||||||
_.each(emptyValues, function(value) {
|
_.each(emptyValues, function(value) {
|
||||||
try {
|
try {
|
||||||
actual.push(func(value, { 'a': 3 }));
|
actual.push(func(value, { 'a': 3 }));
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expecting);
|
deepEqual(actual, expecting);
|
||||||
@@ -4726,7 +4726,7 @@
|
|||||||
var actual = _.map(falsey, function(value, index) {
|
var actual = _.map(falsey, function(value, index) {
|
||||||
try {
|
try {
|
||||||
return index ? _.initial(value) : _.initial();
|
return index ? _.initial(value) : _.initial();
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -5465,12 +5465,12 @@
|
|||||||
|
|
||||||
test('should perform comparisons between objects with complex circular references', 1, function() {
|
test('should perform comparisons between objects with complex circular references', 1, function() {
|
||||||
var object1 = {
|
var object1 = {
|
||||||
'foo': { 'b': { 'foo': { 'c': { } } } },
|
'foo': { 'b': { 'foo': { 'c': {} } } },
|
||||||
'bar': { 'a': 2 }
|
'bar': { 'a': 2 }
|
||||||
};
|
};
|
||||||
|
|
||||||
var object2 = {
|
var object2 = {
|
||||||
'foo': { 'b': { 'foo': { 'c': { } } } },
|
'foo': { 'b': { 'foo': { 'c': {} } } },
|
||||||
'bar': { 'a': 2 }
|
'bar': { 'a': 2 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -6690,7 +6690,7 @@
|
|||||||
var actual = _.map(falsey, function(value, index) {
|
var actual = _.map(falsey, function(value, index) {
|
||||||
try {
|
try {
|
||||||
return index ? func(value) : func();
|
return index ? func(value) : func();
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -6779,7 +6779,7 @@
|
|||||||
var actual = _.map(falsey, function(value, index) {
|
var actual = _.map(falsey, function(value, index) {
|
||||||
try {
|
try {
|
||||||
return index ? _.map(value) : _.map();
|
return index ? _.map(value) : _.map();
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -6851,7 +6851,7 @@
|
|||||||
var actual = _.map(falsey, function(value, index) {
|
var actual = _.map(falsey, function(value, index) {
|
||||||
try {
|
try {
|
||||||
return index ? _.mapValues(value) : _.mapValues();
|
return index ? _.mapValues(value) : _.mapValues();
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -6951,7 +6951,7 @@
|
|||||||
var actual = _.map(falsey, function(value, index) {
|
var actual = _.map(falsey, function(value, index) {
|
||||||
try {
|
try {
|
||||||
return index ? matches(value) : matches();
|
return index ? matches(value) : matches();
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -6965,7 +6965,7 @@
|
|||||||
try {
|
try {
|
||||||
var result = index ? matches(value) : matches();
|
var result = index ? matches(value) : matches();
|
||||||
return result === true;
|
return result === true;
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -7067,7 +7067,7 @@
|
|||||||
var actual = _.map(empties, function(value) {
|
var actual = _.map(empties, function(value) {
|
||||||
try {
|
try {
|
||||||
return _.max(value);
|
return _.max(value);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -7080,7 +7080,7 @@
|
|||||||
var actual = _.map(collections, function(value) {
|
var actual = _.map(collections, function(value) {
|
||||||
try {
|
try {
|
||||||
return _.max(value);
|
return _.max(value);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -7129,7 +7129,7 @@
|
|||||||
var actual = _.map(falsey, function(value, index) {
|
var actual = _.map(falsey, function(value, index) {
|
||||||
try {
|
try {
|
||||||
return _.isFunction(index ? _.memoize(_.noop, value) : _.memoize(_.noop));
|
return _.isFunction(index ? _.memoize(_.noop, value) : _.memoize(_.noop));
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -7224,8 +7224,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
var source = {
|
var source = {
|
||||||
'foo': { 'b': { 'foo': { 'c': { } } } },
|
'foo': { 'b': { 'foo': { 'c': {} } } },
|
||||||
'bar': { }
|
'bar': {}
|
||||||
};
|
};
|
||||||
|
|
||||||
source.foo.b.foo.c = source;
|
source.foo.b.foo.c = source;
|
||||||
@@ -7305,7 +7305,7 @@
|
|||||||
var actual = _.map(empties, function(value) {
|
var actual = _.map(empties, function(value) {
|
||||||
try {
|
try {
|
||||||
return _.min(value);
|
return _.min(value);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -7318,7 +7318,7 @@
|
|||||||
var actual = _.map(collections, function(value) {
|
var actual = _.map(collections, function(value) {
|
||||||
try {
|
try {
|
||||||
return _.min(value);
|
return _.min(value);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -8849,7 +8849,7 @@
|
|||||||
_.each(empties, function(value) {
|
_.each(empties, function(value) {
|
||||||
try {
|
try {
|
||||||
actual.push(func(value, _.noop));
|
actual.push(func(value, _.noop));
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -8861,7 +8861,7 @@
|
|||||||
var actual = _.map(empties, function(value) {
|
var actual = _.map(empties, function(value) {
|
||||||
try {
|
try {
|
||||||
return func(value, _.noop, 'x');
|
return func(value, _.noop, 'x');
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -9068,7 +9068,7 @@
|
|||||||
var actual = _.map(falsey, function(value, index) {
|
var actual = _.map(falsey, function(value, index) {
|
||||||
try {
|
try {
|
||||||
return index ? _.rest(value) : _.rest();
|
return index ? _.rest(value) : _.rest();
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -9188,7 +9188,7 @@
|
|||||||
_.each(empties, function(value) {
|
_.each(empties, function(value) {
|
||||||
try {
|
try {
|
||||||
actual.push(_.shuffle(value), _.shuffle(value, 1));
|
actual.push(_.shuffle(value), _.shuffle(value, 1));
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -9313,7 +9313,7 @@
|
|||||||
var actual = _.map(falsey, function(value, index) {
|
var actual = _.map(falsey, function(value, index) {
|
||||||
try {
|
try {
|
||||||
return index ? _.size(value) : _.size();
|
return index ? _.size(value) : _.size();
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -9449,7 +9449,7 @@
|
|||||||
var actual = _.map(empties, function(value) {
|
var actual = _.map(empties, function(value) {
|
||||||
try {
|
try {
|
||||||
return _.some(value, _.identity);
|
return _.some(value, _.identity);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -9932,7 +9932,7 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
var actual = compiled();
|
var actual = compiled();
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
|
|
||||||
strictEqual(actual, 'function');
|
strictEqual(actual, 'function');
|
||||||
});
|
});
|
||||||
@@ -10003,7 +10003,7 @@
|
|||||||
'interpolate': /\{\{=([\s\S]+?)\}\}/g
|
'interpolate': /\{\{=([\s\S]+?)\}\}/g
|
||||||
});
|
});
|
||||||
|
|
||||||
var compiled = _.template('<ul>{{ _.each(collection, function(value, index) { }}<li>{{= index }}: {{- value }}</li>{{ }); }}</ul>', index ? null : settings),
|
var compiled = _.template('<ul>{{ _.each(collection, function(value, index) {}}<li>{{= index }}: {{- value }}</li>{{}); }}</ul>', index ? null : settings),
|
||||||
expected = '<ul><li>0: a & A</li><li>1: b & B</li></ul>';
|
expected = '<ul><li>0: a & A</li><li>1: b & B</li></ul>';
|
||||||
|
|
||||||
strictEqual(compiled({ 'collection': ['a & A', 'b & B'] }), expected);
|
strictEqual(compiled({ 'collection': ['a & A', 'b & B'] }), expected);
|
||||||
@@ -10699,7 +10699,7 @@
|
|||||||
try {
|
try {
|
||||||
var nodeList = document.getElementsByTagName('body'),
|
var nodeList = document.getElementsByTagName('body'),
|
||||||
actual = func(nodeList);
|
actual = func(nodeList);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
|
|
||||||
deepEqual(actual, [body]);
|
deepEqual(actual, [body]);
|
||||||
}
|
}
|
||||||
@@ -11402,7 +11402,7 @@
|
|||||||
var actual = _.map(falsey, function(value, index) {
|
var actual = _.map(falsey, function(value, index) {
|
||||||
try {
|
try {
|
||||||
return index ? _.zipObject(value) : _.zipObject();
|
return index ? _.zipObject(value) : _.zipObject();
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -11663,7 +11663,7 @@
|
|||||||
_.each(falsey, function(value, index) {
|
_.each(falsey, function(value, index) {
|
||||||
try {
|
try {
|
||||||
actual.push(index ? func(value) : func());
|
actual.push(index ? func(value) : func());
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
@@ -11681,7 +11681,7 @@
|
|||||||
var actual = _.map(falsey, function(value, index) {
|
var actual = _.map(falsey, function(value, index) {
|
||||||
try {
|
try {
|
||||||
return func(value, 2);
|
return func(value, 2);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
deepEqual(actual, expected);
|
deepEqual(actual, expected);
|
||||||
|
|||||||
22
vendor/benchmark.js/benchmark.js
vendored
22
vendor/benchmark.js/benchmark.js
vendored
@@ -663,7 +663,7 @@
|
|||||||
function req(id) {
|
function req(id) {
|
||||||
try {
|
try {
|
||||||
var result = freeExports && freeRequire(id);
|
var result = freeExports && freeRequire(id);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
return result || null;
|
return result || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -905,7 +905,7 @@
|
|||||||
}
|
}
|
||||||
else if (async) {
|
else if (async) {
|
||||||
// resume execution if previously asynchronous but now synchronous
|
// resume execution if previously asynchronous but now synchronous
|
||||||
while (execute()) { }
|
while (execute()) {}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// continue synchronous execution
|
// continue synchronous execution
|
||||||
@@ -986,7 +986,7 @@
|
|||||||
if (isAsync(bench)) {
|
if (isAsync(bench)) {
|
||||||
delay(bench, execute);
|
delay(bench, execute);
|
||||||
} else {
|
} else {
|
||||||
while (execute()) { }
|
while (execute()) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1770,30 +1770,30 @@
|
|||||||
divisor = 1e6;
|
divisor = 1e6;
|
||||||
if (ns.stop) {
|
if (ns.stop) {
|
||||||
ns.start();
|
ns.start();
|
||||||
while (!(measured = ns.microseconds())) { }
|
while (!(measured = ns.microseconds())) {}
|
||||||
} else {
|
} else {
|
||||||
begin = ns();
|
begin = ns();
|
||||||
while (!(measured = ns() - begin)) { }
|
while (!(measured = ns() - begin)) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (unit == 'ns') {
|
else if (unit == 'ns') {
|
||||||
divisor = 1e9;
|
divisor = 1e9;
|
||||||
if (ns.nanoTime) {
|
if (ns.nanoTime) {
|
||||||
begin = ns.nanoTime();
|
begin = ns.nanoTime();
|
||||||
while (!(measured = ns.nanoTime() - begin)) { }
|
while (!(measured = ns.nanoTime() - begin)) {}
|
||||||
} else {
|
} else {
|
||||||
begin = (begin = ns())[0] + (begin[1] / divisor);
|
begin = (begin = ns())[0] + (begin[1] / divisor);
|
||||||
while (!(measured = ((measured = ns())[0] + (measured[1] / divisor)) - begin)) { }
|
while (!(measured = ((measured = ns())[0] + (measured[1] / divisor)) - begin)) {}
|
||||||
divisor = 1;
|
divisor = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ns.now) {
|
else if (ns.now) {
|
||||||
begin = ns.now();
|
begin = ns.now();
|
||||||
while (!(measured = ns.now() - begin)) { }
|
while (!(measured = ns.now() - begin)) {}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
begin = new ns().getTime();
|
begin = new ns().getTime();
|
||||||
while (!(measured = new ns().getTime() - begin)) { }
|
while (!(measured = new ns().getTime() - begin)) {}
|
||||||
}
|
}
|
||||||
// check for broken timers (`nanoTime` may have issues)
|
// check for broken timers (`nanoTime` may have issues)
|
||||||
// http://alivebutsleepy.srnet.cz/unreliable-system-nanotime/
|
// http://alivebutsleepy.srnet.cz/unreliable-system-nanotime/
|
||||||
@@ -1828,7 +1828,7 @@
|
|||||||
if (typeof timer.ns.nanoTime() == 'number') {
|
if (typeof timer.ns.nanoTime() == 'number') {
|
||||||
timers.push({ 'ns': timer.ns, 'res': getRes('ns'), 'unit': 'ns' });
|
timers.push({ 'ns': timer.ns, 'res': getRes('ns'), 'unit': 'ns' });
|
||||||
}
|
}
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
|
|
||||||
// detect Chrome's microsecond timer:
|
// detect Chrome's microsecond timer:
|
||||||
// enable benchmarking via the --enable-benchmarking command
|
// enable benchmarking via the --enable-benchmarking command
|
||||||
@@ -1837,7 +1837,7 @@
|
|||||||
if ((timer.ns = new (context.chrome || context.chromium).Interval)) {
|
if ((timer.ns = new (context.chrome || context.chromium).Interval)) {
|
||||||
timers.push({ 'ns': timer.ns, 'res': getRes('us'), 'unit': 'us' });
|
timers.push({ 'ns': timer.ns, 'res': getRes('us'), 'unit': 'us' });
|
||||||
}
|
}
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
|
|
||||||
// detect Node.js's nanosecond resolution timer available in Node.js >= 0.8
|
// detect Node.js's nanosecond resolution timer available in Node.js >= 0.8
|
||||||
if (processObject && typeof (timer.ns = processObject.hrtime) == 'function') {
|
if (processObject && typeof (timer.ns = processObject.hrtime) == 'function') {
|
||||||
|
|||||||
178
vendor/platform.js/platform.js
vendored
178
vendor/platform.js/platform.js
vendored
@@ -1,12 +1,12 @@
|
|||||||
/*!
|
/*!
|
||||||
* Platform.js v1.1.0 <http://mths.be/platform>
|
* Platform.js v1.2.0 <http://mths.be/platform>
|
||||||
* Copyright 2010-2014 John-David Dalton <http://allyoucanleet.com/>
|
* Copyright 2010-2014 John-David Dalton <http://allyoucanleet.com/>
|
||||||
* Available under MIT license <http://mths.be/mit>
|
* Available under MIT license <http://mths.be/mit>
|
||||||
*/
|
*/
|
||||||
;(function() {
|
;(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/** Used to determine if values are of the language type Object */
|
/** Used to determine if values are of the language type `Object` */
|
||||||
var objectTypes = {
|
var objectTypes = {
|
||||||
'function': true,
|
'function': true,
|
||||||
'object': true
|
'object': true
|
||||||
@@ -66,6 +66,60 @@
|
|||||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A utility function to clean up the OS name.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} os The OS name to clean up.
|
||||||
|
* @param {string} [pattern] A `RegExp` pattern matching the OS name.
|
||||||
|
* @param {string} [label] A label for the OS.
|
||||||
|
*/
|
||||||
|
function cleanupOS(os, pattern, label) {
|
||||||
|
// platform tokens defined at
|
||||||
|
// http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
|
||||||
|
// http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
|
||||||
|
var data = {
|
||||||
|
'6.3': '8.1',
|
||||||
|
'6.2': '8',
|
||||||
|
'6.1': 'Server 2008 R2 / 7',
|
||||||
|
'6.0': 'Server 2008 / Vista',
|
||||||
|
'5.2': 'Server 2003 / XP 64-bit',
|
||||||
|
'5.1': 'XP',
|
||||||
|
'5.01': '2000 SP1',
|
||||||
|
'5.0': '2000',
|
||||||
|
'4.0': 'NT',
|
||||||
|
'4.90': 'ME'
|
||||||
|
};
|
||||||
|
// detect Windows version from platform tokens
|
||||||
|
if (pattern && label && /^Win/i.test(os) &&
|
||||||
|
(data = data[0/*Opera 9.25 fix*/, /[\d.]+$/.exec(os)])) {
|
||||||
|
os = 'Windows ' + data;
|
||||||
|
}
|
||||||
|
// correct character case and cleanup
|
||||||
|
os = String(os);
|
||||||
|
|
||||||
|
if (pattern && label) {
|
||||||
|
os = os.replace(RegExp(pattern, 'i'), label);
|
||||||
|
}
|
||||||
|
|
||||||
|
os = format(
|
||||||
|
os.replace(/ ce$/i, ' CE')
|
||||||
|
.replace(/hpw/i, 'web')
|
||||||
|
.replace(/Macintosh/, 'Mac OS')
|
||||||
|
.replace(/_PowerPC/i, ' OS')
|
||||||
|
.replace(/(OS X) [^ \d]+/i, '$1')
|
||||||
|
.replace(/Mac (OS X)/, '$1')
|
||||||
|
.replace(/\/(\d)/, ' $1')
|
||||||
|
.replace(/_/g, '.')
|
||||||
|
.replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, '')
|
||||||
|
.replace(/x86\.64/gi, 'x86_64')
|
||||||
|
.replace(/(Windows Phone)(?! OS)/, '$1 OS')
|
||||||
|
.split(' on ')[0]
|
||||||
|
);
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An iteration utility for arrays and objects.
|
* An iteration utility for arrays and objects.
|
||||||
*
|
*
|
||||||
@@ -116,11 +170,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the internal [[Class]] of a value.
|
* Gets the internal `[[Class]]` of a value.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {*} value The value.
|
* @param {*} value The value.
|
||||||
* @returns {string} The [[Class]].
|
* @returns {string} The `[[Class]]`.
|
||||||
*/
|
*/
|
||||||
function getClassOf(value) {
|
function getClassOf(value) {
|
||||||
return value == null
|
return value == null
|
||||||
@@ -222,7 +276,7 @@
|
|||||||
? !!nav.likeChrome
|
? !!nav.likeChrome
|
||||||
: /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString());
|
: /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString());
|
||||||
|
|
||||||
/** Internal [[Class]] value shortcuts */
|
/** Internal `[[Class]]` value shortcuts */
|
||||||
var objectClass = 'Object',
|
var objectClass = 'Object',
|
||||||
airRuntimeClass = isCustomContext ? objectClass : 'ScriptBridgingProxyObject',
|
airRuntimeClass = isCustomContext ? objectClass : 'ScriptBridgingProxyObject',
|
||||||
enviroClass = isCustomContext ? objectClass : 'Environment',
|
enviroClass = isCustomContext ? objectClass : 'Environment',
|
||||||
@@ -245,13 +299,13 @@
|
|||||||
var doc = context.document || {};
|
var doc = context.document || {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detect Opera browser
|
* Detect Opera browser (Presto-based)
|
||||||
* http://www.howtocreate.co.uk/operaStuff/operaObject.html
|
* http://www.howtocreate.co.uk/operaStuff/operaObject.html
|
||||||
* http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini
|
* http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini
|
||||||
*/
|
*/
|
||||||
var opera = context.operamini || context.opera;
|
var opera = context.operamini || context.opera;
|
||||||
|
|
||||||
/** Opera [[Class]] */
|
/** Opera `[[Class]]` */
|
||||||
var operaClass = reOpera.test(operaClass = (isCustomContext && opera) ? opera['[[Class]]'] : getClassOf(opera))
|
var operaClass = reOpera.test(operaClass = (isCustomContext && opera) ? opera['[[Class]]'] : getClassOf(opera))
|
||||||
? operaClass
|
? operaClass
|
||||||
: (opera = null);
|
: (opera = null);
|
||||||
@@ -276,6 +330,9 @@
|
|||||||
/** The browser/environment version */
|
/** The browser/environment version */
|
||||||
var version = useFeatures && opera && typeof opera.version == 'function' && opera.version();
|
var version = useFeatures && opera && typeof opera.version == 'function' && opera.version();
|
||||||
|
|
||||||
|
/** A flag to indicate if the OS ends with "/ Version" */
|
||||||
|
var isSpecialCasedOS;
|
||||||
|
|
||||||
/* Detectable layout engines (order is important) */
|
/* Detectable layout engines (order is important) */
|
||||||
var layout = getLayout([
|
var layout = getLayout([
|
||||||
{ 'label': 'WebKit', 'pattern': 'AppleWebKit' },
|
{ 'label': 'WebKit', 'pattern': 'AppleWebKit' },
|
||||||
@@ -293,6 +350,7 @@
|
|||||||
'Adobe AIR',
|
'Adobe AIR',
|
||||||
'Arora',
|
'Arora',
|
||||||
'Avant Browser',
|
'Avant Browser',
|
||||||
|
'Breach',
|
||||||
'Camino',
|
'Camino',
|
||||||
'Epiphany',
|
'Epiphany',
|
||||||
'Fennec',
|
'Fennec',
|
||||||
@@ -320,6 +378,7 @@
|
|||||||
'Swiftfox',
|
'Swiftfox',
|
||||||
'WebPositive',
|
'WebPositive',
|
||||||
'Opera Mini',
|
'Opera Mini',
|
||||||
|
{ 'label': 'Opera Mini', 'pattern': 'OPiOS' },
|
||||||
'Opera',
|
'Opera',
|
||||||
{ 'label': 'Opera', 'pattern': 'OPR' },
|
{ 'label': 'Opera', 'pattern': 'OPR' },
|
||||||
'Chrome',
|
'Chrome',
|
||||||
@@ -366,12 +425,12 @@
|
|||||||
'BlackBerry': { 'PlayBook': 1 },
|
'BlackBerry': { 'PlayBook': 1 },
|
||||||
'Google': { 'Google TV': 1 },
|
'Google': { 'Google TV': 1 },
|
||||||
'HP': { 'TouchPad': 1 },
|
'HP': { 'TouchPad': 1 },
|
||||||
'HTC': { },
|
'HTC': {},
|
||||||
'LG': { },
|
'LG': {},
|
||||||
'Microsoft': { 'Xbox': 1, 'Xbox One': 1 },
|
'Microsoft': { 'Xbox': 1, 'Xbox One': 1 },
|
||||||
'Motorola': { 'Xoom': 1 },
|
'Motorola': { 'Xoom': 1 },
|
||||||
'Nintendo': { 'Wii U': 1, 'Wii': 1 },
|
'Nintendo': { 'Wii U': 1, 'Wii': 1 },
|
||||||
'Nokia': { },
|
'Nokia': {},
|
||||||
'Samsung': { 'Galaxy S': 1, 'Galaxy S2': 1, 'Galaxy S3': 1, 'Galaxy S4': 1 },
|
'Samsung': { 'Galaxy S': 1, 'Galaxy S2': 1, 'Galaxy S3': 1, 'Galaxy S4': 1 },
|
||||||
'Sony': { 'PlayStation 4': 1, 'PlayStation 3': 1, 'PlayStation Vita': 1 }
|
'Sony': { 'PlayStation 4': 1, 'PlayStation 3': 1, 'PlayStation Vita': 1 }
|
||||||
});
|
});
|
||||||
@@ -426,7 +485,7 @@
|
|||||||
* Picks the manufacturer from an array of guesses.
|
* Picks the manufacturer from an array of guesses.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Object} guesses An object of guesses.
|
* @param {Array} guesses An object of guesses.
|
||||||
* @returns {null|string} The detected manufacturer.
|
* @returns {null|string} The detected manufacturer.
|
||||||
*/
|
*/
|
||||||
function getManufacturer(guesses) {
|
function getManufacturer(guesses) {
|
||||||
@@ -468,40 +527,7 @@
|
|||||||
if (!result && (result =
|
if (!result && (result =
|
||||||
RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua)
|
RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua)
|
||||||
)) {
|
)) {
|
||||||
// platform tokens defined at
|
result = cleanupOS(result, pattern, guess.label || guess);
|
||||||
// http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
|
|
||||||
// http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
|
|
||||||
data = {
|
|
||||||
'6.3': '8.1',
|
|
||||||
'6.2': '8',
|
|
||||||
'6.1': 'Server 2008 R2 / 7',
|
|
||||||
'6.0': 'Server 2008 / Vista',
|
|
||||||
'5.2': 'Server 2003 / XP 64-bit',
|
|
||||||
'5.1': 'XP',
|
|
||||||
'5.01': '2000 SP1',
|
|
||||||
'5.0': '2000',
|
|
||||||
'4.0': 'NT',
|
|
||||||
'4.90': 'ME'
|
|
||||||
};
|
|
||||||
// detect Windows version from platform tokens
|
|
||||||
if (/^Win/i.test(result) &&
|
|
||||||
(data = data[0/*Opera 9.25 fix*/, /[\d.]+$/.exec(result)])) {
|
|
||||||
result = 'Windows ' + data;
|
|
||||||
}
|
|
||||||
// correct character case and cleanup
|
|
||||||
result = format(String(result)
|
|
||||||
.replace(RegExp(pattern, 'i'), guess.label || guess)
|
|
||||||
.replace(/ ce$/i, ' CE')
|
|
||||||
.replace(/hpw/i, 'web')
|
|
||||||
.replace(/Macintosh/, 'Mac OS')
|
|
||||||
.replace(/_PowerPC/i, ' OS')
|
|
||||||
.replace(/(OS X) [^ \d]+/i, '$1')
|
|
||||||
.replace(/Mac (OS X)/, '$1')
|
|
||||||
.replace(/\/(\d)/, ' $1')
|
|
||||||
.replace(/_/g, '.')
|
|
||||||
.replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, '')
|
|
||||||
.replace(/x86\.64/gi, 'x86_64')
|
|
||||||
.split(' on ')[0]);
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
@@ -578,6 +604,10 @@
|
|||||||
if (/\bSimulator\b/i.test(ua)) {
|
if (/\bSimulator\b/i.test(ua)) {
|
||||||
product = (product ? product + ' ' : '') + 'Simulator';
|
product = (product ? product + ' ' : '') + 'Simulator';
|
||||||
}
|
}
|
||||||
|
// detect Opera Mini 8+ running in Turbo / Uncompressed mode on iOS
|
||||||
|
if (name == 'Opera Mini' && /OPiOS/.test(ua)) {
|
||||||
|
description.push('running in Turbo / Uncompressed mode');
|
||||||
|
}
|
||||||
// detect iOS
|
// detect iOS
|
||||||
if (/^iP/.test(product)) {
|
if (/^iP/.test(product)) {
|
||||||
name || (name = 'Safari');
|
name || (name = 'Safari');
|
||||||
@@ -618,7 +648,7 @@
|
|||||||
// detect non-Opera versions (order is important)
|
// detect non-Opera versions (order is important)
|
||||||
if (!version) {
|
if (!version) {
|
||||||
version = getVersion([
|
version = getVersion([
|
||||||
'(?:Cloud9|CriOS|CrMo|Iron|Opera ?Mini|OPR|Raven|Silk(?!/[\\d.]+$))',
|
'(?:Cloud9|CriOS|CrMo|Iron|Opera ?Mini|OPiOS|OPR|Raven|Silk(?!/[\\d.]+$))',
|
||||||
'Version',
|
'Version',
|
||||||
qualify(name),
|
qualify(name),
|
||||||
'(?:Firefox|Minefield|NetFront)'
|
'(?:Firefox|Minefield|NetFront)'
|
||||||
@@ -639,9 +669,12 @@
|
|||||||
layout = ['NetFront'];
|
layout = ['NetFront'];
|
||||||
}
|
}
|
||||||
// detect IE 11 and above
|
// detect IE 11 and above
|
||||||
if (!name && layout == 'Trident') {
|
if (name != 'IE' && layout == 'Trident' && (data = /\brv:([\d.]+)/.exec(ua))) {
|
||||||
|
if (name) {
|
||||||
|
description.push('identifying as ' + name + (version ? ' ' + version : ''));
|
||||||
|
}
|
||||||
name = 'IE';
|
name = 'IE';
|
||||||
version = (/\brv:([\d.]+)/.exec(ua) || 0)[1];
|
version = data[1];
|
||||||
}
|
}
|
||||||
// leverage environment features
|
// leverage environment features
|
||||||
if (useFeatures) {
|
if (useFeatures) {
|
||||||
@@ -653,28 +686,23 @@
|
|||||||
arch = data.getProperty('os.arch');
|
arch = data.getProperty('os.arch');
|
||||||
os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version');
|
os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version');
|
||||||
}
|
}
|
||||||
if (isHostType(context, 'exports')) {
|
if (isModuleScope && isHostType(context, 'system') && (data = [context.system])[0]) {
|
||||||
if (isModuleScope && isHostType(context, 'system') && (data = [context.system])[0]) {
|
os || (os = data[0].os || null);
|
||||||
os || (os = data[0].os || null);
|
try {
|
||||||
try {
|
data[1] = context.require('ringo/engine').version;
|
||||||
data[1] = (data[1] = context.require) && data[1]('ringo/engine').version;
|
version = data[1].join('.');
|
||||||
version = data[1].join('.');
|
name = 'RingoJS';
|
||||||
name = 'RingoJS';
|
} catch(e) {
|
||||||
} catch(e) {
|
if (data[0].global.system == context.system) {
|
||||||
if (data[0].global.system == context.system) {
|
name = 'Narwhal';
|
||||||
name = 'Narwhal';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (typeof context.process == 'object' && (data = context.process)) {
|
}
|
||||||
name = 'Node.js';
|
else if (typeof context.process == 'object' && (data = context.process)) {
|
||||||
arch = data.arch;
|
name = 'Node.js';
|
||||||
os = data.platform;
|
arch = data.arch;
|
||||||
version = /[\d.]+/.exec(data.version)[0];
|
os = data.platform;
|
||||||
}
|
version = /[\d.]+/.exec(data.version)[0];
|
||||||
else if (rhino) {
|
|
||||||
name = 'Rhino';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (rhino) {
|
else if (rhino) {
|
||||||
name = 'Rhino';
|
name = 'Rhino';
|
||||||
@@ -875,7 +903,7 @@
|
|||||||
// add layout engine
|
// add layout engine
|
||||||
if (layout && !/Avant|Nook/.test(name) && (
|
if (layout && !/Avant|Nook/.test(name) && (
|
||||||
/Browser|Lunascape|Maxthon/.test(name) ||
|
/Browser|Lunascape|Maxthon/.test(name) ||
|
||||||
/^(?:Adobe|Arora|Midori|Phantom|Rekonq|Rock|Sleipnir|Web)/.test(name) && layout[1])) {
|
/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Sleipnir|Web)/.test(name) && layout[1])) {
|
||||||
// don't add layout details to description if they are falsey
|
// don't add layout details to description if they are falsey
|
||||||
(data = layout[layout.length - 1]) && description.push(data);
|
(data = layout[layout.length - 1]) && description.push(data);
|
||||||
}
|
}
|
||||||
@@ -894,13 +922,14 @@
|
|||||||
// parse OS into an object
|
// parse OS into an object
|
||||||
if (os) {
|
if (os) {
|
||||||
data = / ([\d.+]+)$/.exec(os);
|
data = / ([\d.+]+)$/.exec(os);
|
||||||
|
isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == '/';
|
||||||
os = {
|
os = {
|
||||||
'architecture': 32,
|
'architecture': 32,
|
||||||
'family': data ? os.replace(data[0], '') : os,
|
'family': (data && !isSpecialCasedOS) ? os.replace(data[0], '') : os,
|
||||||
'version': data ? data[1] : null,
|
'version': data ? data[1] : null,
|
||||||
'toString': function() {
|
'toString': function() {
|
||||||
var version = this.version;
|
var version = this.version;
|
||||||
return this.family + (version ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : '');
|
return this.family + ((version && !isSpecialCasedOS) ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : '');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -911,7 +940,7 @@
|
|||||||
os.family = os.family.replace(RegExp(' *' + data), '');
|
os.family = os.family.replace(RegExp(' *' + data), '');
|
||||||
}
|
}
|
||||||
if (name && (/WOW64/i.test(ua) ||
|
if (name && (/WOW64/i.test(ua) ||
|
||||||
(useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform)))) {
|
(useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/^win32$/i.test(nav.platform)))) {
|
||||||
description.unshift('32-bit');
|
description.unshift('32-bit');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1011,6 +1040,11 @@
|
|||||||
/**
|
/**
|
||||||
* The family of the OS.
|
* The family of the OS.
|
||||||
*
|
*
|
||||||
|
* Common values include:
|
||||||
|
* "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista",
|
||||||
|
* "Windows XP", "OS X", "Ubuntu", "Debian", "Fedora", "Red Hat", "SuSE",
|
||||||
|
* "Android", "iOS" and "Windows Phone OS"
|
||||||
|
*
|
||||||
* @memberOf platform.os
|
* @memberOf platform.os
|
||||||
* @type string|null
|
* @type string|null
|
||||||
*/
|
*/
|
||||||
|
|||||||
12
vendor/qunit-extras/qunit-extras.js
vendored
12
vendor/qunit-extras/qunit-extras.js
vendored
@@ -186,7 +186,7 @@
|
|||||||
var moduleName,
|
var moduleName,
|
||||||
modulePrinted;
|
modulePrinted;
|
||||||
|
|
||||||
/** Object shortcuts */
|
/** Object references */
|
||||||
var phantom = context.phantom,
|
var phantom = context.phantom,
|
||||||
define = context.define,
|
define = context.define,
|
||||||
document = !phantom && context.document,
|
document = !phantom && context.document,
|
||||||
@@ -324,7 +324,7 @@
|
|||||||
if (!amd && typeof require == 'function') {
|
if (!amd && typeof require == 'function') {
|
||||||
try {
|
try {
|
||||||
return require('system').env[name];
|
return require('system').env[name];
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -557,7 +557,7 @@
|
|||||||
} else {
|
} else {
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
|
|
||||||
// exit out of Narwhal, Rhino, or RingoJS
|
// exit out of Narwhal, Rhino, or RingoJS
|
||||||
try {
|
try {
|
||||||
@@ -566,7 +566,7 @@
|
|||||||
} else {
|
} else {
|
||||||
quit();
|
quit();
|
||||||
}
|
}
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
};
|
};
|
||||||
}());
|
}());
|
||||||
|
|
||||||
@@ -687,9 +687,9 @@
|
|||||||
context.setTimeout = setTimeout;
|
context.setTimeout = setTimeout;
|
||||||
}
|
}
|
||||||
}());
|
}());
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
|
|
||||||
// expose shortcuts
|
// expose QUnit API on `context`
|
||||||
// exclude `module` because some environments have it as a built-in object
|
// exclude `module` because some environments have it as a built-in object
|
||||||
('asyncTest deepEqual equal equals expect notDeepEqual notEqual notStrictEqual ' +
|
('asyncTest deepEqual equal equals expect notDeepEqual notEqual notStrictEqual ' +
|
||||||
'ok raises same start stop strictEqual test throws').replace(/\S+/g, function(methodName) {
|
'ok raises same start stop strictEqual test throws').replace(/\S+/g, function(methodName) {
|
||||||
|
|||||||
Reference in New Issue
Block a user