On 2018-05-19 14:48, Hikaru Nakashima wrote:
Is it better to be able to pass the option object as the second argument like
this?
```
let option = { number: BigInt, reviver: conversion_function }
JSON.parse( json_string, option )
```
All JSON numbers are interpreted as follows
```
option.number( number_string )
```
Dear Nakashima-San,
Does this code permit parsing JSON data like the following?
{
"BigInt": 465456456465465465465465464646
}
AFAIK (I could indeed be wrong), the reviver function is called after parsing
which is too late because then the value has already been
stored/crippled/truncated into a JS Number object.
Cheers,
Anders
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss