es-abstract
Advanced tools
Comparing version 1.8.1 to 1.8.2
@@ -0,1 +1,6 @@ | ||
1.8.2 / 2017-09-03 | ||
================= | ||
* [Fix] `es2015`+: `ToNumber`: provide the proper hint for Date objects (#27) | ||
* [Dev Deps] update `eslint` | ||
1.8.1 / 2017-08-30 | ||
@@ -2,0 +7,0 @@ ================= |
@@ -67,3 +67,3 @@ 'use strict'; | ||
ToNumber: function ToNumber(argument) { | ||
var value = isPrimitive(argument) ? argument : toPrimitive(argument, 'number'); | ||
var value = isPrimitive(argument) ? argument : toPrimitive(argument, Number); | ||
if (typeof value === 'symbol') { | ||
@@ -70,0 +70,0 @@ throw new TypeError('Cannot convert a Symbol value to a number'); |
{ | ||
"name": "es-abstract", | ||
"version": "1.8.1", | ||
"version": "1.8.2", | ||
"author": { | ||
@@ -58,3 +58,3 @@ "name": "Jordan Harband", | ||
"editorconfig-tools": "^0.1.1", | ||
"eslint": "^4.5.0", | ||
"eslint": "^4.6.1", | ||
"foreach": "^2.0.5", | ||
@@ -61,0 +61,0 @@ "jscs": "^3.0.7", |
@@ -53,2 +53,10 @@ 'use strict'; | ||
t.test('dates', function (st) { | ||
var invalid = new Date(NaN); | ||
st.equal(ES.ToPrimitive(invalid), Date.prototype.toString.call(invalid), 'invalid Date coerces to Date#toString'); | ||
var now = new Date(); | ||
st.equal(ES.ToPrimitive(now), Date.prototype.toString.call(now), 'Date coerces to Date#toString'); | ||
st.end(); | ||
}); | ||
t.end(); | ||
@@ -167,2 +175,10 @@ }); | ||
t.test('dates', function (st) { | ||
var invalid = new Date(NaN); | ||
st.ok(is(ES.ToNumber(invalid), NaN), 'invalid Date coerces to NaN'); | ||
var now = Date.now(); | ||
st.equal(ES.ToNumber(new Date(now)), now, 'Date coerces to timestamp'); | ||
st.end(); | ||
}); | ||
t.end(); | ||
@@ -169,0 +185,0 @@ }); |
@@ -53,2 +53,10 @@ 'use strict'; | ||
t.test('dates', function (st) { | ||
var invalid = new Date(NaN); | ||
st.equal(ES.ToPrimitive(invalid), Date.prototype.toString.call(invalid), 'invalid Date coerces to Date#toString'); | ||
var now = new Date(); | ||
st.equal(ES.ToPrimitive(now), Date.prototype.toString.call(now), 'Date coerces to Date#toString'); | ||
st.end(); | ||
}); | ||
t.end(); | ||
@@ -167,2 +175,10 @@ }); | ||
t.test('dates', function (st) { | ||
var invalid = new Date(NaN); | ||
st.ok(is(ES.ToNumber(invalid), NaN), 'invalid Date coerces to NaN'); | ||
var now = Date.now(); | ||
st.equal(ES.ToNumber(new Date(now)), now, 'Date coerces to timestamp'); | ||
st.end(); | ||
}); | ||
t.end(); | ||
@@ -169,0 +185,0 @@ }); |
@@ -53,2 +53,10 @@ 'use strict'; | ||
t.test('dates', function (st) { | ||
var invalid = new Date(NaN); | ||
st.equal(ES.ToPrimitive(invalid), Date.prototype.toString.call(invalid), 'invalid Date coerces to Date#toString'); | ||
var now = new Date(); | ||
st.equal(ES.ToPrimitive(now), Date.prototype.toString.call(now), 'Date coerces to Date#toString'); | ||
st.end(); | ||
}); | ||
t.end(); | ||
@@ -167,2 +175,10 @@ }); | ||
t.test('dates', function (st) { | ||
var invalid = new Date(NaN); | ||
st.ok(is(ES.ToNumber(invalid), NaN), 'invalid Date coerces to NaN'); | ||
var now = Date.now(); | ||
st.equal(ES.ToNumber(new Date(now)), now, 'Date coerces to timestamp'); | ||
st.end(); | ||
}); | ||
t.end(); | ||
@@ -169,0 +185,0 @@ }); |
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
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
212711
4558