thisBooleanValue.js 362 B

123456789101112131415
  1. 'use strict';
  2. var $BooleanValueOf = require('call-bind/callBound')('Boolean.prototype.valueOf');
  3. var Type = require('./Type');
  4. // https://262.ecma-international.org/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. };