Return error on MarshalJSON of status Undefined
Previously "undefined" was returned as a value. While this is a valid JavaScript value, it is not valid JSON.
This commit is contained in:
+1
-1
@@ -144,7 +144,7 @@ func (src *Text) MarshalJSON() ([]byte, error) {
|
||||
case Null:
|
||||
return []byte("null"), nil
|
||||
case Undefined:
|
||||
return []byte("undefined"), nil
|
||||
return nil, errUndefined
|
||||
}
|
||||
|
||||
return nil, errBadStatus
|
||||
|
||||
Reference in New Issue
Block a user