Skip to content

Commit 3b72aa1

Browse files
committed
core: finalize NewExpression resolution changes and add diagnostic logging
1 parent 74c97df commit 3b72aa1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/core/eval.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7045,6 +7045,9 @@ fn evaluate_expr_new<'gc>(
70457045
CtorRef::Other(v) => v,
70467046
};
70477047

7048+
// Diagnostic: log resolved constructor value
7049+
log::debug!("evaluate_expr_new - resolved constructor value = {:?}", func_val);
7050+
70487051
match func_val {
70497052
Value::Object(obj) => {
70507053
if let Some(cl_ptr) = object_get_key_value(&obj, "__closure__") {
@@ -7114,6 +7117,9 @@ fn evaluate_expr_new<'gc>(
71147117
&& let Value::String(name) = &*native_name.borrow()
71157118
{
71167119
let name_str = crate::unicode::utf16_to_utf8(name);
7120+
if name_str == "Object" {
7121+
return Ok(crate::js_class::handle_object_constructor(mc, &eval_args, env)?);
7122+
}
71177123
if matches!(
71187124
name_str.as_str(),
71197125
"Error" | "ReferenceError" | "TypeError" | "RangeError" | "SyntaxError"

0 commit comments

Comments
 (0)