1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-26 20:28:49 +08:00

For DefaultValue: HintString (not HintNumber) if object is a Date

This commit is contained in:
Robert Krimen
2013-04-20 19:16:17 -07:00
parent 01f5fae58f
commit 4abba5f6c6
2 changed files with 16 additions and 1 deletions

View File

@@ -161,7 +161,12 @@ const (
// 8.12.8
func (self *_object) DefaultValue(hint _defaultValueHint) Value {
if hint == defaultValueNoHint {
hint = defaultValueHintNumber
if self._Date != nil {
// Date exception
hint = defaultValueHintString
} else {
hint = defaultValueHintNumber
}
}
methodSequence := []string{"valueOf", "toString"}
if hint == defaultValueHintString {