aswi2020vldc-gitlab/templetes/node_modules/es-abstract/2016/ToPropertyKey.js @ 0b434236
1 | 3a515b92 | cagy | 'use strict'; |
---|---|---|---|
2 | |||
3 | var GetIntrinsic = require('../GetIntrinsic'); |
||
4 | |||
5 | var $String = GetIntrinsic('%String%'); |
||
6 | |||
7 | var ToPrimitive = require('./ToPrimitive'); |
||
8 | var ToString = require('./ToString'); |
||
9 | |||
10 | // https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey
|
||
11 | |||
12 | module.exports = function ToPropertyKey(argument) { |
||
13 | var key = ToPrimitive(argument, $String); |
||
14 | return typeof key === 'symbol' ? key : ToString(key); |
||
15 | };
|