Skip to content

Commit

Permalink
Merge 70f2ef4 into 2149bdc
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat authored May 23, 2020
2 parents 2149bdc + 70f2ef4 commit 5c092ba
Show file tree
Hide file tree
Showing 14 changed files with 211 additions and 174 deletions.
2 changes: 1 addition & 1 deletion boa/src/builtins/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ pub fn create(global: &Value) -> Value {
make_builtin_fn!(slice, named "slice", with length 2, of prototype);
make_builtin_fn!(some, named "some", with length 2, of prototype);

let array = make_constructor_fn(make_array, global, prototype);
let array = make_constructor_fn("Array", 1, make_array, global, prototype, true);

// Static Methods
make_builtin_fn!(is_array, named "isArray", with length 1, of array);
Expand Down
18 changes: 9 additions & 9 deletions boa/src/builtins/bigint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ pub fn to_string(this: &mut Value, args: &[Value], _ctx: &mut Interpreter) -> Re
))
}

// /// `BigInt.prototype.valueOf()`
// ///
// /// The `valueOf()` method returns the wrapped primitive value of a Number object.
// ///
// /// More information:
// /// - [ECMAScript reference][spec]
// /// - [MDN documentation][mdn]
// ///
/// `BigInt.prototype.valueOf()`
///
/// The `valueOf()` method returns the wrapped primitive value of a Number object.
///
/// More information:
/// - [ECMAScript reference][spec]
/// - [MDN documentation][mdn]
///
/// [spec]: https://tc39.es/ecma262/#sec-bigint.prototype.valueof
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/valueOf
pub fn value_of(this: &mut Value, _args: &[Value], _ctx: &mut Interpreter) -> ResultValue {
Expand All @@ -96,7 +96,7 @@ pub fn create(global: &Value) -> Value {
make_builtin_fn!(to_string, named "toString", with length 1, of prototype);
make_builtin_fn!(value_of, named "valueOf", of prototype);

make_constructor_fn(make_bigint, global, prototype)
make_constructor_fn("BigInt", 1, make_bigint, global, prototype, false)
}

/// Initialise the `BigInt` object on the global object.
Expand Down
2 changes: 1 addition & 1 deletion boa/src/builtins/boolean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub fn create(global: &Value) -> Value {
make_builtin_fn!(to_string, named "toString", of prototype);
make_builtin_fn!(value_of, named "valueOf", of prototype);

make_constructor_fn(construct_boolean, global, prototype)
make_constructor_fn("Boolean", 1, construct_boolean, global, prototype, true)
}

/// Initialise the `Boolean` object on the global object.
Expand Down
3 changes: 2 additions & 1 deletion boa/src/builtins/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ pub fn create(global: &Value) -> Value {
prototype.set_field_slice("message", Value::from(""));
prototype.set_field_slice("name", Value::from("Error"));
make_builtin_fn!(to_string, named "toString", of prototype);
make_constructor_fn(make_error, global, prototype)

make_constructor_fn("Error", 1, make_error, global, prototype, true)
}

/// Initialise the global object with the `Error` object.
Expand Down
Loading

0 comments on commit 5c092ba

Please sign in to comment.