1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00

LibJS: Pass prototype to Function constructors

This commit is contained in:
Andreas Kling 2020-04-17 19:59:32 +02:00
parent 205ac0090d
commit f6d57c82f6
21 changed files with 66 additions and 24 deletions

View file

@ -31,7 +31,7 @@
namespace JS {
ErrorConstructor::ErrorConstructor()
: NativeFunction("Error")
: NativeFunction("Error", *interpreter().function_prototype())
{
put("prototype", interpreter().error_prototype());
put("length", Value(1));
@ -56,6 +56,7 @@ Value ErrorConstructor::construct(Interpreter& interpreter)
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName) \
ConstructorName::ConstructorName() \
: NativeFunction(*interpreter().function_prototype()) \
{ \
put("prototype", interpreter().snake_name##_prototype()); \
put("length", Value(1)); \