From a0be5cd6109d832530d6aae02160428bc057c735 Mon Sep 17 00:00:00 2001 From: Wylie Fowler Date: Wed, 12 May 2021 14:52:24 -0400 Subject: [PATCH] Implement Map.prototype[ @@toStringTag ] (#1249) * Implement Map.prototype[ @@toStringTag ] This Implements Map.prototype[ @@toStringTag ] This is the same as #1225 * Update boa/src/builtins/map/mod.rs Co-authored-by: Iban Eguia Co-authored-by: Iban Eguia --- boa/src/builtins/map/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boa/src/builtins/map/mod.rs b/boa/src/builtins/map/mod.rs index eeb56d9b25..2af2b2b692 100644 --- a/boa/src/builtins/map/mod.rs +++ b/boa/src/builtins/map/mod.rs @@ -29,6 +29,8 @@ impl BuiltIn for Map { fn init(context: &mut Context) -> (&'static str, Value, Attribute) { let _timer = BoaProfiler::global().start_event(Self::NAME, "init"); + let to_string_tag = WellKnownSymbols::to_string_tag(); + let iterator_symbol = WellKnownSymbols::iterator(); let entries_function = FunctionBuilder::new(context, Self::entries) @@ -46,6 +48,11 @@ impl BuiltIn for Map { entries_function.clone(), Attribute::WRITABLE | Attribute::NON_ENUMERABLE | Attribute::CONFIGURABLE, ) + .property( + to_string_tag, + "Map", + Attribute::READONLY | Attribute::NON_ENUMERABLE | Attribute::CONFIGURABLE, + ) .property( iterator_symbol, entries_function,