mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
chore(core,ext): minor JS optimisations (#13950)
This commit is contained in:
parent
b01bc7faff
commit
ad8e238348
3 changed files with 14 additions and 13 deletions
|
@ -183,7 +183,7 @@
|
|||
const twoToOneLessThanTheBitLength = MathPow(2, bitLength - 1);
|
||||
|
||||
return (V, opts = {}) => {
|
||||
let x = toNumber(V, opts);
|
||||
let x = toNumber(V);
|
||||
x = censorNegativeZero(x);
|
||||
|
||||
if (opts.enforceRange) {
|
||||
|
@ -236,7 +236,7 @@
|
|||
const asBigIntN = unsigned ? BigIntAsUintN : BigIntAsIntN;
|
||||
|
||||
return (V, opts = {}) => {
|
||||
let x = toNumber(V, opts);
|
||||
let x = toNumber(V);
|
||||
x = censorNegativeZero(x);
|
||||
|
||||
if (opts.enforceRange) {
|
||||
|
@ -300,7 +300,7 @@
|
|||
});
|
||||
|
||||
converters.float = (V, opts) => {
|
||||
const x = toNumber(V, opts);
|
||||
const x = toNumber(V);
|
||||
|
||||
if (!NumberIsFinite(x)) {
|
||||
throw makeException(
|
||||
|
@ -327,8 +327,8 @@
|
|||
return y;
|
||||
};
|
||||
|
||||
converters["unrestricted float"] = (V, opts) => {
|
||||
const x = toNumber(V, opts);
|
||||
converters["unrestricted float"] = (V, _opts) => {
|
||||
const x = toNumber(V);
|
||||
|
||||
if (isNaN(x)) {
|
||||
return x;
|
||||
|
@ -342,7 +342,7 @@
|
|||
};
|
||||
|
||||
converters.double = (V, opts) => {
|
||||
const x = toNumber(V, opts);
|
||||
const x = toNumber(V);
|
||||
|
||||
if (!NumberIsFinite(x)) {
|
||||
throw makeException(
|
||||
|
@ -355,8 +355,8 @@
|
|||
return x;
|
||||
};
|
||||
|
||||
converters["unrestricted double"] = (V, opts) => {
|
||||
const x = toNumber(V, opts);
|
||||
converters["unrestricted double"] = (V, _opts) => {
|
||||
const x = toNumber(V);
|
||||
|
||||
return x;
|
||||
};
|
||||
|
@ -714,7 +714,7 @@
|
|||
throw makeException(
|
||||
TypeError,
|
||||
`can not be converted to '${name}' because '${key}' is required in '${name}'.`,
|
||||
{ ...opts },
|
||||
opts,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue