Skip to content

Commit

Permalink
Merge ffa3133 into b514564
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat authored May 4, 2021
2 parents b514564 + ffa3133 commit 5c1b005
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions boa/src/builtins/math/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ impl BuiltIn for Math {
let _timer = BoaProfiler::global().start_event(Self::NAME, "init");
use std::f64;

let to_string_tag = context.well_known_symbols().to_string_tag_symbol();

let attribute = Attribute::READONLY | Attribute::NON_ENUMERABLE | Attribute::PERMANENT;
let object = ObjectInitializer::new(context)
.property("E", f64::consts::E, attribute)
Expand All @@ -44,6 +46,11 @@ impl BuiltIn for Math {
.property("SQRT1_2", 0.5_f64.sqrt(), attribute)
.property("SQRT2", f64::consts::SQRT_2, attribute)
.property("PI", f64::consts::PI, attribute)
.property(
to_string_tag,
"Math",
Attribute::READONLY | Attribute::NON_ENUMERABLE | Attribute::CONFIGURABLE,
)
.function(Self::abs, "abs", 1)
.function(Self::acos, "acos", 1)
.function(Self::acosh, "acosh", 1)
Expand Down

0 comments on commit 5c1b005

Please sign in to comment.