1
Fork 0
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:
Andreas Kling 2020-04-17 19:31:48 +02:00
parent 0df4d2823a
commit 205ac0090d
5 changed files with 30 additions and 15 deletions

View file

@ -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);
}