Index: lib/typedObjects/arrayTypes.js |
=================================================================== |
--- a/lib/typedObjects/arrayTypes.js |
+++ b/lib/typedObjects/arrayTypes.js |
@@ -231,16 +231,20 @@ function createArrayType(elementType, ty |
let firstFree = []; |
for (let i = minElements; i < bufferSize; i <<= 1) |
firstFree[i] = new TypedReference(-1, typedReferenceViews); |
let {int16, uint32} = require("typedObjects/primitiveTypes"); |
typeDescriptor = Object.create(typeDescriptor || {}); |
typeDescriptor.arrayBufferIndex = int16; |
typeDescriptor.arrayByteOffset = uint32; |
+ typeDescriptor.getArrayBuffer = function() |
+ { |
+ return this.arrayBufferIndex >= 0 ? buffers[this.arrayBufferIndex] : null; |
+ }; |
typeDescriptor.length = uint32; |
typeDescriptor.size = uint32; |
let elementShift = ilog2(elementType.referenceLength | 0); |
typeDescriptor.get = createGetter(elementGetter, elementShift); |
typeDescriptor.set = createSetter(elementSetter, elementShift); |
if (meta.hasOwnProperty("constructor") && typeof meta.constructor == "function") |