From 060df09223f0d309fee5cd2b89ee2f627cf1bf87 Mon Sep 17 00:00:00 2001 From: Daniel Balla Date: Wed, 12 Dec 2018 11:57:18 +0100 Subject: [PATCH] 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 Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu --- src/runtime/GlobalObjectBuiltinFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/GlobalObjectBuiltinFunction.cpp b/src/runtime/GlobalObjectBuiltinFunction.cpp index bf558e2d4..669ba8ceb 100644 --- a/src/runtime/GlobalObjectBuiltinFunction.cpp +++ b/src/runtime/GlobalObjectBuiltinFunction.cpp @@ -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);