@assemblyscript/loader
Advanced tools
Comparing version 0.8.1-nightly.20200110 to 0.8.1-nightly.20200111
@@ -22,6 +22,7 @@ /// <reference lib="esnext.bigint" /> | ||
__allocString(str: string): number; | ||
/** Allocates a new array in the module's memory and returns a reference (pointer) to it. */ | ||
__allocArray(id: number, values: ArrayLike<number>): number; | ||
/** Reads (copies) the value of a string from the module's memory. */ | ||
__getString(ptr: number): string; | ||
/** Allocates a new array in the module's memory and returns a reference (pointer) to it. */ | ||
__allocArray(id: number, values: ArrayLike<number>): number; | ||
/** Reads (copies) the values of an array from the module's memory. */ | ||
@@ -31,24 +32,49 @@ __getArray(ptr: number): number[]; | ||
__getArrayView(ptr: number): ArrayBufferView; | ||
/** Reads the values of Int8Array from the module's memory. */ | ||
/** Reads (copies) the values of Int8Array from the module's memory. */ | ||
__getInt8Array(ptr: number): Int8Array; | ||
/** Reads the values of Uint8Array from the module's memory. */ | ||
/** Reads (copies) the values of Uint8Array from the module's memory. */ | ||
__getUint8Array(ptr: number): Uint8Array; | ||
/** Reads the values of Uint8Array from the module's memory. */ | ||
/** Reads (copies) the values of Uint8Array from the module's memory. */ | ||
__getUint8ClampedArray(ptr: number): Uint8ClampedArray; | ||
/** Reads the values of Int16Array from the module's memory. */ | ||
/** Reads (copies) the values of Int16Array from the module's memory. */ | ||
__getInt16Array(ptr: number): Int16Array; | ||
/** Reads the values of Uint16Array from the module's memory. */ | ||
/** Reads (copies) the values of Uint16Array from the module's memory. */ | ||
__getUint16Array(ptr: number): Uint16Array; | ||
/** Reads the values of Int32Array from the module's memory. */ | ||
/** Reads (copies) the values of Int32Array from the module's memory. */ | ||
__getInt32Array(ptr: number): Int32Array; | ||
/** Reads the values of Uint32Array from the module's memory. */ | ||
/** Reads (copies) the values of Uint32Array from the module's memory. */ | ||
__getUint32Array(ptr: number): Uint32Array; | ||
/** Reads the values of Int32Array from the module's memory. */ | ||
/** Reads (copies) the values of Int32Array from the module's memory. */ | ||
__getInt64Array?(ptr: number): BigInt64Array; | ||
/** Reads the values of Uint32Array from the module's memory. */ | ||
/** Reads (copies) the values of Uint32Array from the module's memory. */ | ||
__getUint64Array?(ptr: number): BigUint64Array; | ||
/** Reads the values of Float32Array from the module's memory. */ | ||
/** Reads (copies) the values of Float32Array from the module's memory. */ | ||
__getFloat32Array(ptr: number): Float32Array; | ||
/** Reads the values of Float64Array from the module's memory. */ | ||
/** Reads (copies) the values of Float64Array from the module's memory. */ | ||
__getFloat64Array(ptr: number): Float64Array; | ||
/** Reads the values of Int8Array from the module's memory. */ | ||
__getInt8ArrayView(ptr: number): Int8Array; | ||
/** Reads the values of Uint8Array from the module's memory. */ | ||
__getUint8ArrayView(ptr: number): Uint8Array; | ||
/** Reads the values of Uint8Array from the module's memory. */ | ||
__getUint8ClampedArrayView(ptr: number): Uint8ClampedArray; | ||
/** Reads the values of Int16Array from the module's memory. */ | ||
__getInt16ArrayView(ptr: number): Int16Array; | ||
/** Reads the values of Uint16Array from the module's memory. */ | ||
__getUint16ArrayView(ptr: number): Uint16Array; | ||
/** Reads the values of Int32Array from the module's memory. */ | ||
__getInt32ArrayView(ptr: number): Int32Array; | ||
/** Reads the values of Uint32Array from the module's memory. */ | ||
__getUint32ArrayView(ptr: number): Uint32Array; | ||
/** Reads the values of Int32Array from the module's memory. */ | ||
__getInt64ArrayView?(ptr: number): BigInt64Array; | ||
/** Reads the values of Uint32Array from the module's memory. */ | ||
__getUint64ArrayView?(ptr: number): BigUint64Array; | ||
/** Reads the values of Float32Array from the module's memory. */ | ||
__getFloat32ArrayView(ptr: number): Float32Array; | ||
/** Reads the values of Float64Array from the module's memory. */ | ||
__getFloat64ArrayView(ptr: number): Float64Array; | ||
/** Reads (copies) the data of an ArrayBuffer from the module's memory. */ | ||
@@ -60,2 +86,4 @@ __getArrayBuffer(ptr: number): ArrayBuffer; | ||
__release(ptr: number): void; | ||
/** Resets base pointer to initial offset. Uses only for stub runtime. */ | ||
__reset?(): void; | ||
/** Allocates an instance of the class represented by the specified id. */ | ||
@@ -62,0 +90,0 @@ __alloc(size: number, id: number): number; |
39
index.js
@@ -220,3 +220,3 @@ "use strict"; | ||
function getTypedArrayImpl(Type, alignLog2, ptr) { | ||
function getTypedArrayView(Type, alignLog2, ptr) { | ||
const buffer = memory.buffer; | ||
@@ -228,26 +228,41 @@ const U32 = new Uint32Array(buffer); | ||
function getTypedArray(Type, alignLog2, ptr) { | ||
return new Type(getTypedArrayView(Type, alignLog2, ptr)); | ||
} | ||
/** Gets a view on the values of a known-to-be Int8Array in the module's memory. */ | ||
baseModule.__getInt8Array = getTypedArrayImpl.bind(null, Int8Array, 0); | ||
baseModule.__getInt8Array = getTypedArray.bind(null, Int8Array, 0); | ||
baseModule.__getInt8ArrayView = getTypedArrayView.bind(null, Int8Array, 0); | ||
/** Gets a view on the values of a known-to-be Uint8Array in the module's memory. */ | ||
baseModule.__getUint8Array = getTypedArrayImpl.bind(null, Uint8Array, 0); | ||
baseModule.__getUint8Array = getTypedArray.bind(null, Uint8Array, 0); | ||
baseModule.__getUint8ArrayView = getTypedArrayView.bind(null, Uint8Array, 0); | ||
/** Gets a view on the values of a known-to-be Uint8ClampedArray in the module's memory. */ | ||
baseModule.__getUint8ClampedArray = getTypedArrayImpl.bind(null, Uint8ClampedArray, 0); | ||
baseModule.__getUint8ClampedArray = getTypedArray.bind(null, Uint8ClampedArray, 0); | ||
baseModule.__getUint8ClampedArrayView = getTypedArrayView.bind(null, Uint8ClampedArray, 0); | ||
/** Gets a view on the values of a known-to-be Int16Array in the module's memory. */ | ||
baseModule.__getInt16Array = getTypedArrayImpl.bind(null, Int16Array, 1); | ||
baseModule.__getInt16Array = getTypedArray.bind(null, Int16Array, 1); | ||
baseModule.__getInt16ArrayView = getTypedArrayView.bind(null, Int16Array, 1); | ||
/** Gets a view on the values of a known-to-be Uint16Array in the module's memory. */ | ||
baseModule.__getUint16Array = getTypedArrayImpl.bind(null, Uint16Array, 1); | ||
baseModule.__getUint16Array = getTypedArray.bind(null, Uint16Array, 1); | ||
baseModule.__getUint16ArrayView = getTypedArrayView.bind(null, Uint16Array, 1); | ||
/** Gets a view on the values of a known-to-be Int32Array in the module's memory. */ | ||
baseModule.__getInt32Array = getTypedArrayImpl.bind(null, Int32Array, 2); | ||
baseModule.__getInt32Array = getTypedArray.bind(null, Int32Array, 2); | ||
baseModule.__getInt32ArrayView = getTypedArrayView.bind(null, Int32Array, 2); | ||
/** Gets a view on the values of a known-to-be Uint32Array in the module's memory. */ | ||
baseModule.__getUint32Array = getTypedArrayImpl.bind(null, Uint32Array, 2); | ||
baseModule.__getUint32Array = getTypedArray.bind(null, Uint32Array, 2); | ||
baseModule.__getUint32ArrayView = getTypedArrayView.bind(null, Uint32Array, 2); | ||
if (BIGINT) { | ||
/** Gets a view on the values of a known-to-be-Int64Array in the module's memory. */ | ||
baseModule.__getInt64Array = getTypedArrayImpl.bind(null, BigInt64Array, 3); | ||
baseModule.__getInt64Array = getTypedArray.bind(null, BigInt64Array, 3); | ||
baseModule.__getInt64ArrayView = getTypedArrayView.bind(null, BigInt64Array, 3); | ||
/** Gets a view on the values of a known-to-be-Uint64Array in the module's memory. */ | ||
baseModule.__getUint64Array = getTypedArrayImpl.bind(null, BigUint64Array, 3); | ||
baseModule.__getUint64Array = getTypedArray.bind(null, BigUint64Array, 3); | ||
baseModule.__getUint64ArrayView = getTypedArrayView.bind(null, BigUint64Array, 3); | ||
} | ||
/** Gets a view on the values of a known-to-be Float32Array in the module's memory. */ | ||
baseModule.__getFloat32Array = getTypedArrayImpl.bind(null, Float32Array, 2); | ||
baseModule.__getFloat32Array = getTypedArray.bind(null, Float32Array, 2); | ||
baseModule.__getFloat32ArrayView = getTypedArrayView.bind(null, Float32Array, 2); | ||
/** Gets a view on the values of a known-to-be Float64Array in the module's memory. */ | ||
baseModule.__getFloat64Array = getTypedArrayImpl.bind(null, Float64Array, 3); | ||
baseModule.__getFloat64Array = getTypedArray.bind(null, Float64Array, 3); | ||
baseModule.__getFloat64ArrayView = getTypedArrayView.bind(null, Float64Array, 3); | ||
@@ -254,0 +269,0 @@ /** Tests whether an object is an instance of the class represented by the specified base id. */ |
@@ -12,3 +12,3 @@ { | ||
], | ||
"version": "0.8.1-nightly.20200110", | ||
"version": "0.8.1-nightly.20200111", | ||
"author": "Daniel Wirtz <dcode+assemblyscript@dcode.io>", | ||
@@ -15,0 +15,0 @@ "license": "Apache-2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32686
481