source: imaps-frontend/node_modules/es-abstract/2021/thisSymbolValue.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 533 bytes
Line 
1'use strict';
2
3var $SyntaxError = require('es-errors/syntax');
4var callBound = require('call-bind/callBound');
5
6var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true);
7
8// https://262.ecma-international.org/9.0/#sec-thissymbolvalue
9
10module.exports = function thisSymbolValue(value) {
11 if (!$SymbolValueOf) {
12 throw new $SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object');
13 }
14 if (typeof value === 'symbol') {
15 return value;
16 }
17 return $SymbolValueOf(value);
18};
Note: See TracBrowser for help on using the repository browser.