diff options
-rw-r--r-- | src/preamble.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/preamble.js b/src/preamble.js index 35121317..126ef6fa 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -576,8 +576,8 @@ function intArrayToString(array) { {{{ reSign }}} // Use console read if available, otherwise we are in a browser, use an XHR -if (!this['read']) { - this['read'] = function(url) { +if (this.read == undefined) { + var read = function(url) { // TODO: use mozResponseArrayBuffer/responseStream/etc. if available var xhr = new XMLHttpRequest(); xhr.open("GET", url, false); @@ -585,7 +585,7 @@ if (!this['read']) { xhr.send(null); if (xhr.status != 200 && xhr.status != 0) throw 'failed to open: ' + url; return xhr.responseText; - } + }; } function readBinary(filename) { |