mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
LibJS: Pass prototype to Error constructors
This commit is contained in:
parent
0df4d2823a
commit
205ac0090d
5 changed files with 30 additions and 15 deletions
|
@ -70,7 +70,7 @@ Value FunctionConstructor::construct(Interpreter& interpreter)
|
|||
auto function_expression = parser.parse_function_node<FunctionExpression>();
|
||||
if (parser.has_errors()) {
|
||||
// FIXME: The parser should expose parsing error strings rather than just fprintf()'ing them
|
||||
return interpreter.heap().allocate<Error>("SyntaxError", "");
|
||||
return Error::create(interpreter.global_object(), "SyntaxError", "");
|
||||
}
|
||||
return function_expression->execute(interpreter);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue