[Webkit-unassigned] [Bug 64900] New: `Function.prototype.apply` is non-ECMAScript 5 conformant

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 20 16:05:49 PDT 2011


           Summary: `Function.prototype.apply` is non-ECMAScript 5
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: ksgoncharov at gmail.com

According to section of the spec, `Function.prototype.apply` should accept an array-like object as its second argument. See steps 2 and 3:

> 2. If Type(argArray) is not Object, then throw a TypeError exception.
> 3. Let len be the result of calling the [[Get]] internal method of argArray with argument "length".

As of the latest WebKit nightly, invocations such as `(function(){}).apply(null, {length: 0})` throw a `TypeError`. This is inconsistent with the above algorithm.

Steps to Reproduce

1) Open the Web Inspector.
2) Enter `(function(){ return [].slice.call(arguments); }).apply(null, {0: 1, 1: 2, length: 2})`.

Actual Results

A `TypeError` is thrown.

Expected Results

The function should return `[1, 2]`.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list