Browse Source

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 <razican@protonmail.ch>

Co-authored-by: Iban Eguia <razican@protonmail.ch>
pull/1258/head
Wylie Fowler 4 years ago committed by GitHub
parent
commit
a0be5cd610
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      boa/src/builtins/map/mod.rs

7
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,

Loading…
Cancel
Save