web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
331 B

  1. 'use strict';
  2. var ES5ToInteger = require('../5/ToInteger');
  3. var ToNumber = require('./ToNumber');
  4. // https://262.ecma-international.org/11.0/#sec-tointeger
  5. module.exports = function ToInteger(value) {
  6. var number = ToNumber(value);
  7. if (number !== 0) {
  8. number = ES5ToInteger(number);
  9. }
  10. return number === 0 ? 0 : number;
  11. };