source: imaps-frontend/node_modules/es-abstract/2017/TimeClip.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

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