2
0

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:
Jack Christensen
2017-08-12 16:40:18 -05:00
parent d49a78dd73
commit d2a8d4ddca
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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