Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#6917 closed enhancement (worksforme)

Replacing uses of arguments.callee with the function name.

Reported by: mikevsamuel Owned by:
Priority: Milestone: 1.4.3
Component: core Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:

Description

The attached patch replaces uses of arguments.callee with the shorter, and semantically equivalent use of the function's name.

Please consider this patch as it will make future compatibility with EcmaScript 5 strict mode and harmony easier.

The patch is from http://github.com/jquery/jquery.git as of 18 August 2010.

From the EcmaScript 5 spec: Annex C (informative) The Strict Mode of ECMAScript ...

  • Arguments objects for strict mode functions define non-configurable accessor properties named "caller" and "callee" which throw a TypeError exception on access (10.6).

...

Attachments (1)

patch (2.8 KB) - added by mikevsamuel 9 years ago.
patch to speed/jquery-basis.js

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by mikevsamuel

Attachment: patch added

patch to speed/jquery-basis.js

comment:1 Changed 9 years ago by dmethvin

Resolution: worksforme
Status: newclosed

Agreed about ES5 compat, but I think all instances of arguments.callee have already been exorcised in the current 1.4.3 release. The patch seems to be against event.js but that code is closer to 1.3.2; the code doesn't look that way currently:

http://github.com/jquery/jquery/blob/master/src/event.js#L44

comment:2 Changed 9 years ago by mikevsamuel

Is jquery=basis built from files under src?

I see arguments.callee at http://github.com/jquery/jquery/blob/master/speed/jquery-basis.js#L2468

What should I be checking out to generate useful patches?

comment:3 Changed 9 years ago by john

jquery-basis.js is an old copy of jQuery that we use for performance comparisions - not the current version of jQuery.

Note: See TracTickets for help on using tickets.