Bug Tracker

Opened 10 years ago

Closed 10 years ago

#13291 closed feature (notabug)

Optimize jQuery.type() for 2.0

Reported by: jdalton Owned by:
Priority: low Milestone: None
Component: core Version: git
Keywords: Cc:
Blocked by: Blocking:

Description

I noticed in jQuery 2.0 jQuery.type has:

`

return typeof obj === "object"
typeof obj === "function" ?

class2type[ core_toString.call(obj) ] .... `

Modern browsers no longer have the old browser issue of reporting regexes as typeof function, sothe `typeof obj === "function" guard can be removed.

Change History (7)

comment:1 Changed 10 years ago by dmethvin

Component: unfiledcore
Milestone: None2.0
Priority: undecidedlow
Status: newopen

Might be worth going through to see where we could use typeof directly now.

comment:2 Changed 10 years ago by Rick Waldron

We have a pull request for this...

comment:3 Changed 10 years ago by dmethvin

Resolution: fixed
Status: openclosed

comment:4 Changed 10 years ago by dmethvin

Resolution: fixed
Status: closedreopened

comment:5 Changed 10 years ago by Dave Methvin

Resolution: fixed
Status: reopenedclosed

Revert "Fix #13291, no longer need the functionish-regex guard."

Turns out this is still needed by Safari 5.1, which we're still supporting.

This reverts commit c4b1da40075532e4f14821b1519ae0ef6665bf1e.

Changeset: aa3c92979a723cd972bf37c766c3b4a63cc23fdb

comment:6 Changed 10 years ago by dmethvin

Resolution: fixed
Status: closedreopened

comment:7 Changed 10 years ago by dmethvin

Milestone: 2.0None
Resolution: notabug
Status: reopenedclosed
Note: See TracTickets for help on using tickets.