source: imaps-frontend/node_modules/es-abstract/2018/TimeClip.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 468 bytes
Line 
1'use strict';
2
3var GetIntrinsic = require('get-intrinsic');
4
5var $Date = GetIntrinsic('%Date%');
6var $Number = GetIntrinsic('%Number%');
7
8var $isFinite = require('../helpers/isFinite');
9
10var abs = require('./abs');
11var ToNumber = require('./ToNumber');
12
13// https://262.ecma-international.org/5.1/#sec-15.9.1.14
14
15module.exports = function TimeClip(time) {
16 if (!$isFinite(time) || abs(time) > 8.64e15) {
17 return NaN;
18 }
19 return $Number(new $Date(ToNumber(time)));
20};
21
Note: See TracBrowser for help on using the repository browser.