Urara-Blog/node_modules/.pnpm-store/v3/files/1e/c158ce79a10119a6d2c8ee021eeca5372de03cafa26155e89be8e23c026aa90561c7619206cb8bf44d4cffacf04fe30fa934607fd0340f4c548d347fd269f6
2022-08-14 01:14:53 +08:00

19 lines
514 B
Text

'use strict';
var callBound = require('call-bind/callBound');
var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true);
var Type = require('./Type');
// https://262.ecma-international.org/9.0/#sec-thissymbolvalue
module.exports = function thisSymbolValue(value) {
if (!$SymbolValueOf) {
throw new SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object');
}
if (Type(value) === 'Symbol') {
return value;
}
return $SymbolValueOf(value);
};