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 19, 2014, 3:15 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
« no previous file with comments | « lib/typedObjects.js ('k') | lib/typedObjects/stringType.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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")
« no previous file with comments | « lib/typedObjects.js ('k') | lib/typedObjects/stringType.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld