ibmruntimes / yieldable-json

Asynchronous JSON parser and stringify APIs that make use of generator patterns
Other
145 stars 22 forks source link

Stringifying strings with quotation marks yields invalid JSON #7

Closed rexxars closed 5 years ago

rexxars commented 5 years ago

The following yields invalid JSON:

yj.stringifyAsync({
  a: 'a',
  b: '"b"',
})

// Result: {"a":"a","b":""b""}
// Expected: {"a":"a","b":"\"b\""}
gireeshpunathil commented 5 years ago

@rexxars - thank you for reporting this issue! I am able to reproduce this, will look into it. We do have escape sequences for double slashes defined in place; but for some reason those parts are not being exercised.

yathamravali commented 5 years ago

This issue is resolved through the PR https://github.com/ibmruntimes/yieldable-json/pull/13