JSON.parse reviver gets `undefined` as value, when the property name consists of digits

Fixed Issue #101416

Details

Created
Apr 27, 2014
Privacy
This issue is public.
Found in build #
0.0011
Reports
Reported by 0 people

Sign in to watch or report this issue.

Steps to reproduce

URL =

URL:

Repro Steps:

var obj = JSON.parse('{"2":"foo"}’, function(key, value){
console.log(key, ':’, value);
return value;
});

/*

  • additionally, even though the value is undefined, and we return that undefined,
  • the json string is parsed and obj['2'] === 'foo' // true
    */

Expected Results:

@see reproduce steps

It prints 2:undefined to console, but the expected beviour is 2:foo.
When we change the serialized json to {"2a":"foo"}, then the output is as expected 2a:foo

Actual Results:

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “IPBS P.”

      Changed Status to “Fixed”

      Changed Assigned To from “IPBS P.” to “Murat S.”

    You need to sign in to your Microsoft account to add a comment.

    Sign in