From 4f07b0b3e6a7b369a050351f0dc064c2ab13c554 Mon Sep 17 00:00:00 2001 From: Jason Williams Date: Mon, 9 Mar 2020 17:16:25 +0000 Subject: [PATCH] updating function objects --- boa/src/builtins/function_object.rs | 6 +++--- boa/src/builtins/number/mod.rs | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/boa/src/builtins/function_object.rs b/boa/src/builtins/function_object.rs index f90d4b3e2bf..0b226883b01 100644 --- a/boa/src/builtins/function_object.rs +++ b/boa/src/builtins/function_object.rs @@ -37,14 +37,14 @@ pub struct Function { pub internal_slots: Box>, /// Properties pub properties: Box>, - // 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; diff --git a/boa/src/builtins/number/mod.rs b/boa/src/builtins/number/mod.rs index 74bc723a5a1..3195d14ef75 100644 --- a/boa/src/builtins/number/mod.rs +++ b/boa/src/builtins/number/mod.rs @@ -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),