You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
385 B
16 lines
385 B
'use strict'; |
|
|
|
var $TypeError = require('es-errors/type'); |
|
|
|
var callBound = require('call-bound'); |
|
|
|
var $keyFor = callBound('Symbol.keyFor', true); |
|
|
|
// https://262.ecma-international.org/14.0/#sec-keyforsymbol |
|
|
|
module.exports = function KeyForSymbol(sym) { |
|
if (typeof sym !== 'symbol') { |
|
throw new $TypeError('Assertion failed: `sym` must be a Symbol'); |
|
} |
|
return $keyFor(sym); |
|
};
|
|
|