Changeset 96536 in webkit


Ignore:
Timestamp:
Oct 3, 2011 1:51:21 PM (13 years ago)
Author:
abarth@webkit.org
Message:

garden-o-matic should work in Safari 5.1
https://bugs.webkit.org/show_bug.cgi?id=69290

Reviewed by Sam Weinig.

My old implementation of bind was too clever by half. This one seems
to work better, at least according to this test.

  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base.js:
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base_unittests.js:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base.js

    r95595 r96536  
    3232    Function.prototype.bind = function(thisObject) {
    3333        var method = this;
    34         var boundArguments = [].concat(arguments).slice(1);
     34        var boundArguments = [];
     35        for (var i = 1; i < arguments.length; ++i) {
     36            boundArguments.push(arguments[i]);
     37        }
    3538        return function() {
    36             return method.apply(thisObject, boundArguments.concat(arguments));
     39            var actualParameters = [];
     40            for (var i = 0; i < boundArguments.length; ++i) {
     41                actualParameters.push(boundArguments[i]);
     42            }
     43            for (var i = 0; i < arguments.length; ++i) {
     44                actualParameters.push(arguments[i]);
     45            }
     46            return method.apply(thisObject, actualParameters);
    3747        }
    3848    }
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base_unittests.js

    r95595 r96536  
    2727
    2828module("base");
     29
     30test("bind", 3, function() {
     31    function func(a, b) {
     32        equals(this.prop, 5);
     33        equals(a, "banana");
     34        deepEqual(b, [2, 3, 4]);
     35    }
     36
     37    var thisObject = {
     38        "prop": 5
     39    };
     40
     41    var bound = func.bind(thisObject, "banana");
     42    bound([2, 3, 4]);
     43});
     44
    2945
    3046test("joinPath", 1, function() {
  • trunk/Tools/ChangeLog

    r96523 r96536  
     12011-10-03  Adam Barth  <abarth@webkit.org>
     2
     3        garden-o-matic should work in Safari 5.1
     4        https://bugs.webkit.org/show_bug.cgi?id=69290
     5
     6        Reviewed by Sam Weinig.
     7
     8        My old implementation of bind was too clever by half.  This one seems
     9        to work better, at least according to this test.
     10
     11        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base.js:
     12        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base_unittests.js:
     13
    1142011-09-29  Ademar de Souza Reis Jr.  <ademar.reis@openbossa.org>
    215
Note: See TracChangeset for help on using the changeset viewer.