Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#794 closed defect (fixed)

dojo.lang.isAlien intermittently broken on IE6/7

Reported by: dojo@… Owned by: Ben Lowery
Priority: high Milestone: 1.0
Component: Core Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

For some instances of IE6 / IE7 Beta 2, dojo.lang.isAlien bombs out attempting to turn the a function like window.setTimeout into a string to perform the RegEx?, saying "Object does not support this action".

Easiest fix seems to be to lift the isAlien from Crockford.

Attachments (1)

test_lang_common.html (1.2 KB) - added by dojo@… 13 years ago.
Test case for lang.common's isAlien

Download all attachments as: .zip

Change History (12)

comment:1 Changed 13 years ago by dylan

Milestone: 0.5

comment:2 Changed 13 years ago by dylan

Owner: changed from anonymous to alex

Changed 13 years ago by dojo@…

Attachment: test_lang_common.html added

Test case for lang.common's isAlien

comment:3 Changed 13 years ago by dojo@…

I've attached a test case that should exercise the dojo.lang.isAlien function appropriately, but I'm not able to break IE6 or IE7 with it. I guess this one can be marked closed, as I can no longer reproduce the bug.

comment:4 Changed 12 years ago by dojo@…

Oop, now it's busted again. Yay intermittent bugs.

Here's what I added to lang.common, just after the normal isAlien def: (function(){

if((dojo.render.html.capable)&&(dojo.render.html.ie)){

dojo.lang.isAlien = function(/*anything*/ it){

return it !== null && dojo.lang.isObject(a) && typeof a.constructor != 'function';

};

}

})();

comment:5 Changed 12 years ago by guest

Actually, that code is busted. This is better:

(function(){
  if((dojo.render.html.capable)&&(dojo.render.html.ie)){
    dojo.lang.isAlien = function(/*anything*/ it) {
      if(!it) { return false; }
      return dojo.lang.isObject(it) && typeof(it.constructor) != 'function';
    }
  }
})();

comment:6 Changed 12 years ago by Adam Peller

Owner: changed from alex to Ben Lowery

Hey Ben. You're a committer now, you can have this one :) Can you please assess whether we still need this?

comment:7 Changed 12 years ago by Ben Lowery

Unsure if this is still needed. Let's leave it open just in case, but defer it.

comment:8 Changed 12 years ago by bill

Milestone: 0.91.0

comment:9 Changed 12 years ago by Adam Peller

sounds like this is no longer needed. can we close?

comment:10 Changed 12 years ago by Ben Lowery

Resolution: fixed
Status: newclosed

Resolving as Fixed. Can't repro any more.

comment:11 in reply to:  10 Changed 12 years ago by guest

Replying to blowery:

Resolving as Fixed. Can't repro any more.

I ran into a similar issue explained here and it ended up being related to if the Ask.com Toolbar was installed. Having that installed caused isAlien() to throw an exception. I resolved it by just wrapping it in a try/catch and defaulting on returning false. Just an FYI.

Chris

Note: See TracTickets for help on using tickets.