mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-01 07:52:50 +00:00
LibJS: CallExpression shouldn't throw TypeError or non-constructor call
This unbreaks the entire test suite. :^)
This commit is contained in:
parent
90f8a7a36b
commit
b251091a6a
Notes:
sideshowbarker
2024-07-19 07:28:30 +09:00
Author: https://github.com/awesomekling
Commit: b251091a6a
1 changed files with 1 additions and 1 deletions
|
@ -94,7 +94,7 @@ Value CallExpression::execute(Interpreter& interpreter) const
|
||||||
|
|
||||||
if (!callee.is_object()
|
if (!callee.is_object()
|
||||||
|| !callee.as_object().is_function()
|
|| !callee.as_object().is_function()
|
||||||
|| (callee.as_object().is_native_function() && !static_cast<NativeFunction&>(callee.as_object()).has_constructor())) {
|
|| (is_new_expression() && (callee.as_object().is_native_function() && !static_cast<NativeFunction&>(callee.as_object()).has_constructor()))) {
|
||||||
String error_message;
|
String error_message;
|
||||||
auto call_type = is_new_expression() ? "constructor" : "function";
|
auto call_type = is_new_expression() ? "constructor" : "function";
|
||||||
if (m_callee->is_identifier() || m_callee->is_member_expression()) {
|
if (m_callee->is_identifier() || m_callee->is_member_expression()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue