massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / internals / date-to-primitive.js
1 'use strict';
2 var global = require('../internals/global');
3 var anObject = require('../internals/an-object');
4 var ordinaryToPrimitive = require('../internals/ordinary-to-primitive');
5
6 var TypeError = global.TypeError;
7
8 // `Date.prototype[@@toPrimitive](hint)` method implementation
9 // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive
10 module.exports = function (hint) {
11   anObject(this);
12   if (hint === 'string' || hint === 'default') hint = 'string';
13   else if (hint !== 'number') throw TypeError('Incorrect hint');
14   return ordinaryToPrimitive(this, hint);
15 };