Skip to content

Commit

Permalink
fix(json): Fix bug in std/json where keys were not escaped properly
Browse files Browse the repository at this point in the history
  • Loading branch information
thesephist committed Jul 4, 2021
1 parent 0fac801 commit b6fd222
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion samples/json.ink
Expand Up @@ -34,7 +34,7 @@ ser := c => type(c) :: {
'boolean' -> string(c)
` do not serialize functions `
'function' -> 'null'
'composite' -> '{' + cat(map(keys(c), k => '"' + k + '":' + ser(c.(k))), ',') + '}'
'composite' -> '{' + cat(map(keys(c), k => '"' + escape(k) + '":' + ser(c.(k))), ',') + '}'
}

` is this character a numeral digit or .? `
Expand Down
2 changes: 2 additions & 0 deletions samples/test.ink
Expand Up @@ -991,6 +991,8 @@ me')
` complex serde `
obj := {
ser: 'de'
'\\': 3
'esc\\': 'back\\slash'
apple: 'dessert'
func: () => ()
x: ['train', false, 'car', true, {x: ['y', 'z']}]
Expand Down

0 comments on commit b6fd222

Please sign in to comment.