thisBooleanValue.js 367 B

123456789101112131415
  1. 'use strict';
  2. var $BooleanValueOf = require('call-bind/callBound')('Boolean.prototype.valueOf');
  3. var Type = require('./Type');
  4. // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object
  5. module.exports = function thisBooleanValue(value) {
  6. if (Type(value) === 'Boolean') {
  7. return value;
  8. }
  9. return $BooleanValueOf(value);
  10. };