aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-11-09 10:34:06 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-11-09 10:34:06 -0800
commitc94fbc8db50b1bb8ba9c31bf6e93f2c733cac253 (patch)
tree56649cf158464b8daff342c174171356138fc561
parentd420405180ee7910511c6a89572ce9f823880f3a (diff)
optimize fround polyfill a tiny bit
-rw-r--r--src/preamble.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 3238c99c..3e76e503 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -1076,8 +1076,10 @@ Math.imul = Math['imul'];
#if PRECISE_F32
#if PRECISE_F32 == 1
-var froundBuffer = new Float32Array(1);
-if (!Math['fround']) Math['fround'] = function(x) { froundBuffer[0] = x; return froundBuffer[0] };
+if (!Math['fround']) {
+ var froundBuffer = new Float32Array(1);
+ Math['fround'] = function(x) { froundBuffer[0] = x; return froundBuffer[0] };
+}
#else // 2
if (!Math['fround']) Math['fround'] = function(x) { return x };
#endif