#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: |
Description
_AssertFailure: [Object: name: doh._AssertFailure ]: assertFalse('true') failed [Object: name: doh._AssertFailure ] ERROR IN: function isFunction(t){ t.assertTrue(dojo.isFunction(new Function())); t.assertTrue(dojo.isFunction(isFunction)); if(dojo.isBrowser){ // test the Safari workaround for NodeList t.assertFalse(dojo.isFunction(dojo.doc.getElementsByName("html"))); } } FAILED test: isFunction 0 ms
Attachments (1)
Change History (7)
comment:1 Changed 12 years ago by
Priority: | normal → high |
---|
Changed 12 years ago by
Attachment: | 8937.patch added |
---|
comment:2 Changed 12 years ago by
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 12 years ago by
Summary: | isFunction() unit test failing on opera → [patch][ccla]isFunction() unit test failing on opera |
---|
comment:4 Changed 12 years ago by
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 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
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 12 years ago by
Filed a report at the wizard site above, for now. Reference is DSK-249581 at bugs.opera.com
Workaround to strange Opera bug