source: imaps-frontend/node_modules/es-abstract/2023/thisSymbolValue.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 526 bytes
Line 
1'use strict';
2
3var $SyntaxError = require('es-errors/syntax');
4var callBound = require('call-bound');
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 (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.