diff options
author | Luca Maraschi <luca.maraschi@gmail.com> | 2017-03-17 17:07:19 +0100 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-03-21 22:31:04 -0700 |
commit | eed87b1637d64340856bb7f77db899f5283ca84f (patch) | |
tree | 65423aa3b6b3eda861b9aa115229de6798ec92bc /test/parallel/test-fs-utimes.js | |
parent | ae8a8691e65c90053c3e996c14fd221b61f3effc (diff) | |
download | android-node-v8-eed87b1637d64340856bb7f77db899f5283ca84f.tar.gz android-node-v8-eed87b1637d64340856bb7f77db899f5283ca84f.tar.bz2 android-node-v8-eed87b1637d64340856bb7f77db899f5283ca84f.zip |
fs: (+/-)Infinity and NaN invalid unixtimestamp
Infinity and NaN are currently considered valid input when generating a
unix time stamp but are defaulted arbitrarly to Date.now()/1000. This
PR removes this behaviour and throw an exception like all the other
invalid input types.
PR-URL: https://github.com/nodejs/node/pull/11919
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-fs-utimes.js')
-rw-r--r-- | test/parallel/test-fs-utimes.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js index 2d00d0eaed..456f09b804 100644 --- a/test/parallel/test-fs-utimes.js +++ b/test/parallel/test-fs-utimes.js @@ -143,17 +143,15 @@ function testIt(atime, mtime, callback) { const stats = fs.statSync(__filename); // run tests -const runTest = common.mustCall(testIt, 6); +const runTest = common.mustCall(testIt, 5); runTest(new Date('1982-09-10 13:37'), new Date('1982-09-10 13:37'), function() { runTest(new Date(), new Date(), function() { runTest(123456.789, 123456.789, function() { runTest(stats.mtime, stats.mtime, function() { - runTest(NaN, Infinity, function() { - runTest('123456', -1, common.mustCall(function() { - // done - })); - }); + runTest('123456', -1, common.mustCall(function() { + // done + })); }); }); }); |