Skip to content

Commit 060df09

Browse files
Daniel Ballarerobika
authored andcommitted
Fix the Function.prototype object's length proprety (#5)
According to https://www.ecma-international.org/ecma-262/6.0/#sec-properties-of-the-function-prototype-object the Function.prototype object's length property should always be 0. This issue was found by running jerryscript-project/jerryscript#642. Co-authored-by: Robert Fancsik <frobert@inf.u-szeged.hu> Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
1 parent bbae70a commit 060df09

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/runtime/GlobalObjectBuiltinFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static Value builtinFunctionHasInstanceOf(ExecutionState& state, Value thisValue
234234

235235
void GlobalObject::installFunction(ExecutionState& state)
236236
{
237-
FunctionObject* emptyFunction = new FunctionObject(state, new CodeBlock(state.context(), NativeFunctionInfo(state.context()->staticStrings().Function, builtinFunctionEmptyFunction, 1, nullptr, 0)),
237+
FunctionObject* emptyFunction = new FunctionObject(state, new CodeBlock(state.context(), NativeFunctionInfo(state.context()->staticStrings().Function, builtinFunctionEmptyFunction, 0, nullptr, 0)),
238238
FunctionObject::__ForGlobalBuiltin__);
239239

240240
g_functionObjectTag = *((size_t*)emptyFunction);

0 commit comments

Comments
 (0)