@assemblyscript/loader
Advanced tools
Comparing version 0.17.10 to 0.17.11
29
index.js
@@ -84,5 +84,5 @@ // Runtime header offsets | ||
const table = exports.table; | ||
const new_ = exports["__new"]; | ||
const retain = exports["__retain"]; | ||
const rttiBase = exports["__rtti_base"] || ~0; // oob if not present | ||
const __new = exports["__new"]; | ||
const __retain = exports["__retain"]; | ||
const __rtti_base = exports["__rtti_base"] || ~0; // oob if not present | ||
@@ -92,5 +92,5 @@ /** Gets the runtime type info for the given id. */ | ||
const U32 = new Uint32Array(memory.buffer); | ||
const count = U32[rttiBase >>> 2]; | ||
const count = U32[__rtti_base >>> 2]; | ||
if ((id >>>= 0) >= count) throw Error(`invalid id: ${id}`); | ||
return U32[(rttiBase + 4 >>> 2) + id * 2]; | ||
return U32[(__rtti_base + 4 >>> 2) + id * 2]; | ||
} | ||
@@ -108,5 +108,5 @@ | ||
const U32 = new Uint32Array(memory.buffer); | ||
const count = U32[rttiBase >>> 2]; | ||
const count = U32[__rtti_base >>> 2]; | ||
if ((id >>>= 0) >= count) throw Error(`invalid id: ${id}`); | ||
return U32[(rttiBase + 4 >>> 2) + id * 2 + 1]; | ||
return U32[(__rtti_base + 4 >>> 2) + id * 2 + 1]; | ||
} | ||
@@ -126,4 +126,5 @@ | ||
function __newString(str) { | ||
if (str == null) return 0; | ||
const length = str.length; | ||
const ptr = new_(length << 1, STRING_ID); | ||
const ptr = __new(length << 1, STRING_ID); | ||
const U16 = new Uint16Array(memory.buffer); | ||
@@ -138,2 +139,3 @@ for (var i = 0, p = ptr >>> 1; i < length; ++i) U16[p + i] = str.charCodeAt(i); | ||
function __getString(ptr) { | ||
if (!ptr) return null; | ||
const buffer = memory.buffer; | ||
@@ -171,3 +173,3 @@ const id = new Uint32Array(buffer)[ptr + ID_OFFSET >>> 2]; | ||
const length = values.length; | ||
const buf = new_(length << align, info & STATICARRAY ? id : ARRAYBUFFER_ID); | ||
const buf = __new(length << align, info & STATICARRAY ? id : ARRAYBUFFER_ID); | ||
let result; | ||
@@ -177,5 +179,5 @@ if (info & STATICARRAY) { | ||
} else { | ||
const arr = new_(info & ARRAY ? ARRAY_SIZE : ARRAYBUFFERVIEW_SIZE, id); | ||
const arr = __new(info & ARRAY ? ARRAY_SIZE : ARRAYBUFFERVIEW_SIZE, id); | ||
const U32 = new Uint32Array(memory.buffer); | ||
U32[arr + ARRAYBUFFERVIEW_BUFFER_OFFSET >>> 2] = retain(buf); | ||
U32[arr + ARRAYBUFFERVIEW_BUFFER_OFFSET >>> 2] = __retain(buf); | ||
U32[arr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2] = buf; | ||
@@ -188,3 +190,3 @@ U32[arr + ARRAYBUFFERVIEW_DATALENGTH_OFFSET >>> 2] = length << align; | ||
if (info & VAL_MANAGED) { | ||
for (let i = 0; i < length; ++i) view[(buf >>> align) + i] = retain(values[i]); | ||
for (let i = 0; i < length; ++i) view[(buf >>> align) + i] = __retain(values[i]); | ||
} else { | ||
@@ -278,3 +280,3 @@ view.set(values, buf >>> align); | ||
let id = U32[ptr + ID_OFFSET >>> 2]; | ||
if (id <= U32[rttiBase >>> 2]) { | ||
if (id <= U32[__rtti_base >>> 2]) { | ||
do { | ||
@@ -343,3 +345,2 @@ if (id == baseId) return true; | ||
export function demangle(exports, extendedExports = {}) { | ||
extendedExports = Object.create(extendedExports); | ||
const setArgumentsLength = exports["__argumentsLength"] | ||
@@ -346,0 +347,0 @@ ? length => { exports["__argumentsLength"].value = length; } |
@@ -12,3 +12,3 @@ { | ||
], | ||
"version": "0.17.10", | ||
"version": "0.17.11", | ||
"author": "Daniel Wirtz <dcode+assemblyscript@dcode.io>", | ||
@@ -15,0 +15,0 @@ "license": "Apache-2.0", |
@@ -1,1 +0,1 @@ | ||
export * from ".."; | ||
export * from "../index"; |
@@ -98,13 +98,15 @@ // GENERATED FILE. DO NOT EDIT. | ||
const table = exports.table; | ||
const new_ = exports["__new"]; | ||
const retain = exports["__retain"]; | ||
const rttiBase = exports["__rtti_base"] || ~0; // oob if not present | ||
const __new = exports["__new"]; | ||
const __retain = exports["__retain"]; | ||
const __rtti_base = exports["__rtti_base"] || ~0; // oob if not present | ||
/** Gets the runtime type info for the given id. */ | ||
function getInfo(id) { | ||
const U32 = new Uint32Array(memory.buffer); | ||
const count = U32[rttiBase >>> 2]; | ||
const count = U32[__rtti_base >>> 2]; | ||
if ((id >>>= 0) >= count) throw Error(`invalid id: ${id}`); | ||
return U32[(rttiBase + 4 >>> 2) + id * 2]; | ||
return U32[(__rtti_base + 4 >>> 2) + id * 2]; | ||
} | ||
@@ -124,5 +126,5 @@ /** Gets and validate runtime type info for the given id for array like objects */ | ||
const U32 = new Uint32Array(memory.buffer); | ||
const count = U32[rttiBase >>> 2]; | ||
const count = U32[__rtti_base >>> 2]; | ||
if ((id >>>= 0) >= count) throw Error(`invalid id: ${id}`); | ||
return U32[(rttiBase + 4 >>> 2) + id * 2 + 1]; | ||
return U32[(__rtti_base + 4 >>> 2) + id * 2 + 1]; | ||
} | ||
@@ -144,4 +146,7 @@ /** Gets the runtime alignment of a collection's values. */ | ||
function __newString(str) { | ||
if (str == null) return 0; | ||
const length = str.length; | ||
const ptr = new_(length << 1, STRING_ID); | ||
const ptr = __new(length << 1, STRING_ID); | ||
const U16 = new Uint16Array(memory.buffer); | ||
@@ -158,2 +163,3 @@ | ||
function __getString(ptr) { | ||
if (!ptr) return null; | ||
const buffer = memory.buffer; | ||
@@ -204,3 +210,5 @@ const id = new Uint32Array(buffer)[ptr + ID_OFFSET >>> 2]; | ||
const length = values.length; | ||
const buf = new_(length << align, info & STATICARRAY ? id : ARRAYBUFFER_ID); | ||
const buf = __new(length << align, info & STATICARRAY ? id : ARRAYBUFFER_ID); | ||
let result; | ||
@@ -211,5 +219,6 @@ | ||
} else { | ||
const arr = new_(info & ARRAY ? ARRAY_SIZE : ARRAYBUFFERVIEW_SIZE, id); | ||
const arr = __new(info & ARRAY ? ARRAY_SIZE : ARRAYBUFFERVIEW_SIZE, id); | ||
const U32 = new Uint32Array(memory.buffer); | ||
U32[arr + ARRAYBUFFERVIEW_BUFFER_OFFSET >>> 2] = retain(buf); | ||
U32[arr + ARRAYBUFFERVIEW_BUFFER_OFFSET >>> 2] = __retain(buf); | ||
U32[arr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2] = buf; | ||
@@ -224,3 +233,3 @@ U32[arr + ARRAYBUFFERVIEW_DATALENGTH_OFFSET >>> 2] = length << align; | ||
if (info & VAL_MANAGED) { | ||
for (let i = 0; i < length; ++i) view[(buf >>> align) + i] = retain(values[i]); | ||
for (let i = 0; i < length; ++i) view[(buf >>> align) + i] = __retain(values[i]); | ||
} else { | ||
@@ -308,3 +317,3 @@ view.set(values, buf >>> align); | ||
if (id <= U32[rttiBase >>> 2]) { | ||
if (id <= U32[__rtti_base >>> 2]) { | ||
do { | ||
@@ -382,3 +391,2 @@ if (id == baseId) return true; | ||
function demangle(exports, extendedExports = {}) { | ||
extendedExports = Object.create(extendedExports); | ||
const setArgumentsLength = exports["__argumentsLength"] ? length => { | ||
@@ -385,0 +393,0 @@ exports["__argumentsLength"].value = length; |
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
39832
881