Projekt

Obecné

Profil

Stáhnout (533 Bajtů) Statistiky
| Větev: | Revize:
1 3a515b92 cagy
'use strict';
2
3
var GetIntrinsic = require('../GetIntrinsic');
4
5
var $TypeError = GetIntrinsic('%TypeError%');
6
7
var callBound = require('../helpers/callBound');
8
9
var $SymbolToString = callBound('Symbol.prototype.toString', true);
10
11
var Type = require('./Type');
12
13
// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring
14
15
module.exports = function SymbolDescriptiveString(sym) {
16
	if (Type(sym) !== 'Symbol') {
17
		throw new $TypeError('Assertion failed: `sym` must be a Symbol');
18
	}
19
	return $SymbolToString(sym);
20
};