Bug Tracker

Modify

Ticket #3618 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

Remove Uses of .constructor

Reported by: john Owned by:
Priority: major Milestone: 1.3
Component: core Version: 1.2.6
Keywords: Cc:
Blocking: Blocked by:

Description

Using .constructor "type" checks tends to cause problems across iframes and the link. A better solution should be used.

Attachments

3618.diff Download (10.2 KB) - added by john 5 years ago.
3618.diff - Changes all primitive checks to use typeof, removed use of isType, converted isArray and isFunction to new style.
3618.2.diff Download (14.2 KB) - added by john 5 years ago.
All primitives are checked with typeof, undefined is checked with === undefined, objects are checked with isFunction or isArray, object checks use Object.prototype.toString.

Change History

Changed 5 years ago by john

3618.diff - Changes all primitive checks to use typeof, removed use of isType, converted isArray and isFunction to new style.

Changed 5 years ago by john

All primitives are checked with typeof, undefined is checked with === undefined, objects are checked with isFunction or isArray, object checks use Object.prototype.toString.

comment:1 Changed 5 years ago by john

I've outlined all of these changes in the new core style guideline:  Type Checks.

comment:2 Changed 5 years ago by john

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in SVN rev [5947].

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.