File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,8 +87,8 @@ interface SymbolConstructor {
8787 split : symbol ;
8888
8989 /**
90- * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive
91- * abstract operation.
90+ * A method that converts an object to a corresponding primitive value.
91+ * Called by the ToPrimitive abstract operation.
9292 */
9393 toPrimitive : symbol ;
9494
@@ -622,6 +622,30 @@ interface Math {
622622 [ Symbol . toStringTag ] : string ;
623623}
624624
625+ interface Date {
626+ /**
627+ * Converts a Date object to a string.
628+ */
629+ [ Symbol . toPrimitive ] ( hint : "default" ) : string ;
630+ /**
631+ * Converts a Date object to a string.
632+ */
633+ [ Symbol . toPrimitive ] ( hint : "string" ) : string ;
634+ /**
635+ * Converts a Date object to a number.
636+ */
637+ [ Symbol . toPrimitive ] ( hint : "number" ) : number ;
638+ /**
639+ * Converts a Date object to a string or number.
640+ *
641+ * @param hint The strings "number", "string", or "default" to specify what primitive to return.
642+ *
643+ * @throws {TypeError } If 'hint' was given something other than "number", "string", or "default".
644+ * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default".
645+ */
646+ [ Symbol . toPrimitive ] ( hint : string ) : string | number ;
647+ }
648+
625649interface RegExp {
626650 /**
627651 * Matches a string with a regular expression, and returns an array containing the results of
You can’t perform that action at this time.
0 commit comments