main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
523 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var anObject = require('../internals/an-object');
|
---|
3 | var ordinaryToPrimitive = require('../internals/ordinary-to-primitive');
|
---|
4 |
|
---|
5 | var $TypeError = TypeError;
|
---|
6 |
|
---|
7 | // `Date.prototype[@@toPrimitive](hint)` method implementation
|
---|
8 | // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive
|
---|
9 | module.exports = function (hint) {
|
---|
10 | anObject(this);
|
---|
11 | if (hint === 'string' || hint === 'default') hint = 'string';
|
---|
12 | else if (hint !== 'number') throw new $TypeError('Incorrect hint');
|
---|
13 | return ordinaryToPrimitive(this, hint);
|
---|
14 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.