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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user