summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2014-10-08 01:06:06 -0700
committerTrevor Norris <trev.norris@gmail.com>2014-10-08 01:06:06 -0700
commit4809c7aa4f84385ba358d1947203fbeba8555b76 (patch)
tree1a8360d31c4317060954f1e1e5111ad28b10ada2 /lib
parent6e4bd494a50c3dfd432a5a6dd4a13556443dfa79 (diff)
downloadnode-4809c7aa4f84385ba358d1947203fbeba8555b76.tar.gz
smalloc: update use of ExternalArrayType constants
The constants in enum v8::ExternalArrayType have been changed. The old values are there for legacy reasons, but it's best to update anyway. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/smalloc.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/smalloc.js b/lib/smalloc.js
index 22525ad0d..ba042c6c4 100644
--- a/lib/smalloc.js
+++ b/lib/smalloc.js
@@ -37,6 +37,7 @@ Object.defineProperty(exports, 'kMaxLength', {
// enumerated values for different external array types
var Types = {};
+// Must match enum v8::ExternalArrayType.
Object.defineProperties(Types, {
'Int8': { enumerable: true, value: 1, writable: false },
'Uint8': { enumerable: true, value: 2, writable: false },
@@ -68,7 +69,7 @@ function alloc(n, obj, type) {
throw new TypeError('obj must be an Object');
}
- // 1 == v8::kExternalByteArray, 9 == v8::kExternalPixelArray
+ // 1 == v8::kExternalUint8Array, 9 == v8::kExternalUint8ClampedArray
if (type < 1 || type > 9)
throw new TypeError('unknown external array type: ' + type);
if (util.isArray(obj))