source: imaps-frontend/node_modules/es-abstract/2024/ThisSymbolValue.js

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

Update repo after prototype presentation

  • Property mode set to 100644
File size: 536 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/15.0/#sec-thissymbolvalue
9
10module.exports = function ThisSymbolValue(value) {
11 if (typeof value === 'symbol') {
12 return value;
13 }
14
15 if (!$SymbolValueOf) {
16 throw new $SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object');
17 }
18
19 return $SymbolValueOf(value);
20};
Note: See TracBrowser for help on using the repository browser.