main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
855 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var call = require('../internals/function-call');
|
---|
3 | var getBuiltIn = require('../internals/get-built-in');
|
---|
4 | var wellKnownSymbol = require('../internals/well-known-symbol');
|
---|
5 | var defineBuiltIn = require('../internals/define-built-in');
|
---|
6 |
|
---|
7 | module.exports = function () {
|
---|
8 | var Symbol = getBuiltIn('Symbol');
|
---|
9 | var SymbolPrototype = Symbol && Symbol.prototype;
|
---|
10 | var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
|
---|
11 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
---|
12 |
|
---|
13 | if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
|
---|
14 | // `Symbol.prototype[@@toPrimitive]` method
|
---|
15 | // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
|
---|
16 | // eslint-disable-next-line no-unused-vars -- required for .length
|
---|
17 | defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
|
---|
18 | return call(valueOf, this);
|
---|
19 | }, { arity: 1 });
|
---|
20 | }
|
---|
21 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.