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:
parent
205ac0090d
commit
f6d57c82f6
21 changed files with 66 additions and 24 deletions
|
@ -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)); \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue