Index: lib/typedObjects/primitiveTypes.js |
=================================================================== |
--- a/lib/typedObjects/primitiveTypes.js |
+++ b/lib/typedObjects/primitiveTypes.js |
@@ -14,16 +14,17 @@ |
* You should have received a copy of the GNU General Public License |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
"use strict"; |
let {ilog2} = require("typedObjects/utils"); |
let {createArrayType} = require("typedObjects/arrayTypes"); |
+let {createDictionaryType} = require("typedObjects/dictionaryTypes"); |
function createGetter(shift, offset, view) |
{ |
shift = shift | 0; |
offset = offset | 0; |
offset >>= shift; |
return function(bufferIndex, byteOffset) |
{ |
@@ -55,16 +56,17 @@ function PrimitiveType(viewType) |
let offsetShift = ilog2(result.byteLength) | 0; |
result.createGetter = createGetter.bind(null, offsetShift); |
result.createSetter = createSetter.bind(null, offsetShift); |
// Note: this is a pretty inefficient way to zero out initial values. We |
// should consider using ArrayBuffer.fill(0) once it becomes available |
// (https://bugzilla.mozilla.org/show_bug.cgi?id=730880). |
result.initialValue = 0; |
result.Array = createArrayType.bind(null, result); |
+ result.Dictionary = createDictionaryType.bind(null, result); |
Object.freeze(result); |
return result; |
} |
exports.uint8 = exports.boolean = new PrimitiveType(Uint8Array); |
exports.uint8clamped = new PrimitiveType(Uint8ClampedArray); |
exports.int8 = new PrimitiveType(Int8Array); |
exports.uint16 = new PrimitiveType(Uint16Array); |