Changes between Version 1 and Version 2 of Ticket #15876, comment 3


Ignore:
Timestamp:
Aug 21, 2012, 10:55:46 AM (9 years ago)
Author:
bill
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15876, comment 3

    v1 v2  
    1 That loop is incorrect because the closure is referencing the variable "script", but then you change the value of script afterwards.   In other words, if you loop over two scripts, and then afterwards call script1.getAttribute(), that will in turn call script2._oldGetAttribute(), accessing the attribute from a completely different node.
     1That 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.
    22
    33Having 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).