diff --git a/boa/src/builtins/json/mod.rs b/boa/src/builtins/json/mod.rs index b52de61ece3..ab8f91984b6 100644 --- a/boa/src/builtins/json/mod.rs +++ b/boa/src/builtins/json/mod.rs @@ -41,7 +41,12 @@ impl BuiltIn for Json { fn init(context: &mut Context) -> (&'static str, Value, Attribute) { let _timer = BoaProfiler::global().start_event(Self::NAME, "init"); + let to_string_tag = context.well_known_symbols().to_string_tag_symbol(); + + let attribute = Attribute::READONLY | Attribute::NON_ENUMERABLE | Attribute::CONFIGURABLE; + let json_object = ObjectInitializer::new(context) + .property(to_string_tag, "JSON", attribute) .function(Self::parse, "parse", 2) .function(Self::stringify, "stringify", 3) .build();