You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🐛 Correct toJSON to match the specifications of JSON.stringify
`toJSON` returns a JSON value that can be specified to `JSON.stringify`.
It is NOT a JSON string that can be specified to `JSON.parse`.
This is a breaking change for code that depended on previous incorrect
behavior.
Previous (incorrect) behaviour:
```ts
await useExprString(denops, async (denops) => {
await denops.cmd('echo type(value)', { value: { toJSON: () => "123" } });
// output: 0 (equals `v:t_number`)
});
```
New (correct) behaviour:
```ts
await useExprString(denops, async (denops) => {
await denops.cmd('echo type(value)', { value: { toJSON: () => "123" } });
// output: 1 (equals `v:t_string`)
});
```
0 commit comments