Skip to content

Commit

Permalink
Implement Map.prototype[ @@toStringTag ] (#1249)
Browse files Browse the repository at this point in the history
* 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 <razican@protonmail.ch>

Co-authored-by: Iban Eguia <razican@protonmail.ch>
  • Loading branch information
wylie39 and Razican committed May 22, 2021
1 parent 42381a6 commit 2dceceb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions boa/src/builtins/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down

0 comments on commit 2dceceb

Please sign in to comment.