Skip to content

Commit

Permalink
Merge de137b2 into 408e49e
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat authored Mar 1, 2022
2 parents 408e49e + de137b2 commit 435c08e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions boa_engine/src/builtins/error/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ impl BuiltIn for EvalError {
fn init(context: &mut Context) -> JsValue {
let _timer = Profiler::global().start_event(Self::NAME, "init");

let error_constructor = context.standard_objects().error_object().constructor();
let error_prototype = context.standard_objects().error_object().prototype();

let attribute = Attribute::WRITABLE | Attribute::NON_ENUMERABLE | Attribute::CONFIGURABLE;
let eval_error_object = ConstructorBuilder::with_standard_object(
context,
Expand All @@ -48,6 +50,7 @@ impl BuiltIn for EvalError {
.name(Self::NAME)
.length(Self::LENGTH)
.inherit(error_prototype)
.custom_prototype(error_constructor)
.property("name", Self::NAME, attribute)
.property("message", "", attribute)
.build();
Expand Down
3 changes: 3 additions & 0 deletions boa_engine/src/builtins/error/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ impl BuiltIn for RangeError {
fn init(context: &mut Context) -> JsValue {
let _timer = Profiler::global().start_event(Self::NAME, "init");

let error_constructor = context.standard_objects().error_object().constructor();
let error_prototype = context.standard_objects().error_object().prototype();

let attribute = Attribute::WRITABLE | Attribute::NON_ENUMERABLE | Attribute::CONFIGURABLE;
let range_error_object = ConstructorBuilder::with_standard_object(
context,
Expand All @@ -46,6 +48,7 @@ impl BuiltIn for RangeError {
.name(Self::NAME)
.length(Self::LENGTH)
.inherit(error_prototype)
.custom_prototype(error_constructor)
.property("name", Self::NAME, attribute)
.property("message", "", attribute)
.build();
Expand Down
3 changes: 3 additions & 0 deletions boa_engine/src/builtins/error/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ impl BuiltIn for ReferenceError {
fn init(context: &mut Context) -> JsValue {
let _timer = Profiler::global().start_event(Self::NAME, "init");

let error_constructor = context.standard_objects().error_object().constructor();
let error_prototype = context.standard_objects().error_object().prototype();

let attribute = Attribute::WRITABLE | Attribute::NON_ENUMERABLE | Attribute::CONFIGURABLE;
let reference_error_object = ConstructorBuilder::with_standard_object(
context,
Expand All @@ -45,6 +47,7 @@ impl BuiltIn for ReferenceError {
.name(Self::NAME)
.length(Self::LENGTH)
.inherit(error_prototype)
.custom_prototype(error_constructor)
.property("name", Self::NAME, attribute)
.property("message", "", attribute)
.build();
Expand Down
3 changes: 3 additions & 0 deletions boa_engine/src/builtins/error/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ impl BuiltIn for SyntaxError {
fn init(context: &mut Context) -> JsValue {
let _timer = Profiler::global().start_event(Self::NAME, "init");

let error_constructor = context.standard_objects().error_object().constructor();
let error_prototype = context.standard_objects().error_object().prototype();

let attribute = Attribute::WRITABLE | Attribute::NON_ENUMERABLE | Attribute::CONFIGURABLE;
let syntax_error_object = ConstructorBuilder::with_standard_object(
context,
Expand All @@ -48,6 +50,7 @@ impl BuiltIn for SyntaxError {
.name(Self::NAME)
.length(Self::LENGTH)
.inherit(error_prototype)
.custom_prototype(error_constructor)
.property("name", Self::NAME, attribute)
.property("message", "", attribute)
.build();
Expand Down
3 changes: 3 additions & 0 deletions boa_engine/src/builtins/error/type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ impl BuiltIn for TypeError {
fn init(context: &mut Context) -> JsValue {
let _timer = Profiler::global().start_event(Self::NAME, "init");

let error_constructor = context.standard_objects().error_object().constructor();
let error_prototype = context.standard_objects().error_object().prototype();

let attribute = Attribute::WRITABLE | Attribute::NON_ENUMERABLE | Attribute::CONFIGURABLE;
let type_error_object = ConstructorBuilder::with_standard_object(
context,
Expand All @@ -52,6 +54,7 @@ impl BuiltIn for TypeError {
.name(Self::NAME)
.length(Self::LENGTH)
.inherit(error_prototype)
.custom_prototype(error_constructor)
.property("name", Self::NAME, attribute)
.property("message", "", attribute)
.build();
Expand Down
3 changes: 3 additions & 0 deletions boa_engine/src/builtins/error/uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ impl BuiltIn for UriError {
fn init(context: &mut Context) -> JsValue {
let _timer = Profiler::global().start_event(Self::NAME, "init");

let error_constructor = context.standard_objects().error_object().constructor();
let error_prototype = context.standard_objects().error_object().prototype();

let attribute = Attribute::WRITABLE | Attribute::NON_ENUMERABLE | Attribute::CONFIGURABLE;
let uri_error_object = ConstructorBuilder::with_standard_object(
context,
Expand All @@ -47,6 +49,7 @@ impl BuiltIn for UriError {
.name(Self::NAME)
.length(Self::LENGTH)
.inherit(error_prototype)
.custom_prototype(error_constructor)
.property("name", Self::NAME, attribute)
.property("message", "", attribute)
.build();
Expand Down

0 comments on commit 435c08e

Please sign in to comment.