diff options
author | max99x <max99x@gmail.com> | 2011-06-25 10:29:45 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-06-25 10:29:45 +0300 |
commit | c7fab4204bee149b2e0c9b2ed02e2bd69e91c572 (patch) | |
tree | cf1709a11ed57cf9585113299a83bbfe31eae6be | |
parent | 2f3bd046bb52234771dce5c689141626370e26ce (diff) |
Made sure read() is defined locally rather than globally. This makes
no difference unless the module is wrapped in a closure.
-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) { |