Skip to main content

Bug Tracker

Side navigation

#6917 closed enhancement (worksforme)

Opened August 19, 2010 12:24AM UTC

Closed August 19, 2010 12:54AM UTC

Last modified August 19, 2010 12:29PM UTC

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 August 19, 2010 12:25AM UTC.

    patch to speed/jquery-basis.js

Change History (3)

Changed August 19, 2010 12:54AM UTC by dmethvin comment:1

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

Changed August 19, 2010 01:49AM UTC by mikevsamuel comment:2

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?

Changed August 19, 2010 12:29PM UTC by john comment:3

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