Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#8937 closed defect (fixed)

[patch][ccla]isFunction() unit test failing on opera

Reported by: bill Owned by: anonymous
Priority: high Milestone: 1.3
Component: Core Version: 1.3.0b3
Keywords: Cc: James Burke, dylanks
Blocked By: Blocking:


      _AssertFailure: [Object:

 name: doh._AssertFailure
]: assertFalse('true') failed

 name: doh._AssertFailure
      ERROR IN:
 		 function isFunction(t){
			t.assertTrue(dojo.isFunction(new Function()));
			if(dojo.isBrowser){ // test the Safari workaround for NodeList
  FAILED test: isFunction 0 ms

Attachments (1)

8937.patch (490 bytes) - added by Adam Peller 13 years ago.
Workaround to strange Opera bug

Download all attachments as: .zip

Change History (7)

comment:1 Changed 13 years ago by bill

Priority: normalhigh

Changed 13 years ago by Adam Peller

Attachment: 8937.patch added

Workaround to strange Opera bug

comment:2 Changed 13 years ago by Adam Peller

Cc: James Burke dylanks added

It's failing on the test case for isFunction(nodelist). Strangely, typeof it is "object" when the arg is a nodelist, and comparing it to "function" is false when done outside a function, but inside a function, comparing typeof it to "function" is true! Comparing typeof it to "object" is also true. How can that be, you wonder? Me too.

Assigning the typeof expression to a variable before doing the assignment comes up with the right result.

Bill, James, is it worth polluting base with the extra bytes to cover this? Seems about as low risk a patch as you can get.

Dylan, do you know how to contact Opera?

var x=document.getElementsByName("html");
alert(typeof x); // object
alert((typeof x) == "object"); // true
alert((typeof x) == "function"); // false, works here!

var foo = function(){
  var y=document.getElementsByName("html");
  alert(typeof y); // object
  alert((typeof y) == "object"); // true
  alert((typeof y) == "function"); // true, should be false

comment:3 Changed 13 years ago by Adam Peller

Summary: isFunction() unit test failing on opera[patch][ccla]isFunction() unit test failing on opera

comment:4 Changed 13 years ago by James Burke

Adam, I'm fine with it going in base for now, but we should remove it as soon as Opera has a fix. I imagine it is something they would want to fix sooner rather than later.

comment:5 Changed 13 years ago by James Burke

Resolution: fixed
Status: newclosed

I applied peller's patch in [17077], but we should report the issue to Opera. If Dylan does not have a direct contact, maybe we can use this to report the bug:

comment:6 Changed 13 years ago by Adam Peller

Filed a report at the wizard site above, for now. Reference is DSK-249581 at

Note: See TracTickets for help on using tickets.