es-abstract
Advanced tools
Comparing version 1.17.6 to 1.18.0-next.0
@@ -9,2 +9,4 @@ 'use strict'; | ||
var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); | ||
var isLeadingSurrogate = require('../helpers/isLeadingSurrogate'); | ||
var isTrailingSurrogate = require('../helpers/isTrailingSurrogate'); | ||
@@ -36,3 +38,3 @@ var $TypeError = GetIntrinsic('%TypeError%'); | ||
var first = $charCodeAt(S, index); | ||
if (first < 0xD800 || first > 0xDBFF) { | ||
if (!isLeadingSurrogate(first)) { | ||
return index + 1; | ||
@@ -42,3 +44,3 @@ } | ||
var second = $charCodeAt(S, index + 1); | ||
if (second < 0xDC00 || second > 0xDFFF) { | ||
if (!isTrailingSurrogate(second)) { | ||
return index + 1; | ||
@@ -45,0 +47,0 @@ } |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var msPerDay = require('../helpers/timeConstants').msPerDay; | ||
@@ -12,3 +10,3 @@ | ||
module.exports = function Day(t) { | ||
return $floor(t / msPerDay); | ||
return floor(t / msPerDay); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 | ||
module.exports = function DayFromYear(y) { | ||
return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); | ||
return (365 * (y - 1970)) + floor((y - 1969) / 4) - floor((y - 1901) / 100) + floor((y - 1601) / 400); | ||
}; | ||
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
@@ -8,9 +8,9 @@ // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 | ||
module.exports = function DaysInYear(y) { | ||
if (mod(y, 4) !== 0) { | ||
if (modulo(y, 4) !== 0) { | ||
return 365; | ||
} | ||
if (mod(y, 100) !== 0) { | ||
if (modulo(y, 100) !== 0) { | ||
return 366; | ||
} | ||
if (mod(y, 400) !== 0) { | ||
if (modulo(y, 400) !== 0) { | ||
return 365; | ||
@@ -17,0 +17,0 @@ } |
@@ -85,3 +85,3 @@ | ||
// if (n > m, impl-defined) | ||
result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; | ||
result += n <= m && Type(captures[n - 1]) === 'Undefined' ? '' : captures[n - 1]; | ||
i += 1; | ||
@@ -93,3 +93,3 @@ } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { | ||
// if nn === '00' or nn > m, impl-defined | ||
result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; | ||
result += nn <= m && Type(captures[nnI]) === 'Undefined' ? '' : captures[nnI]; | ||
i += 2; | ||
@@ -96,0 +96,0 @@ } else { |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerHour = timeConstants.msPerHour; | ||
module.exports = function HourFromTime(t) { | ||
return mod($floor(t / msPerHour), HoursPerDay); | ||
return modulo(floor(t / msPerHour), HoursPerDay); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
var $isNaN = require('../helpers/isNaN'); | ||
@@ -19,4 +15,4 @@ var $isFinite = require('../helpers/isFinite'); | ||
} | ||
var abs = $abs(argument); | ||
return $floor(abs) === abs; | ||
var absValue = abs(argument); | ||
return floor(absValue) === absValue; | ||
}; |
@@ -5,6 +5,4 @@ 'use strict'; | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var $DateUTC = GetIntrinsic('%Date.UTC%'); | ||
var mod = require('../helpers/mod'); | ||
var $isFinite = require('../helpers/isFinite'); | ||
@@ -14,2 +12,4 @@ | ||
var Day = require('./Day'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var MonthFromTime = require('./MonthFromTime'); | ||
@@ -28,4 +28,4 @@ var ToInteger = require('./ToInteger'); | ||
var dt = ToInteger(date); | ||
var ym = y + $floor(m / 12); | ||
var mn = mod(m, 12); | ||
var ym = y + floor(m / 12); | ||
var mn = modulo(m, 12); | ||
var t = $DateUTC(ym, mn, 1); | ||
@@ -32,0 +32,0 @@ if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerMinute = timeConstants.msPerMinute; | ||
module.exports = function MinFromTime(t) { | ||
return mod($floor(t / msPerMinute), MinutesPerHour); | ||
return modulo(floor(t / msPerMinute), MinutesPerHour); | ||
}; |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
var msPerSecond = require('../helpers/timeConstants').msPerSecond; | ||
@@ -9,3 +10,3 @@ | ||
module.exports = function msFromTime(t) { | ||
return mod(t, msPerSecond); | ||
return modulo(t, msPerSecond); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerSecond = timeConstants.msPerSecond; | ||
module.exports = function SecFromTime(t) { | ||
return mod($floor(t / msPerSecond), SecondsPerMinute); | ||
return modulo(floor(t / msPerSecond), SecondsPerMinute); | ||
}; |
@@ -7,6 +7,6 @@ 'use strict'; | ||
var $Number = GetIntrinsic('%Number%'); | ||
var $abs = GetIntrinsic('%Math.abs%'); | ||
var $isFinite = require('../helpers/isFinite'); | ||
var abs = require('./abs'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -17,3 +17,3 @@ | ||
module.exports = function TimeClip(time) { | ||
if (!$isFinite(time) || $abs(time) > 8.64e15) { | ||
if (!$isFinite(time) || abs(time) > 8.64e15) { | ||
return NaN; | ||
@@ -20,0 +20,0 @@ } |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
var msPerDay = require('../helpers/timeConstants').msPerDay; | ||
@@ -9,4 +10,4 @@ | ||
module.exports = function TimeWithinDay(t) { | ||
return mod(t, msPerDay); | ||
return modulo(t, msPerDay); | ||
}; | ||
@@ -36,3 +36,3 @@ 'use strict'; | ||
if (typeof getter !== 'undefined' && !IsCallable(getter)) { | ||
throw new TypeError('getter must be a function'); | ||
throw new $TypeError('getter must be a function'); | ||
} | ||
@@ -39,0 +39,0 @@ desc['[[Get]]'] = getter; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -12,7 +11,3 @@ | ||
var $sign = require('../helpers/sign'); | ||
var $mod = require('../helpers/mod'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 | ||
@@ -23,4 +18,4 @@ | ||
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } | ||
var posInt = $sign(number) * $floor($abs(number)); | ||
return $mod(posInt, 0x10000); | ||
var posInt = $sign(number) * floor(abs(number)); | ||
return modulo(posInt, 0x10000); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -12,12 +8,14 @@ | ||
var $sign = require('../helpers/sign'); | ||
var $mod = require('../helpers/mod'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
// https://ecma-international.org/ecma-262/6.0/#sec-touint8 | ||
module.exports = function ToUint8(argument) { | ||
var number = ToNumber(argument); | ||
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } | ||
var posInt = $sign(number) * $floor($abs(number)); | ||
return $mod(posInt, 0x100); | ||
var posInt = $sign(number) * floor(abs(number)); | ||
return modulo(posInt, 0x100); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var ToNumber = require('./ToNumber'); | ||
var floor = require('./floor'); | ||
var $isNaN = require('../helpers/isNaN'); | ||
var $floor = $Math.floor; | ||
// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp | ||
@@ -19,3 +14,3 @@ | ||
if (number >= 0xFF) { return 0xFF; } | ||
var f = $floor(argument); | ||
var f = floor(argument); | ||
if (f + 0.5 < number) { return f + 1; } | ||
@@ -22,0 +17,0 @@ if (number < f + 0.5) { return f; } |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var Day = require('./Day'); | ||
var modulo = require('./modulo'); | ||
@@ -10,3 +9,3 @@ // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 | ||
module.exports = function WeekDay(t) { | ||
return mod(Day(t) + 4, 7); | ||
return modulo(Day(t) + 4, 7); | ||
}; |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); | ||
var isLeadingSurrogate = require('../helpers/isLeadingSurrogate'); | ||
var isTrailingSurrogate = require('../helpers/isTrailingSurrogate'); | ||
@@ -36,3 +38,3 @@ var $TypeError = GetIntrinsic('%TypeError%'); | ||
var first = $charCodeAt(S, index); | ||
if (first < 0xD800 || first > 0xDBFF) { | ||
if (!isLeadingSurrogate(first)) { | ||
return index + 1; | ||
@@ -42,3 +44,3 @@ } | ||
var second = $charCodeAt(S, index + 1); | ||
if (second < 0xDC00 || second > 0xDFFF) { | ||
if (!isTrailingSurrogate(second)) { | ||
return index + 1; | ||
@@ -45,0 +47,0 @@ } |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var msPerDay = require('../helpers/timeConstants').msPerDay; | ||
@@ -12,3 +10,3 @@ | ||
module.exports = function Day(t) { | ||
return $floor(t / msPerDay); | ||
return floor(t / msPerDay); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 | ||
module.exports = function DayFromYear(y) { | ||
return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); | ||
return (365 * (y - 1970)) + floor((y - 1969) / 4) - floor((y - 1901) / 100) + floor((y - 1601) / 400); | ||
}; | ||
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
@@ -8,9 +8,9 @@ // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 | ||
module.exports = function DaysInYear(y) { | ||
if (mod(y, 4) !== 0) { | ||
if (modulo(y, 4) !== 0) { | ||
return 365; | ||
} | ||
if (mod(y, 100) !== 0) { | ||
if (modulo(y, 100) !== 0) { | ||
return 366; | ||
} | ||
if (mod(y, 400) !== 0) { | ||
if (modulo(y, 400) !== 0) { | ||
return 365; | ||
@@ -17,0 +17,0 @@ } |
@@ -85,3 +85,3 @@ | ||
// if (n > m, impl-defined) | ||
result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; | ||
result += n <= m && Type(captures[n - 1]) === 'Undefined' ? '' : captures[n - 1]; | ||
i += 1; | ||
@@ -93,3 +93,3 @@ } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { | ||
// if nn === '00' or nn > m, impl-defined | ||
result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; | ||
result += nn <= m && Type(captures[nnI]) === 'Undefined' ? '' : captures[nnI]; | ||
i += 2; | ||
@@ -96,0 +96,0 @@ } else { |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerHour = timeConstants.msPerHour; | ||
module.exports = function HourFromTime(t) { | ||
return mod($floor(t / msPerHour), HoursPerDay); | ||
return modulo(floor(t / msPerHour), HoursPerDay); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
var $isNaN = require('../helpers/isNaN'); | ||
@@ -19,4 +15,4 @@ var $isFinite = require('../helpers/isFinite'); | ||
} | ||
var abs = $abs(argument); | ||
return $floor(abs) === abs; | ||
var absValue = abs(argument); | ||
return floor(absValue) === absValue; | ||
}; |
@@ -5,6 +5,4 @@ 'use strict'; | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var $DateUTC = GetIntrinsic('%Date.UTC%'); | ||
var mod = require('../helpers/mod'); | ||
var $isFinite = require('../helpers/isFinite'); | ||
@@ -14,2 +12,4 @@ | ||
var Day = require('./Day'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var MonthFromTime = require('./MonthFromTime'); | ||
@@ -28,4 +28,4 @@ var ToInteger = require('./ToInteger'); | ||
var dt = ToInteger(date); | ||
var ym = y + $floor(m / 12); | ||
var mn = mod(m, 12); | ||
var ym = y + floor(m / 12); | ||
var mn = modulo(m, 12); | ||
var t = $DateUTC(ym, mn, 1); | ||
@@ -32,0 +32,0 @@ if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerMinute = timeConstants.msPerMinute; | ||
module.exports = function MinFromTime(t) { | ||
return mod($floor(t / msPerMinute), MinutesPerHour); | ||
return modulo(floor(t / msPerMinute), MinutesPerHour); | ||
}; |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
var msPerSecond = require('../helpers/timeConstants').msPerSecond; | ||
@@ -9,3 +10,3 @@ | ||
module.exports = function msFromTime(t) { | ||
return mod(t, msPerSecond); | ||
return modulo(t, msPerSecond); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerSecond = timeConstants.msPerSecond; | ||
module.exports = function SecFromTime(t) { | ||
return mod($floor(t / msPerSecond), SecondsPerMinute); | ||
return modulo(floor(t / msPerSecond), SecondsPerMinute); | ||
}; |
@@ -7,6 +7,6 @@ 'use strict'; | ||
var $Number = GetIntrinsic('%Number%'); | ||
var $abs = GetIntrinsic('%Math.abs%'); | ||
var $isFinite = require('../helpers/isFinite'); | ||
var abs = require('./abs'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -17,3 +17,3 @@ | ||
module.exports = function TimeClip(time) { | ||
if (!$isFinite(time) || $abs(time) > 8.64e15) { | ||
if (!$isFinite(time) || abs(time) > 8.64e15) { | ||
return NaN; | ||
@@ -20,0 +20,0 @@ } |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
var msPerDay = require('../helpers/timeConstants').msPerDay; | ||
@@ -9,4 +10,4 @@ | ||
module.exports = function TimeWithinDay(t) { | ||
return mod(t, msPerDay); | ||
return modulo(t, msPerDay); | ||
}; | ||
@@ -36,3 +36,3 @@ 'use strict'; | ||
if (typeof getter !== 'undefined' && !IsCallable(getter)) { | ||
throw new TypeError('getter must be a function'); | ||
throw new $TypeError('getter must be a function'); | ||
} | ||
@@ -39,0 +39,0 @@ desc['[[Get]]'] = getter; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -12,7 +11,3 @@ | ||
var $sign = require('../helpers/sign'); | ||
var $mod = require('../helpers/mod'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 | ||
@@ -23,4 +18,4 @@ | ||
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } | ||
var posInt = $sign(number) * $floor($abs(number)); | ||
return $mod(posInt, 0x10000); | ||
var posInt = $sign(number) * floor(abs(number)); | ||
return modulo(posInt, 0x10000); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -12,12 +8,14 @@ | ||
var $sign = require('../helpers/sign'); | ||
var $mod = require('../helpers/mod'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
// https://ecma-international.org/ecma-262/6.0/#sec-touint8 | ||
module.exports = function ToUint8(argument) { | ||
var number = ToNumber(argument); | ||
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } | ||
var posInt = $sign(number) * $floor($abs(number)); | ||
return $mod(posInt, 0x100); | ||
var posInt = $sign(number) * floor(abs(number)); | ||
return modulo(posInt, 0x100); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var ToNumber = require('./ToNumber'); | ||
var floor = require('./floor'); | ||
var $isNaN = require('../helpers/isNaN'); | ||
var $floor = $Math.floor; | ||
// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp | ||
@@ -19,3 +14,3 @@ | ||
if (number >= 0xFF) { return 0xFF; } | ||
var f = $floor(argument); | ||
var f = floor(argument); | ||
if (f + 0.5 < number) { return f + 1; } | ||
@@ -22,0 +17,0 @@ if (number < f + 0.5) { return f; } |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var Day = require('./Day'); | ||
var modulo = require('./modulo'); | ||
@@ -10,3 +9,3 @@ // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 | ||
module.exports = function WeekDay(t) { | ||
return mod(Day(t) + 4, 7); | ||
return modulo(Day(t) + 4, 7); | ||
}; |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); | ||
var isLeadingSurrogate = require('../helpers/isLeadingSurrogate'); | ||
var isTrailingSurrogate = require('../helpers/isTrailingSurrogate'); | ||
@@ -36,3 +38,3 @@ var $TypeError = GetIntrinsic('%TypeError%'); | ||
var first = $charCodeAt(S, index); | ||
if (first < 0xD800 || first > 0xDBFF) { | ||
if (!isLeadingSurrogate(first)) { | ||
return index + 1; | ||
@@ -42,3 +44,3 @@ } | ||
var second = $charCodeAt(S, index + 1); | ||
if (second < 0xDC00 || second > 0xDFFF) { | ||
if (!isTrailingSurrogate(second)) { | ||
return index + 1; | ||
@@ -45,0 +47,0 @@ } |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var msPerDay = require('../helpers/timeConstants').msPerDay; | ||
@@ -12,3 +10,3 @@ | ||
module.exports = function Day(t) { | ||
return $floor(t / msPerDay); | ||
return floor(t / msPerDay); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 | ||
module.exports = function DayFromYear(y) { | ||
return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); | ||
return (365 * (y - 1970)) + floor((y - 1969) / 4) - floor((y - 1901) / 100) + floor((y - 1601) / 400); | ||
}; | ||
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
@@ -8,9 +8,9 @@ // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 | ||
module.exports = function DaysInYear(y) { | ||
if (mod(y, 4) !== 0) { | ||
if (modulo(y, 4) !== 0) { | ||
return 365; | ||
} | ||
if (mod(y, 100) !== 0) { | ||
if (modulo(y, 100) !== 0) { | ||
return 366; | ||
} | ||
if (mod(y, 400) !== 0) { | ||
if (modulo(y, 400) !== 0) { | ||
return 365; | ||
@@ -17,0 +17,0 @@ } |
@@ -85,3 +85,3 @@ | ||
// if (n > m, impl-defined) | ||
result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; | ||
result += n <= m && Type(captures[n - 1]) === 'Undefined' ? '' : captures[n - 1]; | ||
i += 1; | ||
@@ -93,3 +93,3 @@ } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { | ||
// if nn === '00' or nn > m, impl-defined | ||
result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; | ||
result += nn <= m && Type(captures[nnI]) === 'Undefined' ? '' : captures[nnI]; | ||
i += 2; | ||
@@ -96,0 +96,0 @@ } else { |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerHour = timeConstants.msPerHour; | ||
module.exports = function HourFromTime(t) { | ||
return mod($floor(t / msPerHour), HoursPerDay); | ||
return modulo(floor(t / msPerHour), HoursPerDay); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
var $isNaN = require('../helpers/isNaN'); | ||
@@ -19,4 +15,4 @@ var $isFinite = require('../helpers/isFinite'); | ||
} | ||
var abs = $abs(argument); | ||
return $floor(abs) === abs; | ||
var absValue = abs(argument); | ||
return floor(absValue) === absValue; | ||
}; |
@@ -5,6 +5,4 @@ 'use strict'; | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var $DateUTC = GetIntrinsic('%Date.UTC%'); | ||
var mod = require('../helpers/mod'); | ||
var $isFinite = require('../helpers/isFinite'); | ||
@@ -14,2 +12,4 @@ | ||
var Day = require('./Day'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var MonthFromTime = require('./MonthFromTime'); | ||
@@ -28,4 +28,4 @@ var ToInteger = require('./ToInteger'); | ||
var dt = ToInteger(date); | ||
var ym = y + $floor(m / 12); | ||
var mn = mod(m, 12); | ||
var ym = y + floor(m / 12); | ||
var mn = modulo(m, 12); | ||
var t = $DateUTC(ym, mn, 1); | ||
@@ -32,0 +32,0 @@ if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerMinute = timeConstants.msPerMinute; | ||
module.exports = function MinFromTime(t) { | ||
return mod($floor(t / msPerMinute), MinutesPerHour); | ||
return modulo(floor(t / msPerMinute), MinutesPerHour); | ||
}; |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
var msPerSecond = require('../helpers/timeConstants').msPerSecond; | ||
@@ -9,3 +10,3 @@ | ||
module.exports = function msFromTime(t) { | ||
return mod(t, msPerSecond); | ||
return modulo(t, msPerSecond); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerSecond = timeConstants.msPerSecond; | ||
module.exports = function SecFromTime(t) { | ||
return mod($floor(t / msPerSecond), SecondsPerMinute); | ||
return modulo(floor(t / msPerSecond), SecondsPerMinute); | ||
}; |
@@ -7,6 +7,6 @@ 'use strict'; | ||
var $Number = GetIntrinsic('%Number%'); | ||
var $abs = GetIntrinsic('%Math.abs%'); | ||
var $isFinite = require('../helpers/isFinite'); | ||
var abs = require('./abs'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -17,3 +17,3 @@ | ||
module.exports = function TimeClip(time) { | ||
if (!$isFinite(time) || $abs(time) > 8.64e15) { | ||
if (!$isFinite(time) || abs(time) > 8.64e15) { | ||
return NaN; | ||
@@ -20,0 +20,0 @@ } |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
var msPerDay = require('../helpers/timeConstants').msPerDay; | ||
@@ -9,4 +10,4 @@ | ||
module.exports = function TimeWithinDay(t) { | ||
return mod(t, msPerDay); | ||
return modulo(t, msPerDay); | ||
}; | ||
@@ -36,3 +36,3 @@ 'use strict'; | ||
if (typeof getter !== 'undefined' && !IsCallable(getter)) { | ||
throw new TypeError('getter must be a function'); | ||
throw new $TypeError('getter must be a function'); | ||
} | ||
@@ -39,0 +39,0 @@ desc['[[Get]]'] = getter; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -12,7 +11,3 @@ | ||
var $sign = require('../helpers/sign'); | ||
var $mod = require('../helpers/mod'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 | ||
@@ -23,4 +18,4 @@ | ||
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } | ||
var posInt = $sign(number) * $floor($abs(number)); | ||
return $mod(posInt, 0x10000); | ||
var posInt = $sign(number) * floor(abs(number)); | ||
return modulo(posInt, 0x10000); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -12,12 +8,14 @@ | ||
var $sign = require('../helpers/sign'); | ||
var $mod = require('../helpers/mod'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
// https://ecma-international.org/ecma-262/6.0/#sec-touint8 | ||
module.exports = function ToUint8(argument) { | ||
var number = ToNumber(argument); | ||
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } | ||
var posInt = $sign(number) * $floor($abs(number)); | ||
return $mod(posInt, 0x100); | ||
var posInt = $sign(number) * floor(abs(number)); | ||
return modulo(posInt, 0x100); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var ToNumber = require('./ToNumber'); | ||
var floor = require('./floor'); | ||
var $isNaN = require('../helpers/isNaN'); | ||
var $floor = $Math.floor; | ||
// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp | ||
@@ -19,3 +14,3 @@ | ||
if (number >= 0xFF) { return 0xFF; } | ||
var f = $floor(argument); | ||
var f = floor(argument); | ||
if (f + 0.5 < number) { return f + 1; } | ||
@@ -22,0 +17,0 @@ if (number < f + 0.5) { return f; } |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var Day = require('./Day'); | ||
var modulo = require('./modulo'); | ||
@@ -10,3 +9,3 @@ // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 | ||
module.exports = function WeekDay(t) { | ||
return mod(Day(t) + 4, 7); | ||
return modulo(Day(t) + 4, 7); | ||
}; |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); | ||
var isLeadingSurrogate = require('../helpers/isLeadingSurrogate'); | ||
var isTrailingSurrogate = require('../helpers/isTrailingSurrogate'); | ||
@@ -36,3 +38,3 @@ var $TypeError = GetIntrinsic('%TypeError%'); | ||
var first = $charCodeAt(S, index); | ||
if (first < 0xD800 || first > 0xDBFF) { | ||
if (!isLeadingSurrogate(first)) { | ||
return index + 1; | ||
@@ -42,3 +44,3 @@ } | ||
var second = $charCodeAt(S, index + 1); | ||
if (second < 0xDC00 || second > 0xDFFF) { | ||
if (!isTrailingSurrogate(second)) { | ||
return index + 1; | ||
@@ -45,0 +47,0 @@ } |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $TypeError = GetIntrinsic('%TypeError%'); | ||
var callBound = require('../helpers/callBound'); | ||
@@ -23,11 +27,11 @@ var forEach = require('../helpers/forEach'); | ||
if (Type(target) !== 'Object') { | ||
throw new TypeError('Assertion failed: "target" must be an Object'); | ||
throw new $TypeError('Assertion failed: "target" must be an Object'); | ||
} | ||
if (!IsArray(excludedItems)) { | ||
throw new TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); | ||
throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); | ||
} | ||
for (var i = 0; i < excludedItems.length; i += 1) { | ||
if (!IsPropertyKey(excludedItems[i])) { | ||
throw new TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); | ||
throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); | ||
} | ||
@@ -34,0 +38,0 @@ } |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var msPerDay = require('../helpers/timeConstants').msPerDay; | ||
@@ -12,3 +10,3 @@ | ||
module.exports = function Day(t) { | ||
return $floor(t / msPerDay); | ||
return floor(t / msPerDay); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 | ||
module.exports = function DayFromYear(y) { | ||
return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); | ||
return (365 * (y - 1970)) + floor((y - 1969) / 4) - floor((y - 1901) / 100) + floor((y - 1601) / 400); | ||
}; | ||
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
@@ -8,9 +8,9 @@ // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 | ||
module.exports = function DaysInYear(y) { | ||
if (mod(y, 4) !== 0) { | ||
if (modulo(y, 4) !== 0) { | ||
return 365; | ||
} | ||
if (mod(y, 100) !== 0) { | ||
if (modulo(y, 100) !== 0) { | ||
return 366; | ||
} | ||
if (mod(y, 400) !== 0) { | ||
if (modulo(y, 400) !== 0) { | ||
return 365; | ||
@@ -17,0 +17,0 @@ } |
@@ -91,3 +91,3 @@ 'use strict'; | ||
// if (n > m, impl-defined) | ||
result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; | ||
result += n <= m && Type(captures[n - 1]) === 'Undefined' ? '' : captures[n - 1]; | ||
i += 1; | ||
@@ -99,3 +99,3 @@ } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { | ||
// if nn === '00' or nn > m, impl-defined | ||
result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; | ||
result += nn <= m && Type(captures[nnI]) === 'Undefined' ? '' : captures[nnI]; | ||
i += 2; | ||
@@ -102,0 +102,0 @@ } else if (next === '<') { |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerHour = timeConstants.msPerHour; | ||
module.exports = function HourFromTime(t) { | ||
return mod($floor(t / msPerHour), HoursPerDay); | ||
return modulo(floor(t / msPerHour), HoursPerDay); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
var $isNaN = require('../helpers/isNaN'); | ||
@@ -19,4 +15,4 @@ var $isFinite = require('../helpers/isFinite'); | ||
} | ||
var abs = $abs(argument); | ||
return $floor(abs) === abs; | ||
var absValue = abs(argument); | ||
return floor(absValue) === absValue; | ||
}; |
@@ -5,6 +5,4 @@ 'use strict'; | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var $DateUTC = GetIntrinsic('%Date.UTC%'); | ||
var mod = require('../helpers/mod'); | ||
var $isFinite = require('../helpers/isFinite'); | ||
@@ -14,2 +12,4 @@ | ||
var Day = require('./Day'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var MonthFromTime = require('./MonthFromTime'); | ||
@@ -28,4 +28,4 @@ var ToInteger = require('./ToInteger'); | ||
var dt = ToInteger(date); | ||
var ym = y + $floor(m / 12); | ||
var mn = mod(m, 12); | ||
var ym = y + floor(m / 12); | ||
var mn = modulo(m, 12); | ||
var t = $DateUTC(ym, mn, 1); | ||
@@ -32,0 +32,0 @@ if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerMinute = timeConstants.msPerMinute; | ||
module.exports = function MinFromTime(t) { | ||
return mod($floor(t / msPerMinute), MinutesPerHour); | ||
return modulo(floor(t / msPerMinute), MinutesPerHour); | ||
}; |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
var msPerSecond = require('../helpers/timeConstants').msPerSecond; | ||
@@ -9,3 +10,3 @@ | ||
module.exports = function msFromTime(t) { | ||
return mod(t, msPerSecond); | ||
return modulo(t, msPerSecond); | ||
}; |
@@ -6,2 +6,3 @@ 'use strict'; | ||
var $String = GetIntrinsic('%String%'); | ||
var $TypeError = GetIntrinsic('%TypeError%'); | ||
@@ -14,3 +15,3 @@ var Type = require('./Type'); | ||
if (Type(m) !== 'Number') { | ||
throw new TypeError('Assertion failed: "m" must be a String'); | ||
throw new $TypeError('Assertion failed: "m" must be a String'); | ||
} | ||
@@ -17,0 +18,0 @@ |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerSecond = timeConstants.msPerSecond; | ||
module.exports = function SecFromTime(t) { | ||
return mod($floor(t / msPerSecond), SecondsPerMinute); | ||
return modulo(floor(t / msPerSecond), SecondsPerMinute); | ||
}; |
@@ -7,6 +7,6 @@ 'use strict'; | ||
var $Number = GetIntrinsic('%Number%'); | ||
var $abs = GetIntrinsic('%Math.abs%'); | ||
var $isFinite = require('../helpers/isFinite'); | ||
var abs = require('./abs'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -17,3 +17,3 @@ | ||
module.exports = function TimeClip(time) { | ||
if (!$isFinite(time) || $abs(time) > 8.64e15) { | ||
if (!$isFinite(time) || abs(time) > 8.64e15) { | ||
return NaN; | ||
@@ -20,0 +20,0 @@ } |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
var msPerDay = require('../helpers/timeConstants').msPerDay; | ||
@@ -9,4 +10,4 @@ | ||
module.exports = function TimeWithinDay(t) { | ||
return mod(t, msPerDay); | ||
return modulo(t, msPerDay); | ||
}; | ||
@@ -36,3 +36,3 @@ 'use strict'; | ||
if (typeof getter !== 'undefined' && !IsCallable(getter)) { | ||
throw new TypeError('getter must be a function'); | ||
throw new $TypeError('getter must be a function'); | ||
} | ||
@@ -39,0 +39,0 @@ desc['[[Get]]'] = getter; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -12,7 +11,3 @@ | ||
var $sign = require('../helpers/sign'); | ||
var $mod = require('../helpers/mod'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 | ||
@@ -23,4 +18,4 @@ | ||
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } | ||
var posInt = $sign(number) * $floor($abs(number)); | ||
return $mod(posInt, 0x10000); | ||
var posInt = $sign(number) * floor(abs(number)); | ||
return modulo(posInt, 0x10000); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -12,12 +8,14 @@ | ||
var $sign = require('../helpers/sign'); | ||
var $mod = require('../helpers/mod'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
// https://ecma-international.org/ecma-262/6.0/#sec-touint8 | ||
module.exports = function ToUint8(argument) { | ||
var number = ToNumber(argument); | ||
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } | ||
var posInt = $sign(number) * $floor($abs(number)); | ||
return $mod(posInt, 0x100); | ||
var posInt = $sign(number) * floor(abs(number)); | ||
return modulo(posInt, 0x100); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var ToNumber = require('./ToNumber'); | ||
var floor = require('./floor'); | ||
var $isNaN = require('../helpers/isNaN'); | ||
var $floor = $Math.floor; | ||
// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp | ||
@@ -19,3 +14,3 @@ | ||
if (number >= 0xFF) { return 0xFF; } | ||
var f = $floor(argument); | ||
var f = floor(argument); | ||
if (f + 0.5 < number) { return f + 1; } | ||
@@ -22,0 +17,0 @@ if (number < f + 0.5) { return f; } |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var Day = require('./Day'); | ||
var modulo = require('./modulo'); | ||
@@ -10,3 +9,3 @@ // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 | ||
module.exports = function WeekDay(t) { | ||
return mod(Day(t) + 4, 7); | ||
return modulo(Day(t) + 4, 7); | ||
}; |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); | ||
var isLeadingSurrogate = require('../helpers/isLeadingSurrogate'); | ||
var isTrailingSurrogate = require('../helpers/isTrailingSurrogate'); | ||
@@ -36,3 +38,3 @@ var $TypeError = GetIntrinsic('%TypeError%'); | ||
var first = $charCodeAt(S, index); | ||
if (first < 0xD800 || first > 0xDBFF) { | ||
if (!isLeadingSurrogate(first)) { | ||
return index + 1; | ||
@@ -42,3 +44,3 @@ } | ||
var second = $charCodeAt(S, index + 1); | ||
if (second < 0xDC00 || second > 0xDFFF) { | ||
if (!isTrailingSurrogate(second)) { | ||
return index + 1; | ||
@@ -45,0 +47,0 @@ } |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $TypeError = GetIntrinsic('%TypeError%'); | ||
var callBound = require('../helpers/callBound'); | ||
@@ -23,11 +27,11 @@ var forEach = require('../helpers/forEach'); | ||
if (Type(target) !== 'Object') { | ||
throw new TypeError('Assertion failed: "target" must be an Object'); | ||
throw new $TypeError('Assertion failed: "target" must be an Object'); | ||
} | ||
if (!IsArray(excludedItems)) { | ||
throw new TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); | ||
throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); | ||
} | ||
for (var i = 0; i < excludedItems.length; i += 1) { | ||
if (!IsPropertyKey(excludedItems[i])) { | ||
throw new TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); | ||
throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); | ||
} | ||
@@ -34,0 +38,0 @@ } |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var msPerDay = require('../helpers/timeConstants').msPerDay; | ||
@@ -12,3 +10,3 @@ | ||
module.exports = function Day(t) { | ||
return $floor(t / msPerDay); | ||
return floor(t / msPerDay); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 | ||
module.exports = function DayFromYear(y) { | ||
return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); | ||
return (365 * (y - 1970)) + floor((y - 1969) / 4) - floor((y - 1901) / 100) + floor((y - 1601) / 400); | ||
}; | ||
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
@@ -8,9 +8,9 @@ // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 | ||
module.exports = function DaysInYear(y) { | ||
if (mod(y, 4) !== 0) { | ||
if (modulo(y, 4) !== 0) { | ||
return 365; | ||
} | ||
if (mod(y, 100) !== 0) { | ||
if (modulo(y, 100) !== 0) { | ||
return 366; | ||
} | ||
if (mod(y, 400) !== 0) { | ||
if (modulo(y, 400) !== 0) { | ||
return 365; | ||
@@ -17,0 +17,0 @@ } |
@@ -19,3 +19,3 @@ 'use strict'; | ||
// eslint-disable-next-line max-params, max-statements | ||
// eslint-disable-next-line max-params | ||
module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) { | ||
@@ -22,0 +22,0 @@ var mapperFunction; |
@@ -91,3 +91,3 @@ 'use strict'; | ||
// if (n > m, impl-defined) | ||
result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; | ||
result += n <= m && Type(captures[n - 1]) === 'Undefined' ? '' : captures[n - 1]; | ||
i += 1; | ||
@@ -99,3 +99,3 @@ } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { | ||
// if nn === '00' or nn > m, impl-defined | ||
result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; | ||
result += nn <= m && Type(captures[nnI]) === 'Undefined' ? '' : captures[nnI]; | ||
i += 2; | ||
@@ -102,0 +102,0 @@ } else if (next === '<') { |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerHour = timeConstants.msPerHour; | ||
module.exports = function HourFromTime(t) { | ||
return mod($floor(t / msPerHour), HoursPerDay); | ||
return modulo(floor(t / msPerHour), HoursPerDay); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
var $isNaN = require('../helpers/isNaN'); | ||
@@ -19,4 +15,4 @@ var $isFinite = require('../helpers/isFinite'); | ||
} | ||
var abs = $abs(argument); | ||
return $floor(abs) === abs; | ||
var absValue = abs(argument); | ||
return floor(absValue) === absValue; | ||
}; |
@@ -5,6 +5,4 @@ 'use strict'; | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var $DateUTC = GetIntrinsic('%Date.UTC%'); | ||
var mod = require('../helpers/mod'); | ||
var $isFinite = require('../helpers/isFinite'); | ||
@@ -14,2 +12,4 @@ | ||
var Day = require('./Day'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var MonthFromTime = require('./MonthFromTime'); | ||
@@ -28,4 +28,4 @@ var ToInteger = require('./ToInteger'); | ||
var dt = ToInteger(date); | ||
var ym = y + $floor(m / 12); | ||
var mn = mod(m, 12); | ||
var ym = y + floor(m / 12); | ||
var mn = modulo(m, 12); | ||
var t = $DateUTC(ym, mn, 1); | ||
@@ -32,0 +32,0 @@ if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerMinute = timeConstants.msPerMinute; | ||
module.exports = function MinFromTime(t) { | ||
return mod($floor(t / msPerMinute), MinutesPerHour); | ||
return modulo(floor(t / msPerMinute), MinutesPerHour); | ||
}; |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
var msPerSecond = require('../helpers/timeConstants').msPerSecond; | ||
@@ -9,3 +10,3 @@ | ||
module.exports = function msFromTime(t) { | ||
return mod(t, msPerSecond); | ||
return modulo(t, msPerSecond); | ||
}; |
@@ -6,2 +6,3 @@ 'use strict'; | ||
var $String = GetIntrinsic('%String%'); | ||
var $TypeError = GetIntrinsic('%TypeError%'); | ||
@@ -14,3 +15,3 @@ var Type = require('./Type'); | ||
if (Type(m) !== 'Number') { | ||
throw new TypeError('Assertion failed: "m" must be a String'); | ||
throw new $TypeError('Assertion failed: "m" must be a String'); | ||
} | ||
@@ -17,0 +18,0 @@ |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerSecond = timeConstants.msPerSecond; | ||
module.exports = function SecFromTime(t) { | ||
return mod($floor(t / msPerSecond), SecondsPerMinute); | ||
return modulo(floor(t / msPerSecond), SecondsPerMinute); | ||
}; |
@@ -7,6 +7,6 @@ 'use strict'; | ||
var $Number = GetIntrinsic('%Number%'); | ||
var $abs = GetIntrinsic('%Math.abs%'); | ||
var $isFinite = require('../helpers/isFinite'); | ||
var abs = require('./abs'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -17,3 +17,3 @@ | ||
module.exports = function TimeClip(time) { | ||
if (!$isFinite(time) || $abs(time) > 8.64e15) { | ||
if (!$isFinite(time) || abs(time) > 8.64e15) { | ||
return NaN; | ||
@@ -20,0 +20,0 @@ } |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
var msPerDay = require('../helpers/timeConstants').msPerDay; | ||
@@ -9,4 +10,4 @@ | ||
module.exports = function TimeWithinDay(t) { | ||
return mod(t, msPerDay); | ||
return modulo(t, msPerDay); | ||
}; | ||
@@ -36,3 +36,3 @@ 'use strict'; | ||
if (typeof getter !== 'undefined' && !IsCallable(getter)) { | ||
throw new TypeError('getter must be a function'); | ||
throw new $TypeError('getter must be a function'); | ||
} | ||
@@ -39,0 +39,0 @@ desc['[[Get]]'] = getter; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -12,7 +11,3 @@ | ||
var $sign = require('../helpers/sign'); | ||
var $mod = require('../helpers/mod'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 | ||
@@ -23,4 +18,4 @@ | ||
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } | ||
var posInt = $sign(number) * $floor($abs(number)); | ||
return $mod(posInt, 0x10000); | ||
var posInt = $sign(number) * floor(abs(number)); | ||
return modulo(posInt, 0x10000); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -12,12 +8,14 @@ | ||
var $sign = require('../helpers/sign'); | ||
var $mod = require('../helpers/mod'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
// https://ecma-international.org/ecma-262/6.0/#sec-touint8 | ||
module.exports = function ToUint8(argument) { | ||
var number = ToNumber(argument); | ||
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } | ||
var posInt = $sign(number) * $floor($abs(number)); | ||
return $mod(posInt, 0x100); | ||
var posInt = $sign(number) * floor(abs(number)); | ||
return modulo(posInt, 0x100); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var ToNumber = require('./ToNumber'); | ||
var floor = require('./floor'); | ||
var $isNaN = require('../helpers/isNaN'); | ||
var $floor = $Math.floor; | ||
// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp | ||
@@ -19,3 +14,3 @@ | ||
if (number >= 0xFF) { return 0xFF; } | ||
var f = $floor(argument); | ||
var f = floor(argument); | ||
if (f + 0.5 < number) { return f + 1; } | ||
@@ -22,0 +17,0 @@ if (number < f + 0.5) { return f; } |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var Day = require('./Day'); | ||
var modulo = require('./modulo'); | ||
@@ -10,3 +9,3 @@ // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 | ||
module.exports = function WeekDay(t) { | ||
return mod(Day(t) + 4, 7); | ||
return modulo(Day(t) + 4, 7); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var msPerDay = require('../helpers/timeConstants').msPerDay; | ||
@@ -12,3 +10,3 @@ | ||
module.exports = function Day(t) { | ||
return $floor(t / msPerDay); | ||
return floor(t / msPerDay); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 | ||
module.exports = function DayFromYear(y) { | ||
return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); | ||
return (365 * (y - 1970)) + floor((y - 1969) / 4) - floor((y - 1901) / 100) + floor((y - 1601) / 400); | ||
}; | ||
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
@@ -8,9 +8,9 @@ // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 | ||
module.exports = function DaysInYear(y) { | ||
if (mod(y, 4) !== 0) { | ||
if (modulo(y, 4) !== 0) { | ||
return 365; | ||
} | ||
if (mod(y, 100) !== 0) { | ||
if (modulo(y, 100) !== 0) { | ||
return 366; | ||
} | ||
if (mod(y, 400) !== 0) { | ||
if (modulo(y, 400) !== 0) { | ||
return 365; | ||
@@ -17,0 +17,0 @@ } |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerHour = timeConstants.msPerHour; | ||
module.exports = function HourFromTime(t) { | ||
return mod($floor(t / msPerHour), HoursPerDay); | ||
return modulo(floor(t / msPerHour), HoursPerDay); | ||
}; |
@@ -5,6 +5,4 @@ 'use strict'; | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var $DateUTC = GetIntrinsic('%Date.UTC%'); | ||
var mod = require('../helpers/mod'); | ||
var $isFinite = require('../helpers/isFinite'); | ||
@@ -14,2 +12,4 @@ | ||
var Day = require('./Day'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var MonthFromTime = require('./MonthFromTime'); | ||
@@ -28,4 +28,4 @@ var ToInteger = require('./ToInteger'); | ||
var dt = ToInteger(date); | ||
var ym = y + $floor(m / 12); | ||
var mn = mod(m, 12); | ||
var ym = y + floor(m / 12); | ||
var mn = modulo(m, 12); | ||
var t = $DateUTC(ym, mn, 1); | ||
@@ -32,0 +32,0 @@ if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerMinute = timeConstants.msPerMinute; | ||
module.exports = function MinFromTime(t) { | ||
return mod($floor(t / msPerMinute), MinutesPerHour); | ||
return modulo(floor(t / msPerMinute), MinutesPerHour); | ||
}; |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
var msPerSecond = require('../helpers/timeConstants').msPerSecond; | ||
@@ -9,3 +10,3 @@ | ||
module.exports = function msFromTime(t) { | ||
return mod(t, msPerSecond); | ||
return modulo(t, msPerSecond); | ||
}; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var $floor = GetIntrinsic('%Math.floor%'); | ||
var mod = require('../helpers/mod'); | ||
var timeConstants = require('../helpers/timeConstants'); | ||
@@ -15,3 +13,3 @@ var msPerSecond = timeConstants.msPerSecond; | ||
module.exports = function SecFromTime(t) { | ||
return mod($floor(t / msPerSecond), SecondsPerMinute); | ||
return modulo(floor(t / msPerSecond), SecondsPerMinute); | ||
}; |
@@ -7,6 +7,6 @@ 'use strict'; | ||
var $Number = GetIntrinsic('%Number%'); | ||
var $abs = GetIntrinsic('%Math.abs%'); | ||
var $isFinite = require('../helpers/isFinite'); | ||
var abs = require('./abs'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -17,3 +17,3 @@ | ||
module.exports = function TimeClip(time) { | ||
if (!$isFinite(time) || $abs(time) > 8.64e15) { | ||
if (!$isFinite(time) || abs(time) > 8.64e15) { | ||
return NaN; | ||
@@ -20,0 +20,0 @@ } |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var modulo = require('./modulo'); | ||
var msPerDay = require('../helpers/timeConstants').msPerDay; | ||
@@ -9,4 +10,4 @@ | ||
module.exports = function TimeWithinDay(t) { | ||
return mod(t, msPerDay); | ||
return modulo(t, msPerDay); | ||
}; | ||
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var ToNumber = require('./ToNumber'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var ToNumber = require('./ToNumber'); | ||
var $isNaN = require('../helpers/isNaN'); | ||
@@ -12,5 +11,2 @@ var $isFinite = require('../helpers/isFinite'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.4 | ||
@@ -22,3 +18,3 @@ | ||
if (number === 0 || !$isFinite(number)) { return number; } | ||
return $sign(number) * $floor($abs(number)); | ||
return $sign(number) * floor(abs(number)); | ||
}; |
@@ -36,3 +36,3 @@ 'use strict'; | ||
if (typeof getter !== 'undefined' && !IsCallable(getter)) { | ||
throw new TypeError('getter must be a function'); | ||
throw new $TypeError('getter must be a function'); | ||
} | ||
@@ -39,0 +39,0 @@ desc['[[Get]]'] = getter; |
'use strict'; | ||
var GetIntrinsic = require('../GetIntrinsic'); | ||
var $Math = GetIntrinsic('%Math%'); | ||
var abs = require('./abs'); | ||
var floor = require('./floor'); | ||
var modulo = require('./modulo'); | ||
var ToNumber = require('./ToNumber'); | ||
@@ -12,7 +11,3 @@ | ||
var $sign = require('../helpers/sign'); | ||
var $mod = require('../helpers/mod'); | ||
var $floor = $Math.floor; | ||
var $abs = $Math.abs; | ||
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 | ||
@@ -23,4 +18,4 @@ | ||
if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } | ||
var posInt = $sign(number) * $floor($abs(number)); | ||
return $mod(posInt, 0x10000); | ||
var posInt = $sign(number) * floor(abs(number)); | ||
return modulo(posInt, 0x10000); | ||
}; |
'use strict'; | ||
var mod = require('../helpers/mod'); | ||
var Day = require('./Day'); | ||
var modulo = require('./modulo'); | ||
@@ -10,3 +9,3 @@ // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 | ||
module.exports = function WeekDay(t) { | ||
return mod(Day(t) + 4, 7); | ||
return modulo(Day(t) + 4, 7); | ||
}; |
@@ -0,1 +1,18 @@ | ||
1.18.0-next.0 / 2020-08-14 | ||
================= | ||
* [New] add `ES2020` | ||
* [New] `GetIntrinsic`: add `%AggregateError%`, `%FinalizationRegistry%`, and `%WeakRef%` | ||
* [New] `ES5`+: add `abs`, `floor`; use `modulo` consistently | ||
* [New] `GetIntrinsic`: Cache accessed intrinsics (#98) | ||
* [New] `GetIntrinsic`: Add ES201x function intrinsics (#97) | ||
* [New] `ES2015`+: add `QuoteJSONString`, `OrdinaryCreateFromConstructor` | ||
* [New] `ES2017`+: add `StringGetOwnProperty` | ||
* [New] `ES2016`+: add `UTF16Encoding` | ||
* [New] `ES2018`+: add `SetFunctionLength`, `UnicodeEscape` | ||
* [New] add `isLeadingSurrogate`/`isTrailingSurrogate` helpers | ||
* [Fix] `ES5`+: `ToPropertyDescriptor`: use intrinsic TypeError | ||
* [Fix] `ES2018+`: `CopyDataProperties`/`NumberToString`: use intrinsic TypeError | ||
* [Deps] update `is-regex`, `object-inspect` | ||
* [Dev Deps] update `eslint` | ||
1.17.6 / 2020-06-13 | ||
@@ -2,0 +19,0 @@ ================= |
@@ -9,2 +9,3 @@ 'use strict'; | ||
'Strict Equality Comparison': require('./2015/StrictEqualityComparison'), | ||
abs: require('./2015/abs'), | ||
AdvanceStringIndex: require('./2015/AdvanceStringIndex'), | ||
@@ -31,2 +32,3 @@ ArrayCreate: require('./2015/ArrayCreate'), | ||
EnumerableOwnNames: require('./2015/EnumerableOwnNames'), | ||
floor: require('./2015/floor'), | ||
FromPropertyDescriptor: require('./2015/FromPropertyDescriptor'), | ||
@@ -72,2 +74,3 @@ Get: require('./2015/Get'), | ||
ObjectCreate: require('./2015/ObjectCreate'), | ||
OrdinaryCreateFromConstructor: require('./2015/OrdinaryCreateFromConstructor'), | ||
OrdinaryDefineOwnProperty: require('./2015/OrdinaryDefineOwnProperty'), | ||
@@ -77,2 +80,3 @@ OrdinaryGetOwnProperty: require('./2015/OrdinaryGetOwnProperty'), | ||
OrdinaryHasProperty: require('./2015/OrdinaryHasProperty'), | ||
QuoteJSONString: require('./2015/QuoteJSONString'), | ||
RegExpExec: require('./2015/RegExpExec'), | ||
@@ -79,0 +83,0 @@ RequireObjectCoercible: require('./2015/RequireObjectCoercible'), |
@@ -9,2 +9,3 @@ 'use strict'; | ||
'Strict Equality Comparison': require('./2016/StrictEqualityComparison'), | ||
abs: require('./2016/abs'), | ||
AdvanceStringIndex: require('./2016/AdvanceStringIndex'), | ||
@@ -31,2 +32,3 @@ ArrayCreate: require('./2016/ArrayCreate'), | ||
EnumerableOwnNames: require('./2016/EnumerableOwnNames'), | ||
floor: require('./2016/floor'), | ||
FromPropertyDescriptor: require('./2016/FromPropertyDescriptor'), | ||
@@ -73,8 +75,10 @@ Get: require('./2016/Get'), | ||
ObjectCreate: require('./2016/ObjectCreate'), | ||
OrdinaryCreateFromConstructor: require('./2016/OrdinaryCreateFromConstructor'), | ||
OrdinaryDefineOwnProperty: require('./2016/OrdinaryDefineOwnProperty'), | ||
OrdinaryGetOwnProperty: require('./2016/OrdinaryGetOwnProperty'), | ||
OrdinaryGetPrototypeOf: require('./2016/OrdinaryGetPrototypeOf'), | ||
OrdinarySetPrototypeOf: require('./2016/OrdinarySetPrototypeOf'), | ||
OrdinaryHasInstance: require('./2016/OrdinaryHasInstance'), | ||
OrdinaryHasProperty: require('./2016/OrdinaryHasProperty'), | ||
OrdinarySetPrototypeOf: require('./2016/OrdinarySetPrototypeOf'), | ||
QuoteJSONString: require('./2016/QuoteJSONString'), | ||
RegExpExec: require('./2016/RegExpExec'), | ||
@@ -117,2 +121,3 @@ RequireObjectCoercible: require('./2016/RequireObjectCoercible'), | ||
Type: require('./2016/Type'), | ||
UTF16Encoding: require('./2016/UTF16Encoding'), | ||
ValidateAndApplyPropertyDescriptor: require('./2016/ValidateAndApplyPropertyDescriptor'), | ||
@@ -119,0 +124,0 @@ WeekDay: require('./2016/WeekDay'), |
@@ -9,2 +9,3 @@ 'use strict'; | ||
'Strict Equality Comparison': require('./2017/StrictEqualityComparison'), | ||
abs: require('./2017/abs'), | ||
AdvanceStringIndex: require('./2017/AdvanceStringIndex'), | ||
@@ -31,2 +32,3 @@ ArrayCreate: require('./2017/ArrayCreate'), | ||
EnumerableOwnProperties: require('./2017/EnumerableOwnProperties'), | ||
floor: require('./2017/floor'), | ||
FromPropertyDescriptor: require('./2017/FromPropertyDescriptor'), | ||
@@ -73,8 +75,10 @@ Get: require('./2017/Get'), | ||
ObjectCreate: require('./2017/ObjectCreate'), | ||
OrdinaryCreateFromConstructor: require('./2017/OrdinaryCreateFromConstructor'), | ||
OrdinaryDefineOwnProperty: require('./2017/OrdinaryDefineOwnProperty'), | ||
OrdinaryGetOwnProperty: require('./2017/OrdinaryGetOwnProperty'), | ||
OrdinarySetPrototypeOf: require('./2017/OrdinarySetPrototypeOf'), | ||
OrdinaryGetPrototypeOf: require('./2017/OrdinaryGetPrototypeOf'), | ||
OrdinaryHasInstance: require('./2017/OrdinaryHasInstance'), | ||
OrdinaryHasProperty: require('./2017/OrdinaryHasProperty'), | ||
OrdinarySetPrototypeOf: require('./2017/OrdinarySetPrototypeOf'), | ||
QuoteJSONString: require('./2017/QuoteJSONString'), | ||
RegExpExec: require('./2017/RegExpExec'), | ||
@@ -90,2 +94,3 @@ RequireObjectCoercible: require('./2017/RequireObjectCoercible'), | ||
SpeciesConstructor: require('./2017/SpeciesConstructor'), | ||
StringGetOwnProperty: require('./2017/StringGetOwnProperty'), | ||
SymbolDescriptiveString: require('./2017/SymbolDescriptiveString'), | ||
@@ -119,2 +124,3 @@ TestIntegrityLevel: require('./2017/TestIntegrityLevel'), | ||
Type: require('./2017/Type'), | ||
UTF16Encoding: require('./2017/UTF16Encoding'), | ||
ValidateAndApplyPropertyDescriptor: require('./2017/ValidateAndApplyPropertyDescriptor'), | ||
@@ -121,0 +127,0 @@ WeekDay: require('./2017/WeekDay'), |
@@ -9,2 +9,3 @@ 'use strict'; | ||
'Strict Equality Comparison': require('./2018/StrictEqualityComparison'), | ||
abs: require('./2018/abs'), | ||
AdvanceStringIndex: require('./2018/AdvanceStringIndex'), | ||
@@ -33,2 +34,3 @@ ArrayCreate: require('./2018/ArrayCreate'), | ||
EnumerableOwnPropertyNames: require('./2018/EnumerableOwnPropertyNames'), | ||
floor: require('./2018/floor'), | ||
FromPropertyDescriptor: require('./2018/FromPropertyDescriptor'), | ||
@@ -76,9 +78,11 @@ Get: require('./2018/Get'), | ||
ObjectCreate: require('./2018/ObjectCreate'), | ||
OrdinaryCreateFromConstructor: require('./2018/OrdinaryCreateFromConstructor'), | ||
OrdinaryDefineOwnProperty: require('./2018/OrdinaryDefineOwnProperty'), | ||
OrdinaryGetOwnProperty: require('./2018/OrdinaryGetOwnProperty'), | ||
OrdinaryGetPrototypeOf: require('./2018/OrdinaryGetPrototypeOf'), | ||
OrdinarySetPrototypeOf: require('./2018/OrdinarySetPrototypeOf'), | ||
OrdinaryHasInstance: require('./2018/OrdinaryHasInstance'), | ||
OrdinaryHasProperty: require('./2018/OrdinaryHasProperty'), | ||
OrdinarySetPrototypeOf: require('./2018/OrdinarySetPrototypeOf'), | ||
PromiseResolve: require('./2018/PromiseResolve'), | ||
QuoteJSONString: require('./2018/QuoteJSONString'), | ||
RegExpExec: require('./2018/RegExpExec'), | ||
@@ -91,5 +95,7 @@ RequireObjectCoercible: require('./2018/RequireObjectCoercible'), | ||
Set: require('./2018/Set'), | ||
SetFunctionLength: require('./2018/SetFunctionLength'), | ||
SetFunctionName: require('./2018/SetFunctionName'), | ||
SetIntegrityLevel: require('./2018/SetIntegrityLevel'), | ||
SpeciesConstructor: require('./2018/SpeciesConstructor'), | ||
StringGetOwnProperty: require('./2018/StringGetOwnProperty'), | ||
SymbolDescriptiveString: require('./2018/SymbolDescriptiveString'), | ||
@@ -125,2 +131,4 @@ TestIntegrityLevel: require('./2018/TestIntegrityLevel'), | ||
Type: require('./2018/Type'), | ||
UnicodeEscape: require('./2018/UnicodeEscape'), | ||
UTF16Encoding: require('./2018/UTF16Encoding'), | ||
ValidateAndApplyPropertyDescriptor: require('./2018/ValidateAndApplyPropertyDescriptor'), | ||
@@ -127,0 +135,0 @@ WeekDay: require('./2018/WeekDay'), |
@@ -9,2 +9,3 @@ 'use strict'; | ||
'Strict Equality Comparison': require('./2019/StrictEqualityComparison'), | ||
abs: require('./2019/abs'), | ||
AddEntriesFromIterable: require('./2019/AddEntriesFromIterable'), | ||
@@ -35,2 +36,3 @@ AdvanceStringIndex: require('./2019/AdvanceStringIndex'), | ||
FlattenIntoArray: require('./2019/FlattenIntoArray'), | ||
floor: require('./2019/floor'), | ||
FromPropertyDescriptor: require('./2019/FromPropertyDescriptor'), | ||
@@ -78,9 +80,11 @@ Get: require('./2019/Get'), | ||
ObjectCreate: require('./2019/ObjectCreate'), | ||
OrdinaryCreateFromConstructor: require('./2019/OrdinaryCreateFromConstructor'), | ||
OrdinaryDefineOwnProperty: require('./2019/OrdinaryDefineOwnProperty'), | ||
OrdinaryGetOwnProperty: require('./2019/OrdinaryGetOwnProperty'), | ||
OrdinaryGetPrototypeOf: require('./2019/OrdinaryGetPrototypeOf'), | ||
OrdinarySetPrototypeOf: require('./2019/OrdinarySetPrototypeOf'), | ||
OrdinaryHasInstance: require('./2019/OrdinaryHasInstance'), | ||
OrdinaryHasProperty: require('./2019/OrdinaryHasProperty'), | ||
OrdinarySetPrototypeOf: require('./2019/OrdinarySetPrototypeOf'), | ||
PromiseResolve: require('./2019/PromiseResolve'), | ||
QuoteJSONString: require('./2019/QuoteJSONString'), | ||
RegExpExec: require('./2019/RegExpExec'), | ||
@@ -93,5 +97,7 @@ RequireObjectCoercible: require('./2019/RequireObjectCoercible'), | ||
Set: require('./2019/Set'), | ||
SetFunctionLength: require('./2019/SetFunctionLength'), | ||
SetFunctionName: require('./2019/SetFunctionName'), | ||
SetIntegrityLevel: require('./2019/SetIntegrityLevel'), | ||
SpeciesConstructor: require('./2019/SpeciesConstructor'), | ||
StringGetOwnProperty: require('./2019/StringGetOwnProperty'), | ||
SymbolDescriptiveString: require('./2019/SymbolDescriptiveString'), | ||
@@ -128,2 +134,4 @@ TestIntegrityLevel: require('./2019/TestIntegrityLevel'), | ||
Type: require('./2019/Type'), | ||
UnicodeEscape: require('./2019/UnicodeEscape'), | ||
UTF16Encoding: require('./2019/UTF16Encoding'), | ||
ValidateAndApplyPropertyDescriptor: require('./2019/ValidateAndApplyPropertyDescriptor'), | ||
@@ -130,0 +138,0 @@ WeekDay: require('./2019/WeekDay'), |
@@ -10,2 +10,3 @@ 'use strict'; | ||
'Strict Equality Comparison': require('./5/StrictEqualityComparison'), | ||
abs: require('./5/abs'), | ||
CheckObjectCoercible: require('./5/CheckObjectCoercible'), | ||
@@ -17,2 +18,3 @@ DateFromTime: require('./5/DateFromTime'), | ||
DayWithinYear: require('./5/DayWithinYear'), | ||
floor: require('./5/floor'), | ||
FromPropertyDescriptor: require('./5/FromPropertyDescriptor'), | ||
@@ -19,0 +21,0 @@ HourFromTime: require('./5/HourFromTime'), |
'use strict'; | ||
/* globals | ||
AggregateError, | ||
Atomics, | ||
FinalizationRegistry, | ||
SharedArrayBuffer, | ||
WeakRef, | ||
*/ | ||
@@ -10,4 +13,14 @@ | ||
var $SyntaxError = SyntaxError; | ||
var $Function = Function; | ||
var $TypeError = TypeError; | ||
// eslint-disable-next-line consistent-return | ||
var getEvalledConstructor = function (expressionSyntax) { | ||
try { | ||
// eslint-disable-next-line no-new-func | ||
return Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); | ||
} catch (e) {} | ||
}; | ||
var $gOPD = Object.getOwnPropertyDescriptor; | ||
@@ -44,9 +57,5 @@ if ($gOPD) { | ||
var generator; // = function * () {}; | ||
var generatorFunction = generator ? getProto(generator) : undefined; | ||
var asyncFn; // async function() {}; | ||
var asyncFunction = asyncFn ? asyncFn.constructor : undefined; | ||
var asyncGen; // async function * () {}; | ||
var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; | ||
var asyncGenIterator = asyncGen ? asyncGen() : undefined; | ||
var asyncGenFunction = getEvalledConstructor('async function* () {}'); | ||
var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined; | ||
var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined; | ||
@@ -56,25 +65,16 @@ var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); | ||
var INTRINSICS = { | ||
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, | ||
'%Array%': Array, | ||
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, | ||
'%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, | ||
'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, | ||
'%ArrayPrototype%': Array.prototype, | ||
'%ArrayProto_entries%': Array.prototype.entries, | ||
'%ArrayProto_forEach%': Array.prototype.forEach, | ||
'%ArrayProto_keys%': Array.prototype.keys, | ||
'%ArrayProto_values%': Array.prototype.values, | ||
'%AsyncFromSyncIteratorPrototype%': undefined, | ||
'%AsyncFunction%': asyncFunction, | ||
'%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, | ||
'%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, | ||
'%AsyncFunction%': getEvalledConstructor('async function () {}'), | ||
'%AsyncGenerator%': asyncGenFunctionPrototype, | ||
'%AsyncGeneratorFunction%': asyncGenFunction, | ||
'%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, | ||
'%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, | ||
'%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined, | ||
'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, | ||
'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, | ||
'%Boolean%': Boolean, | ||
'%BooleanPrototype%': Boolean.prototype, | ||
'%DataView%': typeof DataView === 'undefined' ? undefined : DataView, | ||
'%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, | ||
'%Date%': Date, | ||
'%DatePrototype%': Date.prototype, | ||
'%decodeURI%': decodeURI, | ||
@@ -85,21 +85,12 @@ '%decodeURIComponent%': decodeURIComponent, | ||
'%Error%': Error, | ||
'%ErrorPrototype%': Error.prototype, | ||
'%eval%': eval, // eslint-disable-line no-eval | ||
'%EvalError%': EvalError, | ||
'%EvalErrorPrototype%': EvalError.prototype, | ||
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, | ||
'%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, | ||
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, | ||
'%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, | ||
'%Function%': Function, | ||
'%FunctionPrototype%': Function.prototype, | ||
'%Generator%': generator ? getProto(generator()) : undefined, | ||
'%GeneratorFunction%': generatorFunction, | ||
'%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, | ||
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, | ||
'%Function%': $Function, | ||
'%GeneratorFunction%': getEvalledConstructor('function* () {}'), | ||
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, | ||
'%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, | ||
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, | ||
'%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, | ||
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, | ||
'%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, | ||
'%isFinite%': isFinite, | ||
@@ -109,63 +100,93 @@ '%isNaN%': isNaN, | ||
'%JSON%': typeof JSON === 'object' ? JSON : undefined, | ||
'%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined, | ||
'%Map%': typeof Map === 'undefined' ? undefined : Map, | ||
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), | ||
'%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, | ||
'%Math%': Math, | ||
'%Number%': Number, | ||
'%NumberPrototype%': Number.prototype, | ||
'%Object%': Object, | ||
'%ObjectPrototype%': Object.prototype, | ||
'%ObjProto_toString%': Object.prototype.toString, | ||
'%ObjProto_valueOf%': Object.prototype.valueOf, | ||
'%parseFloat%': parseFloat, | ||
'%parseInt%': parseInt, | ||
'%Promise%': typeof Promise === 'undefined' ? undefined : Promise, | ||
'%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, | ||
'%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, | ||
'%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, | ||
'%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, | ||
'%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, | ||
'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, | ||
'%RangeError%': RangeError, | ||
'%RangeErrorPrototype%': RangeError.prototype, | ||
'%ReferenceError%': ReferenceError, | ||
'%ReferenceErrorPrototype%': ReferenceError.prototype, | ||
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, | ||
'%RegExp%': RegExp, | ||
'%RegExpPrototype%': RegExp.prototype, | ||
'%Set%': typeof Set === 'undefined' ? undefined : Set, | ||
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), | ||
'%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, | ||
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, | ||
'%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, | ||
'%String%': String, | ||
'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, | ||
'%StringPrototype%': String.prototype, | ||
'%Symbol%': hasSymbols ? Symbol : undefined, | ||
'%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, | ||
'%SyntaxError%': SyntaxError, | ||
'%SyntaxErrorPrototype%': SyntaxError.prototype, | ||
'%SyntaxError%': $SyntaxError, | ||
'%ThrowTypeError%': ThrowTypeError, | ||
'%TypedArray%': TypedArray, | ||
'%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, | ||
'%TypeError%': $TypeError, | ||
'%TypeErrorPrototype%': $TypeError.prototype, | ||
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, | ||
'%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, | ||
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, | ||
'%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, | ||
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, | ||
'%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, | ||
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, | ||
'%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, | ||
'%URIError%': URIError, | ||
'%URIErrorPrototype%': URIError.prototype, | ||
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, | ||
'%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, | ||
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, | ||
'%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype | ||
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, | ||
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet | ||
}; | ||
var LEGACY_ALIASES = { | ||
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], | ||
'%ArrayPrototype%': ['Array', 'prototype'], | ||
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'], | ||
'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], | ||
'%ArrayProto_keys%': ['Array', 'prototype', 'keys'], | ||
'%ArrayProto_values%': ['Array', 'prototype', 'values'], | ||
'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], | ||
'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], | ||
'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], | ||
'%BooleanPrototype%': ['Boolean', 'prototype'], | ||
'%DataViewPrototype%': ['DataView', 'prototype'], | ||
'%DatePrototype%': ['Date', 'prototype'], | ||
'%ErrorPrototype%': ['Error', 'prototype'], | ||
'%EvalErrorPrototype%': ['EvalError', 'prototype'], | ||
'%Float32ArrayPrototype%': ['Float32Array', 'prototype'], | ||
'%Float64ArrayPrototype%': ['Float64Array', 'prototype'], | ||
'%FunctionPrototype%': ['Function', 'prototype'], | ||
'%Generator%': ['GeneratorFunction', 'prototype'], | ||
'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], | ||
'%Int8ArrayPrototype%': ['Int8Array', 'prototype'], | ||
'%Int16ArrayPrototype%': ['Int16Array', 'prototype'], | ||
'%Int32ArrayPrototype%': ['Int32Array', 'prototype'], | ||
'%JSONParse%': ['JSON', 'parse'], | ||
'%JSONStringify%': ['JSON', 'stringify'], | ||
'%MapPrototype%': ['Map', 'prototype'], | ||
'%NumberPrototype%': ['Number', 'prototype'], | ||
'%ObjectPrototype%': ['Object', 'prototype'], | ||
'%ObjProto_toString%': ['Object', 'prototype', 'toString'], | ||
'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], | ||
'%PromisePrototype%': ['Promise', 'prototype'], | ||
'%PromiseProto_then%': ['Promise', 'prototype', 'then'], | ||
'%Promise_all%': ['Promise', 'all'], | ||
'%Promise_reject%': ['Promise', 'reject'], | ||
'%Promise_resolve%': ['Promise', 'resolve'], | ||
'%RangeErrorPrototype%': ['RangeError', 'prototype'], | ||
'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], | ||
'%RegExpPrototype%': ['RegExp', 'prototype'], | ||
'%SetPrototype%': ['Set', 'prototype'], | ||
'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], | ||
'%StringPrototype%': ['String', 'prototype'], | ||
'%SymbolPrototype%': ['Symbol', 'prototype'], | ||
'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], | ||
'%TypedArrayPrototype%': ['TypedArray', 'prototype'], | ||
'%TypeErrorPrototype%': ['TypeError', 'prototype'], | ||
'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], | ||
'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], | ||
'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], | ||
'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], | ||
'%URIErrorPrototype%': ['URIError', 'prototype'], | ||
'%WeakMapPrototype%': ['WeakMap', 'prototype'], | ||
'%WeakSetPrototype%': ['WeakSet', 'prototype'] | ||
}; | ||
var bind = require('function-bind'); | ||
var hasOwn = require('has'); | ||
var $concat = bind.call(Function.call, Array.prototype.concat); | ||
var $spliceApply = bind.call(Function.apply, Array.prototype.splice); | ||
var $replace = bind.call(Function.call, String.prototype.replace); | ||
@@ -179,3 +200,3 @@ | ||
$replace(string, rePropName, function (match, number, quote, subString) { | ||
result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match); | ||
result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; | ||
}); | ||
@@ -187,12 +208,23 @@ return result; | ||
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { | ||
if (!(name in INTRINSICS)) { | ||
throw new SyntaxError('intrinsic ' + name + ' does not exist!'); | ||
var intrinsicName = name; | ||
var alias; | ||
if (hasOwn(LEGACY_ALIASES, intrinsicName)) { | ||
alias = LEGACY_ALIASES[intrinsicName]; | ||
intrinsicName = '%' + alias[0] + '%'; | ||
} | ||
// istanbul ignore if // hopefully this is impossible to test :-) | ||
if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) { | ||
throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); | ||
if (hasOwn(INTRINSICS, intrinsicName)) { | ||
var value = INTRINSICS[intrinsicName]; | ||
if (typeof value === 'undefined' && !allowMissing) { | ||
throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); | ||
} | ||
return { | ||
alias: alias, | ||
name: intrinsicName, | ||
value: value | ||
}; | ||
} | ||
return INTRINSICS[name]; | ||
throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); | ||
}; | ||
@@ -202,22 +234,50 @@ | ||
if (typeof name !== 'string' || name.length === 0) { | ||
throw new TypeError('intrinsic name must be a non-empty string'); | ||
throw new $TypeError('intrinsic name must be a non-empty string'); | ||
} | ||
if (arguments.length > 1 && typeof allowMissing !== 'boolean') { | ||
throw new TypeError('"allowMissing" argument must be a boolean'); | ||
throw new $TypeError('"allowMissing" argument must be a boolean'); | ||
} | ||
var parts = stringToPath(name); | ||
var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; | ||
var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing); | ||
for (var i = 1; i < parts.length; i += 1) { | ||
if (value != null) { | ||
var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); | ||
var intrinsicRealName = intrinsic.name; | ||
var value = intrinsic.value; | ||
var skipFurtherCaching = false; | ||
var alias = intrinsic.alias; | ||
if (alias) { | ||
intrinsicBaseName = alias[0]; | ||
$spliceApply(parts, $concat([0, 1], alias)); | ||
} | ||
for (var i = 1, isOwn = true; i < parts.length; i += 1) { | ||
var part = parts[i]; | ||
if (part === 'constructor' || !isOwn) { | ||
skipFurtherCaching = true; | ||
} | ||
intrinsicBaseName += '.' + part; | ||
intrinsicRealName = '%' + intrinsicBaseName + '%'; | ||
if (hasOwn(INTRINSICS, intrinsicRealName)) { | ||
value = INTRINSICS[intrinsicRealName]; | ||
} else if (value != null) { | ||
if ($gOPD && (i + 1) >= parts.length) { | ||
var desc = $gOPD(value, parts[i]); | ||
if (!allowMissing && !(parts[i] in value)) { | ||
var desc = $gOPD(value, part); | ||
isOwn = !!desc; | ||
if (!allowMissing && !(part in value)) { | ||
throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); | ||
} | ||
value = desc ? (desc.get || desc.value) : value[parts[i]]; | ||
value = isOwn ? desc.get || desc.value : value[part]; | ||
} else { | ||
value = value[parts[i]]; | ||
isOwn = hasOwn(value, part); | ||
value = value[part]; | ||
} | ||
if (isOwn && !skipFurtherCaching) { | ||
INTRINSICS[intrinsicRealName] = value; | ||
} | ||
} | ||
@@ -224,0 +284,0 @@ } |
@@ -11,2 +11,3 @@ 'use strict'; | ||
var ES2019 = require('./es2019'); | ||
var ES2020 = require('./es2020'); | ||
@@ -21,3 +22,4 @@ var ES = { | ||
ES2018: ES2018, | ||
ES2019: ES2019 | ||
ES2019: ES2019, | ||
ES2020: ES2020 | ||
}; | ||
@@ -24,0 +26,0 @@ assign(ES, ES5); |
{ | ||
"name": "es-abstract", | ||
"version": "1.17.6", | ||
"version": "1.18.0-next.0", | ||
"author": { | ||
@@ -57,4 +57,5 @@ "name": "Jordan Harband", | ||
"is-callable": "^1.2.0", | ||
"is-regex": "^1.1.0", | ||
"object-inspect": "^1.7.0", | ||
"is-negative-zero": "^2.0.0", | ||
"is-regex": "^1.1.1", | ||
"object-inspect": "^1.8.0", | ||
"object-keys": "^1.1.1", | ||
@@ -72,8 +73,12 @@ "object.assign": "^4.1.0", | ||
"eclint": "^2.8.1", | ||
"eslint": "^7.2.0", | ||
"eslint": "^7.7.0", | ||
"foreach": "^2.0.5", | ||
"functions-have-names": "^1.2.1", | ||
"has-bigints": "^1.0.0", | ||
"has-strict-mode": "^1.0.0", | ||
"in-publish": "^2.0.1", | ||
"make-arrow-function": "^1.2.0", | ||
"make-async-function": "^1.0.0", | ||
"make-async-generator-function": "^1.0.0", | ||
"make-generator-function": "^2.0.0", | ||
"nyc": "^10.3.2", | ||
@@ -80,0 +85,0 @@ "object-is": "^1.1.2", |
@@ -9,3 +9,2 @@ 'use strict'; | ||
var expectedMissing = [ | ||
'abs', | ||
'AddRestrictedFunctionProperties', | ||
@@ -43,3 +42,2 @@ 'AllocateArrayBuffer', | ||
'EvaluateNew', | ||
'floor', | ||
'ForBodyEvaluation', | ||
@@ -113,3 +111,2 @@ 'ForIn/OfBodyEvaluation', | ||
'OrdinaryCallEvaluateBody', | ||
'OrdinaryCreateFromConstructor', | ||
'ParseModule', | ||
@@ -124,3 +121,2 @@ 'PerformEval', | ||
'PutValue', | ||
'QuoteJSONString', | ||
'RegExpAlloc', | ||
@@ -127,0 +123,0 @@ 'RegExpBuiltinExec', |
@@ -9,3 +9,2 @@ 'use strict'; | ||
var expectedMissing = [ | ||
'abs', | ||
'AddRestrictedFunctionProperties', | ||
@@ -50,3 +49,2 @@ 'AllocateArrayBuffer', | ||
'EvaluateNew', | ||
'floor', | ||
'ForBodyEvaluation', | ||
@@ -120,3 +118,2 @@ 'ForIn/OfBodyEvaluation', | ||
'OrdinaryCallEvaluateBody', | ||
'OrdinaryCreateFromConstructor', | ||
'OrdinaryDelete', | ||
@@ -140,3 +137,2 @@ 'OrdinaryGet', | ||
'PutValue', | ||
'QuoteJSONString', | ||
'RegExpAlloc', | ||
@@ -169,5 +165,4 @@ 'RegExpBuiltinExec', | ||
'UpdateEmpty', | ||
'UTC', | ||
'UTC', // depends on LocalTZA | ||
'UTF16Decode', | ||
'UTF16Encoding', | ||
'ValidateTypedArray' | ||
@@ -174,0 +169,0 @@ ]; |
@@ -9,3 +9,2 @@ 'use strict'; | ||
var expectedMissing = [ | ||
'abs', | ||
'AddWaiter', | ||
@@ -63,3 +62,2 @@ 'agent-order', | ||
'EventSet', | ||
'floor', | ||
'ForBodyEvaluation', | ||
@@ -149,3 +147,2 @@ 'ForIn/OfBodyEvaluation', | ||
'OrdinaryCallEvaluateBody', | ||
'OrdinaryCreateFromConstructor', | ||
'OrdinaryDelete', | ||
@@ -170,3 +167,2 @@ 'OrdinaryGet', | ||
'PutValue', | ||
'QuoteJSONString', | ||
'RawBytesToNumber', | ||
@@ -201,3 +197,2 @@ 'reads-bytes-from', | ||
'StringCreate', | ||
'StringGetOwnProperty', | ||
'Suspend', | ||
@@ -210,5 +205,4 @@ 'TopLevelModuleEvaluationJob', | ||
'UpdateEmpty', | ||
'UTC', | ||
'UTC', // depends on LocalTZA'UTC', | ||
'UTF16Decode', | ||
'UTF16Encoding', | ||
'ValidateAtomicAccess', | ||
@@ -219,3 +213,3 @@ 'ValidateSharedIntegerTypedArray', | ||
'WakeWaiter', | ||
'WordCharacters', | ||
'WordCharacters', // depends on Canonicalize | ||
'AddRestrictedFunctionProperties', | ||
@@ -222,0 +216,0 @@ 'synchronizes-with' |
@@ -9,3 +9,2 @@ 'use strict'; | ||
var expectedMissing = [ | ||
'abs', | ||
'AddRestrictedFunctionProperties', | ||
@@ -74,3 +73,2 @@ 'AddWaiter', | ||
'EventSet', | ||
'floor', | ||
'ForBodyEvaluation', | ||
@@ -165,3 +163,2 @@ 'ForIn/OfBodyEvaluation', | ||
'OrdinaryCallEvaluateBody', | ||
'OrdinaryCreateFromConstructor', | ||
'OrdinaryDelete', | ||
@@ -187,3 +184,2 @@ 'OrdinaryGet', | ||
'PutValue', | ||
'QuoteJSONString', | ||
'RawBytesToNumber', | ||
@@ -210,3 +206,2 @@ 'reads-bytes-from', | ||
'SetDefaultGlobalBindings', | ||
'SetFunctionLength', | ||
'SetImmutablePrototype', | ||
@@ -220,3 +215,2 @@ 'SetRealmGlobalObject', | ||
'StringCreate', | ||
'StringGetOwnProperty', | ||
'Suspend', | ||
@@ -230,9 +224,7 @@ 'synchronizes-with', | ||
'TypedArraySpeciesCreate', | ||
'UnicodeEscape', | ||
'UnicodeMatchProperty', | ||
'UnicodeMatchPropertyValue', | ||
'UpdateEmpty', | ||
'UTC', | ||
'UTC', // depends on LocalTZA'UTC', | ||
'UTF16Decode', | ||
'UTF16Encoding', | ||
'ValidateAtomicAccess', | ||
@@ -243,3 +235,3 @@ 'ValidateSharedIntegerTypedArray', | ||
'WakeWaiter', | ||
'WordCharacters' | ||
'WordCharacters' // depends on Canonicalize | ||
]; | ||
@@ -246,0 +238,0 @@ |
@@ -9,3 +9,2 @@ 'use strict'; | ||
var expectedMissing = [ | ||
'abs', | ||
'AddRestrictedFunctionProperties', | ||
@@ -76,3 +75,2 @@ 'AddWaiter', | ||
'ExecuteModule', | ||
'floor', | ||
'ForBodyEvaluation', | ||
@@ -169,3 +167,2 @@ 'ForIn/OfBodyEvaluation', | ||
'OrdinaryCallEvaluateBody', | ||
'OrdinaryCreateFromConstructor', | ||
'OrdinaryDelete', | ||
@@ -191,3 +188,2 @@ 'OrdinaryGet', | ||
'PutValue', | ||
'QuoteJSONString', | ||
'RawBytesToNumber', | ||
@@ -214,3 +210,2 @@ 'reads-bytes-from', | ||
'SetDefaultGlobalBindings', | ||
'SetFunctionLength', | ||
'SetImmutablePrototype', | ||
@@ -224,3 +219,2 @@ 'SetRealmGlobalObject', | ||
'StringCreate', | ||
'StringGetOwnProperty', | ||
'Suspend', | ||
@@ -235,9 +229,7 @@ 'SynchronizeEventSet', | ||
'TypedArraySpeciesCreate', | ||
'UnicodeEscape', | ||
'UnicodeMatchProperty', | ||
'UnicodeMatchPropertyValue', | ||
'UpdateEmpty', | ||
'UTC', | ||
'UTC', // depends on LocalTZA'UTC', | ||
'UTF16Decode', | ||
'UTF16Encoding', | ||
'ValidateAtomicAccess', | ||
@@ -248,3 +240,3 @@ 'ValidateSharedIntegerTypedArray', | ||
'WakeWaiter', | ||
'WordCharacters' | ||
'WordCharacters' // depends on Canonicalize | ||
]; | ||
@@ -251,0 +243,0 @@ |
@@ -8,5 +8,12 @@ 'use strict'; | ||
var debug = require('object-inspect'); | ||
var generatorFns = require('make-generator-function')(); | ||
var asyncFns = require('make-async-function').list(); | ||
var asyncGenFns = require('make-async-generator-function')(); | ||
var callBound = require('../helpers/callBound'); | ||
var v = require('./helpers/values'); | ||
var $gOPD = require('../helpers/getOwnPropertyDescriptor'); | ||
var $isProto = callBound('%Object.prototype.isPrototypeOf%'); | ||
test('export', function (t) { | ||
@@ -84,7 +91,63 @@ t.equal(typeof GetIntrinsic, 'function', 'it is a function'); | ||
test('underscore paths are aliases for dotted paths', function (st) { | ||
var original = GetIntrinsic('%ObjProto_toString%'); | ||
forEach([ | ||
'%Object.prototype.toString%', | ||
'Object.prototype.toString', | ||
'%ObjectPrototype.toString%', | ||
'ObjectPrototype.toString', | ||
'%ObjProto_toString%', | ||
'ObjProto_toString' | ||
], function (name) { | ||
// eslint-disable-next-line no-extend-native | ||
Object.prototype.toString = function toString() { | ||
return original.apply(this, arguments); | ||
}; | ||
st.equal(GetIntrinsic(name), original, name + ' yields original Object.prototype.toString'); | ||
}); | ||
// eslint-disable-next-line no-extend-native | ||
Object.prototype.toString = original; | ||
st.end(); | ||
}); | ||
test('dotted paths cache', function (st) { | ||
var original = GetIntrinsic('%Object.prototype.propertyIsEnumerable%'); | ||
forEach([ | ||
'%Object.prototype.propertyIsEnumerable%', | ||
'Object.prototype.propertyIsEnumerable', | ||
'%ObjectPrototype.propertyIsEnumerable%', | ||
'ObjectPrototype.propertyIsEnumerable' | ||
], function (name) { | ||
// eslint-disable-next-line no-extend-native | ||
Object.prototype.propertyIsEnumerable = function propertyIsEnumerable() { | ||
return original.apply(this, arguments); | ||
}; | ||
st.equal(GetIntrinsic(name), original, name + ' yields cached Object.prototype.propertyIsEnumerable'); | ||
}); | ||
// eslint-disable-next-line no-extend-native | ||
Object.prototype.propertyIsEnumerable = original; | ||
st.end(); | ||
}); | ||
test('dotted path reports correct error', function (st) { | ||
st['throws'](function () { | ||
GetIntrinsic('%NonExistentIntrinsic.prototype.property%'); | ||
}, /%NonExistentIntrinsic%/, 'The base intrinsic of %NonExistentIntrinsic.prototype.property% is %NonExistentIntrinsic%'); | ||
st['throws'](function () { | ||
GetIntrinsic('%NonExistentIntrinsicPrototype.property%'); | ||
}, /%NonExistentIntrinsicPrototype%/, 'The base intrinsic of %NonExistentIntrinsicPrototype.property% is %NonExistentIntrinsicPrototype%'); | ||
st.end(); | ||
}); | ||
t.end(); | ||
}); | ||
test('accessors', { skip: !Object.getOwnPropertyDescriptor || typeof Map !== 'function' }, function (t) { | ||
var actual = Object.getOwnPropertyDescriptor(Map.prototype, 'size'); | ||
test('accessors', { skip: !$gOPD || typeof Map !== 'function' }, function (t) { | ||
var actual = $gOPD(Map.prototype, 'size'); | ||
t.ok(actual, 'Map.prototype.size has a descriptor'); | ||
@@ -97,1 +160,50 @@ t.equal(typeof actual.get, 'function', 'Map.prototype.size has a getter function'); | ||
}); | ||
test('generator functions', { skip: !generatorFns.length }, function (t) { | ||
var $GeneratorFunction = GetIntrinsic('%GeneratorFunction%'); | ||
var $GeneratorFunctionPrototype = GetIntrinsic('%Generator%'); | ||
var $GeneratorPrototype = GetIntrinsic('%GeneratorPrototype%'); | ||
forEach(generatorFns, function (genFn) { | ||
var fnName = genFn.name; | ||
fnName = fnName ? "'" + fnName + "'" : 'genFn'; | ||
t.ok(genFn instanceof $GeneratorFunction, fnName + ' instanceof %GeneratorFunction%'); | ||
t.ok($isProto($GeneratorFunctionPrototype, genFn), '%Generator% is prototype of ' + fnName); | ||
t.ok($isProto($GeneratorPrototype, genFn.prototype), '%GeneratorPrototype% is prototype of ' + fnName + '.prototype'); | ||
}); | ||
t.end(); | ||
}); | ||
test('async functions', { skip: !asyncFns.length }, function (t) { | ||
var $AsyncFunction = GetIntrinsic('%AsyncFunction%'); | ||
var $AsyncFunctionPrototype = GetIntrinsic('%AsyncFunctionPrototype%'); | ||
forEach(asyncFns, function (asyncFn) { | ||
var fnName = asyncFn.name; | ||
fnName = fnName ? "'" + fnName + "'" : 'asyncFn'; | ||
t.ok(asyncFn instanceof $AsyncFunction, fnName + ' instanceof %AsyncFunction%'); | ||
t.ok($isProto($AsyncFunctionPrototype, asyncFn), '%AsyncFunctionPrototype% is prototype of ' + fnName); | ||
}); | ||
t.end(); | ||
}); | ||
test('async generator functions', { skip: !asyncGenFns.length }, function (t) { | ||
var $AsyncGeneratorFunction = GetIntrinsic('%AsyncGeneratorFunction%'); | ||
var $AsyncGeneratorFunctionPrototype = GetIntrinsic('%AsyncGenerator%'); | ||
var $AsyncGeneratorPrototype = GetIntrinsic('%AsyncGeneratorPrototype%'); | ||
forEach(asyncGenFns, function (asyncGenFn) { | ||
var fnName = asyncGenFn.name; | ||
fnName = fnName ? "'" + fnName + "'" : 'asyncGenFn'; | ||
t.ok(asyncGenFn instanceof $AsyncGeneratorFunction, fnName + ' instanceof %AsyncGeneratorFunction%'); | ||
t.ok($isProto($AsyncGeneratorFunctionPrototype, asyncGenFn), '%AsyncGenerator% is prototype of ' + fnName); | ||
t.ok($isProto($AsyncGeneratorPrototype, asyncGenFn.prototype), '%AsyncGeneratorPrototype% is prototype of ' + fnName + '.prototype'); | ||
}); | ||
t.end(); | ||
}); |
@@ -6,2 +6,3 @@ 'use strict'; | ||
var hasSymbols = require('has-symbols')(); | ||
var hasBigInts = require('has-bigints')(); | ||
@@ -23,2 +24,3 @@ var coercibleObject = { valueOf: function () { return 3; }, toString: function () { return 42; } }; | ||
var nonIntegerNumbers = [-1.3, 0.2, 1.8, 1 / 3]; | ||
var integerNumbers = [1, 7, 42, 1e17]; | ||
var zeroes = [0, -0]; | ||
@@ -30,7 +32,8 @@ var infinities = [Infinity, -Infinity]; | ||
var symbols = hasSymbols ? [Symbol.iterator, Symbol('foo')] : []; | ||
var nonSymbolPrimitives = [].concat(nullPrimitives, booleans, strings, numbers); | ||
var bigints = hasBigInts ? [BigInt(42), BigInt(0)] : []; | ||
var nonSymbolPrimitives = [].concat(nullPrimitives, booleans, strings, numbers, bigints); | ||
var nonNumberPrimitives = [].concat(nullPrimitives, booleans, strings, symbols); | ||
var nonNullPrimitives = [].concat(booleans, strings, numbers, symbols); | ||
var nonNullPrimitives = [].concat(booleans, strings, numbers, symbols, bigints); | ||
var nonUndefinedPrimitives = [].concat(null, nonNullPrimitives); | ||
var nonStrings = [].concat(nullPrimitives, booleans, numbers, symbols, objects); | ||
var nonStrings = [].concat(nullPrimitives, booleans, numbers, symbols, objects, bigints); | ||
var primitives = [].concat(nullPrimitives, nonNullPrimitives); | ||
@@ -45,2 +48,3 @@ var nonPropertyKeys = [].concat(nullPrimitives, booleans, numbers, objects); | ||
var nonArrays = [].concat(nonFunctions); | ||
var nonBigInts = [].concat(nonNumberPrimitives, numbers); | ||
@@ -69,33 +73,35 @@ var descriptors = { | ||
module.exports = { | ||
booleans: booleans, | ||
coercibleFnObject: coercibleFnObject, | ||
coercibleObject: coercibleObject, | ||
coercibleFnObject: coercibleFnObject, | ||
valueOfOnlyObject: valueOfOnlyObject, | ||
toStringOnlyObject: toStringOnlyObject, | ||
uncoercibleObject: uncoercibleObject, | ||
uncoercibleFnObject: uncoercibleFnObject, | ||
objects: objects, | ||
falsies: falsies, | ||
hasSymbols: hasSymbols, | ||
infinities: infinities, | ||
integerNumbers: integerNumbers, | ||
nonArrays: nonArrays, | ||
nonBigInts: nonBigInts, | ||
nonBooleans: nonBooleans, | ||
nonFunctions: nonFunctions, | ||
nonArrays: nonArrays, | ||
nonIntegerNumbers: nonIntegerNumbers, | ||
nonNullPrimitives: nonNullPrimitives, | ||
nonNumberPrimitives: nonNumberPrimitives, | ||
nonNumbers: nonNumberPrimitives.concat(objects), | ||
nonPropertyKeys: nonPropertyKeys, | ||
nonStrings: nonStrings, | ||
nonSymbolPrimitives: nonSymbolPrimitives, | ||
nonUndefinedPrimitives: nonUndefinedPrimitives, | ||
nullPrimitives: nullPrimitives, | ||
numbers: numbers, | ||
zeroes: zeroes, | ||
infinities: infinities, | ||
objects: objects, | ||
primitives: primitives, | ||
propertyKeys: propertyKeys, | ||
strings: strings, | ||
booleans: booleans, | ||
symbols: symbols, | ||
hasSymbols: hasSymbols, | ||
nonSymbolPrimitives: nonSymbolPrimitives, | ||
nonNumberPrimitives: nonNumberPrimitives, | ||
nonNullPrimitives: nonNullPrimitives, | ||
nonUndefinedPrimitives: nonUndefinedPrimitives, | ||
nonStrings: nonStrings, | ||
nonNumbers: nonNumberPrimitives.concat(objects), | ||
nonIntegerNumbers: nonIntegerNumbers, | ||
primitives: primitives, | ||
nonPropertyKeys: nonPropertyKeys, | ||
propertyKeys: propertyKeys, | ||
nonBooleans: nonBooleans, | ||
falsies: falsies, | ||
timestamps: timestamps, | ||
toStringOnlyObject: toStringOnlyObject, | ||
truthies: truthies, | ||
timestamps: timestamps, | ||
uncoercibleFnObject: uncoercibleFnObject, | ||
uncoercibleObject: uncoercibleObject, | ||
valueOfOnlyObject: valueOfOnlyObject, | ||
zeroes: zeroes, | ||
bothDescriptor: function () { | ||
@@ -102,0 +108,0 @@ return { '[[Get]]': function () {}, '[[Value]]': true }; |
@@ -12,3 +12,3 @@ 'use strict'; | ||
test('exposed properties', function (t) { | ||
t.deepEqual(ESkeys, ES6keys.concat(['ES2019', 'ES2018', 'ES2017', 'ES7', 'ES2016', 'ES6', 'ES2015', 'ES5']).sort(), 'main ES object keys match ES6 keys'); | ||
t.deepEqual(ESkeys, ES6keys.concat(['ES2020', 'ES2019', 'ES2018', 'ES2017', 'ES7', 'ES2016', 'ES6', 'ES2015', 'ES5']).sort(), 'main ES object keys match ES6 keys'); | ||
t.end(); | ||
@@ -37,1 +37,2 @@ }); | ||
require('./es2019'); | ||
require('./es2020'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1103370
867
27176
12
21
2
4
+ Addedis-negative-zero@^2.0.0
+ Addedis-negative-zero@2.0.3(transitive)
Updatedis-regex@^1.1.1
Updatedobject-inspect@^1.8.0