Opened 9 years ago
Closed 9 years ago
#15876 closed defect (fixed)
_loadTest.js gets exception after alternate AMD loader support (IE8)
Reported by: | bill | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | undecided | Milestone: | 1.8.1 |
Component: | Dijit | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
After my changes in #15616, Tooltip_quirks_mouse.html is hanging on IE8, when loading ../quirks.html?file=test_Tooltip.html. Problem can be reproduced by loading that URL directly too.
The problem is in the script related code:
for(var i=0; i <scripts.length; i++){ var script = scripts[i]; if(!script['_oldGetAttribute']){ var src = script.getAttribute('_oldsrc'); if(src){ script._oldGetAttribute = script.getAttribute; script.getAttribute = function(attr){ if(/^src$/i.test(attr))attr='_oldsrc';return script._oldGetAttribute(attr) }; } } }
which is likely running while the AMD loader is inserting <script> tags to load new modules. It gets an exception about _oldGetAttribute.
Attachments (1)
Change History (8)
comment:1 Changed 9 years ago by
Owner: | changed from bill to Douglas Hays |
---|---|
Status: | new → assigned |
Summary: | _loadTest.js broken after AMD loader support → _loadTest.js broken after alternate AMD loader support |
comment:2 Changed 9 years ago by
Description: | modified (diff) |
---|---|
Summary: | _loadTest.js broken after alternate AMD loader support → _loadTest.js broken after alternate AMD loader support (IE8) |
comment:3 Changed 9 years ago by
Description: | modified (diff) |
---|---|
Milestone: | tbd → 1.8.1 |
Summary: | _loadTest.js broken after alternate AMD loader support (IE8) → _loadTest.js gets exception after alternate AMD loader support (IE8) |
Changed 9 years ago by
Attachment: | 15876.patch added |
---|
comment:4 Changed 9 years ago by
For some reason I'm unable to recreate this, and the code is needed since the src attributes of the scripts can be relative and loading them via _loadTests changes the base path. I tweaked the code to make the script variable local. Please lte me know if this fixes the problem.
comment:5 Changed 9 years ago by
That does fix the exception loading dijit/tests/quirks.html?file=test_Tooltip.html, so it's definitely an improvement.
It still seems like _loadTest.js will fail with an AMD syntax file though, because that block of code will affect the dynamically inserted <script> tags which already have the right path. I didn't try it though.
comment:6 Changed 9 years ago by
dijit/tests/quirks.html?file=layout/ContentPane-auto-require.html loaded and ran for me on IE8, but so did test_Tooltip.html
That loop is incorrect because the closure is referencing the variable "script", but then you change the value of script afterwards. In other words, getAttribute() for any script will try to call _oldGetAttribute() on the last script in the file.
Having said that though, I will let you update it because I don't understand why that code to override getAttribute() is there in the first place, and it might no longer make sense with AMD (which dynamically injects script tags).