|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
526 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | var $SyntaxError = require('es-errors/syntax');
|
|---|
| 4 | var callBound = require('call-bound');
|
|---|
| 5 |
|
|---|
| 6 | var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true);
|
|---|
| 7 |
|
|---|
| 8 | // https://262.ecma-international.org/9.0/#sec-thissymbolvalue
|
|---|
| 9 |
|
|---|
| 10 | module.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.