![JAR search and dependency download from the Maven repository](/logo.png)
package.2023.KeyForSymbol.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of es-abstract Show documentation
Show all versions of es-abstract Show documentation
ECMAScript spec abstract operations.
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var callBound = require('call-bind/callBound');
var $keyFor = callBound('Symbol.keyFor', true);
var Type = require('./Type');
// https://262.ecma-international.org/14.0/#sec-keyforsymbol
module.exports = function KeyForSymbol(sym) {
if (Type(sym) !== 'Symbol') {
throw new $TypeError('Assertion failed: `sym` must be a Symbol');
}
return $keyFor(sym);
};
© 2015 - 2025 Weber Informatics LLC | Privacy Policy