Skip to content

Commit

Permalink
updating function objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Williams authored and jasonwilliams committed Apr 19, 2020
1 parent f62b7b5 commit 4f07b0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions boa/src/builtins/function_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ pub struct Function {
pub internal_slots: Box<HashMap<String, Value>>,
/// Properties
pub properties: Box<HashMap<String, Property>>,
// Function Kind
/// Function Kind
pub function_kind: FunctionKind,
// is constructor??
/// is constructor??
pub is_constructor: bool,
}

impl Function {
// https://tc39.es/ecma262/#sec-functionallocate
/// https://tc39.es/ecma262/#sec-functionallocate
pub fn allocate(proto: Value, mut kind: FunctionKind) -> Function {
let needs_construct: bool;

Expand Down
5 changes: 4 additions & 1 deletion boa/src/builtins/number/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ fn to_number(value: &Value) -> Value {
to_value(0)
}
}
ValueData::Function(_) | ValueData::Symbol(_) | ValueData::Undefined => to_value(f64::NAN),
ValueData::FunctionObj(_)
| ValueData::Function(_)
| ValueData::Symbol(_)
| ValueData::Undefined => to_value(f64::NAN),
ValueData::Integer(i) => to_value(f64::from(i)),
ValueData::Object(ref o) => (o).deref().borrow().get_internal_slot("NumberData"),
ValueData::Null => to_value(0),
Expand Down

0 comments on commit 4f07b0b

Please sign in to comment.