Issue #1442 Follow-up: Fix debug assertion in JSFun

Change in d5020b69bd introduced a debug build crash, this fixes the crash by properly porting the changes to an assertion as mentioned in issue #2410.
This commit is contained in:
Gaming4JC 2023-12-30 22:16:03 -05:00 • committed by roytam1
commit 10a37ae467

View file

@ -2424,11 +2424,7 @@ namespace detail {
JS_PUBLIC_API(void)
CheckIsValidConstructible(const Value& calleev)
{
JSObject* callee = &calleev.toObject();
if (callee->is<JSFunction>())
MOZ_ASSERT(callee->as<JSFunction>().isConstructor());
else
MOZ_ASSERT(callee->constructHook() != nullptr);
MOZ_ASSERT(calleev.toObject().isConstructor());
}
} // namespace detail