aboutsummaryrefslogtreecommitdiff
path: root/tools/reproduceriter.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/reproduceriter.py')
-rwxr-xr-xtools/reproduceriter.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/reproduceriter.py b/tools/reproduceriter.py
index cc43e89a..5eb02fb7 100755
--- a/tools/reproduceriter.py
+++ b/tools/reproduceriter.py
@@ -316,10 +316,10 @@ if (typeof nagivator == 'undefined') {
return { play: function(){} };
};
var Worker = function(path) {
- //var Module = undefined; // hide main code
path = fixPath(path);
var workerCode = read(path);
- print('loaded worker ' + path + ' : ' + workerCode.substring(0, 50));
+ workerCode = workerCode.replace(/Module/g, 'zzModuleyy' + (Worker.id++)); // prevent collision with the global Module object. Note that this becomes global, so we need unique ids
+ print('loading worker ' + path + ' : ' + workerCode.substring(0, 50));
eval(workerCode); // will implement onmessage()
this.terminate = function(){};
@@ -337,12 +337,18 @@ if (typeof nagivator == 'undefined') {
}
};
};
+ Worker.id = 0;
var screen = {
width: 800,
height: 600,
availWidth: 800,
availHeight: 600,
};
+ var console = {
+ log: function(x) {
+ print(x);
+ },
+ };
}
var Recorder = (function() {