Bug 140295 - (function(arg1) {}.bind(window)).length results in 0
Summary: (function(arg1) {}.bind(window)).length results in 0
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-01-09 10:03 PST by sarimarton
Modified: 2020-08-21 11:49 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sarimarton 2015-01-09 10:03:37 PST
Simple as that:

(function(arg1) {}.bind(window)).length results in 0 instead of 1.
Comment 1 Radar WebKit Bug Importer 2015-01-09 11:47:05 PST
<rdar://problem/19429047>
Comment 2 Daniel Bates 2015-01-12 20:40:47 PST
What is the version of Safari/WebKit you are using? What is the platform/OS version? On Mac, you can find the Safari/WebKit and OS version information in Safari > About Safari and Apple (menu) > About this Mac, respectively.

I'm neither able to reproduce this bug using shipping Safari Version 8.0.2 (10600.2.5) on 10.10.1 (14B25) nor with the latest WebKit nightly r178255 on the same OS. I also was unable to reproduce this bug using Mac nightly r178109 (2015-01-08 15:33:34 GMT). That is, the expression "(function(arg1) {}.bind(window)).length" evaluates to 1 in Web Inspector.
Comment 3 sarimarton 2015-01-13 05:11:03 PST
I'm using PhantomJS 1.9.7 on Windows and Unix.
Comment 4 Alexey Shvayka 2020-08-21 11:49:24 PDT
(In reply to sarimarton from comment #0)
> (function(arg1) {}.bind(window)).length results in 0 instead of 1.

(In reply to sarimarton from comment #3)
> I'm using PhantomJS 1.9.7 on Windows and Unix.

At that time, PhantomJS was shipped with a rather outdated version of WebKit.
As of v2.1.1 (macOS), Function.prototype.bind returns correct "length" of 1.

Also works as expected in Safari 13.1 and r265666.