|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
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.