Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/typedObjects/arrayTypes.js

Issue 5665229014827008: Issue 150 - [Typed objects] Implement string type (Closed)
Patch Set: Created May 16, 2014, 1:47 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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")

Powered by Google App Engine
This is Rietveld