Permalink
Browse files

Merge branch 'master' into crap

  • Loading branch information...
2 parents 44efb21 + 8e6f7b7 commit b188b65a672760a38b304cdbf9412660dbe04f6c David Humphrey committed Oct 26, 2011
Showing with 11 additions and 3 deletions.
  1. +11 −3 processing.js
View
14 processing.js
@@ -19746,10 +19746,18 @@
loadSketchFromSources(canvas[i], filenames);
}
}
-
+//dh: custom patch for this processing.js, see https://processing-js.lighthouseapp.com/projects/41284-processingjs/tickets/1740-processinginit-uses-a-nodelist-as-if-its-an-array-which-can-cause-race-conditions#ticket-1740-2
// also process all <script>-indicated sketches, if there are any
- var scripts = document.getElementsByTagName('script');
- var s, source, instance;
+ var s, last, source, instance,
+ nodelist = document.getElementsByTagName('script'),
+ scripts = [];
+
+ // snapshoot the DOM, as the nodelist is only a DOM view, and
+ // always up to date
+ for (var s=nodelist.length-1; s>=0; s--) {
+ scripts.push(nodelist[s]);
+ }
+
for (s = 0; s < scripts.length; s++) {
var script = scripts[s];
if (!script.getAttribute) {

0 comments on commit b188b65

Please sign in to comment.