mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
Remove old Chrome and Firefox fixes.
This commit is contained in:
@@ -164,9 +164,6 @@
|
|||||||
/** Used to match `RegExp` flags from their coerced string values. */
|
/** Used to match `RegExp` flags from their coerced string values. */
|
||||||
var reFlags = /\w*$/;
|
var reFlags = /\w*$/;
|
||||||
|
|
||||||
/** Used to detect hexadecimal string values. */
|
|
||||||
var reHasHexPrefix = /^0x/i;
|
|
||||||
|
|
||||||
/** Used to detect bad signed hexadecimal string values. */
|
/** Used to detect bad signed hexadecimal string values. */
|
||||||
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
||||||
|
|
||||||
@@ -14071,15 +14068,12 @@
|
|||||||
* // => [6, 8, 10]
|
* // => [6, 8, 10]
|
||||||
*/
|
*/
|
||||||
function parseInt(string, radix, guard) {
|
function parseInt(string, radix, guard) {
|
||||||
// Chrome fails to trim leading <BOM> whitespace characters.
|
|
||||||
// See https://bugs.chromium.org/p/v8/issues/detail?id=3109 for more details.
|
|
||||||
if (guard || radix == null) {
|
if (guard || radix == null) {
|
||||||
radix = 0;
|
radix = 0;
|
||||||
} else if (radix) {
|
} else if (radix) {
|
||||||
radix = +radix;
|
radix = +radix;
|
||||||
}
|
}
|
||||||
string = toString(string).replace(reTrim, '');
|
return nativeParseInt(toString(string), radix || 0);
|
||||||
return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
18
test/test.js
18
test/test.js
@@ -11135,12 +11135,6 @@
|
|||||||
skipAssert(assert);
|
skipAssert(assert);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.test('should avoid `[xpconnect wrapped native prototype]` in Firefox', function(assert) {
|
|
||||||
assert.expect(1);
|
|
||||||
|
|
||||||
assert.strictEqual(_.isNumber(+'2'), true);
|
|
||||||
});
|
|
||||||
}(1, 2, 3));
|
}(1, 2, 3));
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@@ -16986,7 +16980,7 @@
|
|||||||
assert.strictEqual(_.parseInt('08', 10), 8);
|
assert.strictEqual(_.parseInt('08', 10), 8);
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.test('should parse strings with leading whitespace (test in Chrome and Firefox)', function(assert) {
|
QUnit.test('should parse strings with leading whitespace', function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
|
|
||||||
var expected = [8, 8, 10, 10, 32, 32, 32, 32];
|
var expected = [8, 8, 10, 10, 32, 32, 32, 32];
|
||||||
@@ -20633,14 +20627,8 @@
|
|||||||
? 0
|
? 0
|
||||||
: Math.min(length, MAX_ARRAY_INDEX);
|
: Math.min(length, MAX_ARRAY_INDEX);
|
||||||
|
|
||||||
// Avoid false fails in older Firefox.
|
assert.ok(steps == 32 || steps == 33);
|
||||||
if (array.length == length) {
|
assert.strictEqual(actual, expected);
|
||||||
assert.ok(steps == 32 || steps == 33);
|
|
||||||
assert.strictEqual(actual, expected);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
skipAssert(assert, 2);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user