Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Reflect built-in object #1033

Merged
merged 14 commits into from
Mar 10, 2021
7 changes: 4 additions & 3 deletions boa/src/builtins/function/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,10 @@ impl BuiltInFunctionObject {
// TODO?: 3.a. PrepareForTailCall
return context.call(this, &this_arg, &[]);
}
let arg_list = context
.extract_array_properties(&arg_array)?
.map_err(|()| arg_array)?;
let arg_array = arg_array.as_object().ok_or_else(|| {
context.construct_type_error("argList must be null, undefined or an object")
})?;
let arg_list = arg_array.create_list_from_array_like(&[], context)?;
// TODO?: 5. PrepareForTailCall
context.call(this, &this_arg, &arg_list)
}
Expand Down
3 changes: 3 additions & 0 deletions boa/src/builtins/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub mod math;
pub mod nan;
pub mod number;
pub mod object;
pub mod reflect;
pub mod regexp;
pub mod string;
pub mod symbol;
Expand All @@ -39,6 +40,7 @@ pub(crate) use self::{
number::Number,
object::for_in_iterator::ForInIterator,
object::Object as BuiltInObjectObject,
reflect::Reflect,
regexp::RegExp,
string::String,
symbol::Symbol,
Expand Down Expand Up @@ -86,6 +88,7 @@ pub fn init(context: &mut Context) {
SyntaxError::init,
EvalError::init,
UriError::init,
Reflect::init,
#[cfg(feature = "console")]
console::Console::init,
];
Expand Down
Loading