boa: Attributes created by JSON.parse cannot be modified

JSON.parse seems to create object whose attributes cannot be modified (but can be deleted).

Steps To Reproduce Checkout current master (87aea64c) start cli: ./target/debug/boa Enter

var a = JSON.parse('{"x":0}');
a.x=2;
a.x

The value a.x is still 0 instead of expected 2.

Build environment (please complete the following information):

  • OS: Ubuntu
  • Version: 20.04
  • Target triple: x86_64-unknown-linux-gnu
  • Rustc version: 1.43.1 (8d69840ab 2020-05-04)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 16 (16 by maintainers)

Most upvoted comments

#502 should fix this bug 😃

I see. Even if we implement propertyIsEnumerable we can’t use it if the object does not have a prototype instance so we first need to fix #452

Agreed.

I can take this.