Skip to content

Commit

Permalink
Merge e12d9cb into 07d5219
Browse files Browse the repository at this point in the history
  • Loading branch information
tofpie authored Jan 18, 2021
2 parents 07d5219 + e12d9cb commit 77f736c
Show file tree
Hide file tree
Showing 7 changed files with 626 additions and 54 deletions.
7 changes: 4 additions & 3 deletions boa/src/builtins/function/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,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

0 comments on commit 77f736c

Please sign in to comment.