Closed Bug 400366 Opened 13 years ago Closed 13 years ago
[FIX] typeof Prototype == object since 2007/05/10
Loading the following url results in an XPC_NOT_ENOUGH_ARGS exception for calling nsIDOMWindowInternal.scroll. http://wii.com/jp/articles/mario-galaxy/crv/vol3/index.html#id=cv_mg-3-01-orchestra The offending line is.. $(window).scroll(TB_position) .. where the script is probably trying to use jQuery's scroll function, but is getting window.scroll. If I change the script to $("window").scroll(..), the exception isn't thrown. This started happening with 20070510 nightly builds; the page works fine in Firefox 22.214.171.124 and still fails with the latest trunk 20071018. http://bonsai.mozilla.org/cvsquery.cgi?date=explicit&mindate=2007-05-09+04&maxdate=2007-05-10+04 After doing some debugging of the jQuery $ function, it turns out it's going into the if condition on trunk because "typeof Prototype != "undefined"" and actually turns out to be object.
Regression from bug 370098. We should probably change Prototype to DOMPrototype at http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/dom/src/base/nsDOMClassInfo.cpp&rev=1.481&mark=577#570 and maybe Constructor to DOMConstructor?
Assignee: nobody → jst
Flags: blocking1.9? → blocking1.9+
jresig: How much of an issue is this with 2-yr old versions (0.30) of jQuery's $ function checking "typeof Prototype"? Should it only affect $(window) and a particular set of jQuery functions, so only a small number of websites should be affected?
Well, with this copy of jQuery, I would say that it's "not a very big deal" - HOWEVER - I would consider the introduction of a Prototype or Constructor variable to be a VERY BIG DEAL (and a very bad thing). I'm sure if the Prototype guys found out they'd have a coronary. But yeah, if these variables are DOM-specific, then they should probably have the DOM prefix.
Summary: typeof Prototype == object since 2007/05/10 → [FIX] typeof Prototype == object since 2007/05/10
should probably add a test for this before you check it in.
Comment on attachment 287476 [details] [diff] [review] Fix. Do we need to rename nsIDOMConstructor to nsIDOMDOMConstructor too?
Priority: -- → P2
Yeah, I just checked this in and did the rename (interface only, not the file). Marking FIXED.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.