Skip to content

Commit

Permalink
Fix the Function.prototype object's length proprety (#5)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Daniel Balla [email protected]
  • Loading branch information
2 people authored and yichoi committed Dec 12, 2018
1 parent bbae70a commit 060df09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/GlobalObjectBuiltinFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ static Value builtinFunctionHasInstanceOf(ExecutionState& state, Value thisValue

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

g_functionObjectTag = *((size_t*)emptyFunction);
Expand Down

0 comments on commit 060df09

Please sign in to comment.