summaryrefslogtreecommitdiff
path: root/src/preamble.js
diff options
context:
space:
mode:
authormax99x <max99x@gmail.com>2011-08-17 07:44:59 +0300
committermax99x <max99x@gmail.com>2011-08-17 07:44:59 +0300
commit25630c272ddd8d260f4bd8d60db5f2b01b6a00e8 (patch)
tree8708398c75748234299abae35dbdb3f8a095a5c6 /src/preamble.js
parentee4b6ebf353585fb0eb0809a4b677f5694a9ba79 (diff)
parentc2d71f807a84cb1cfad154c59e9d6859fff3e631 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/preamble.js')
-rw-r--r--src/preamble.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 8feb43e9..0d802409 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -320,6 +320,7 @@ function setValue(ptr, value, type) {
default: abort('invalid type for setValue: ' + type);
}
}
+this['setValue'] = setValue;
// Parallel to setValue.
@@ -337,6 +338,7 @@ function getValue(ptr, type) {
}
return null;
}
+this['getValue'] = getValue;
// Allocates memory for some data and initializes it properly.
@@ -446,6 +448,10 @@ if (HAS_TYPED_ARRAYS) {
HEAPU16 = new Uint16Array(buffer);
HEAPU32 = new Uint32Array(buffer);
HEAPF32 = new Float32Array(buffer);
+
+ // Endianness check (note: assumes compiler arch was little-endian)
+ HEAP32[0] = 255;
+ assert(HEAPU8[0] === 255 && HEAPU8[3] === 0, 'Typed arrays 2 must be run on a little-endian system');
#endif
} else
#endif