From 31ca237614ebc44391c93e04ca02af6b51de05d2 Mon Sep 17 00:00:00 2001 From: "barraclough@apple.com" Date: Thu, 22 Sep 2011 23:57:01 +0000 Subject: [PATCH] Function.prototype.bind.length shoudl be 1. Rubber stamped by Olier Hunt. Source/JavaScriptCore: * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::addFunctionProperties): LayoutTests: * fast/js/function-bind-expected.txt: * fast/js/script-tests/function-bind.js: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95764 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 9 +++++++++ LayoutTests/fast/js/function-bind-expected.txt | 1 + LayoutTests/fast/js/script-tests/function-bind.js | 2 ++ Source/JavaScriptCore/ChangeLog | 9 +++++++++ Source/JavaScriptCore/runtime/FunctionPrototype.cpp | 2 +- 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 653eb8a..648be95 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,12 @@ +2011-09-22 Gavin Barraclough + + Function.prototype.bind.length shoudl be 1. + + Rubber stamped by Olier Hunt. + + * fast/js/function-bind-expected.txt: + * fast/js/script-tests/function-bind.js: + 2011-09-22 Csaba Osztrogonác [Qt][Mac]Unreviewed gardening. diff --git a/LayoutTests/fast/js/function-bind-expected.txt b/LayoutTests/fast/js/function-bind-expected.txt index 14379d5..5a4764c 100644 --- a/LayoutTests/fast/js/function-bind-expected.txt +++ b/LayoutTests/fast/js/function-bind-expected.txt @@ -27,6 +27,7 @@ PASS new abcAt(1) threw exception TypeError: 'function charAt() { [native code] }' is not a constructor (evaluating 'new abcAt(1)'). FAIL boundFunctionPrototypeAccessed should be false. Was true. +PASS Function.bind.length is 1 PASS successfullyParsed is true TEST COMPLETE diff --git a/LayoutTests/fast/js/script-tests/function-bind.js b/LayoutTests/fast/js/script-tests/function-bind.js index 22b50c3..434611e 100644 --- a/LayoutTests/fast/js/script-tests/function-bind.js +++ b/LayoutTests/fast/js/script-tests/function-bind.js @@ -58,4 +58,6 @@ Object.defineProperty(P, 'prototype', { get:function(){ boundFunctionPrototypeAc f instanceof P; shouldBeFalse('boundFunctionPrototypeAccessed'); +shouldBe('Function.bind.length', '1'); + var successfullyParsed = true; diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog index a4ea634..7691cb3 100644 --- a/Source/JavaScriptCore/ChangeLog +++ b/Source/JavaScriptCore/ChangeLog @@ -1,3 +1,12 @@ +2011-09-22 Gavin Barraclough + + Function.prototype.bind.length shoudl be 1. + + Rubber stamped by Olier Hunt. + + * runtime/FunctionPrototype.cpp: + (JSC::FunctionPrototype::addFunctionProperties): + 2011-09-22 Filip Pizlo PPC build fix. diff --git a/Source/JavaScriptCore/runtime/FunctionPrototype.cpp b/Source/JavaScriptCore/runtime/FunctionPrototype.cpp index 6cb6fb4..fdcfb85 100644 --- a/Source/JavaScriptCore/runtime/FunctionPrototype.cpp +++ b/Source/JavaScriptCore/runtime/FunctionPrototype.cpp @@ -61,7 +61,7 @@ void FunctionPrototype::addFunctionProperties(ExecState* exec, JSGlobalObject* g *callFunction = JSFunction::create(exec, globalObject, 1, exec->propertyNames().call, functionProtoFuncCall); putDirectWithoutTransition(exec->globalData(), exec->propertyNames().call, *callFunction, DontEnum); - JSFunction* bindFunction = JSFunction::create(exec, globalObject, 0, exec->propertyNames().bind, functionProtoFuncBind); + JSFunction* bindFunction = JSFunction::create(exec, globalObject, 1, exec->propertyNames().bind, functionProtoFuncBind); putDirectWithoutTransition(exec->globalData(), exec->propertyNames().bind, bindFunction, DontEnum); } -- 2.7.4