Comparing version 0.3.2 to 0.3.3
@@ -9,2 +9,3 @@ import { ClassNode, InterfaceNode, TypeNode } from "@aldea/core/abi"; | ||
liftValue(type: TypeNode, ptr: WasmPointer): any; | ||
visitArrayBuffer(): any; | ||
} |
@@ -6,3 +6,3 @@ import { Pointer } from "@aldea/core"; | ||
const object = this.visitPlainObject(node, type); | ||
return Pointer.fromBytes(object.$output.origin); | ||
return Pointer.fromBytes(new Uint8Array(object.$output.origin)); | ||
// const intRef = new Internref(node.name, Number(this.ptr)) | ||
@@ -17,3 +17,3 @@ // const jigRef = this.instance.currentExec.findJigByRef(intRef) | ||
// const bufPtr = new Uint32Array(mod.memory.buffer)[ptr >>> 2] | ||
return Pointer.fromBytes(extRef.originBuf); | ||
return Pointer.fromBytes(new Uint8Array(extRef.originBuf)); | ||
} | ||
@@ -27,2 +27,10 @@ visitInterface(anInterface, _typeNode) { | ||
} | ||
// Here we override LiftValueVisitor.visitArrayBuffer() | ||
// The original method is programmed to return arraybuffers as uint8arrays | ||
// But for jig state, BCS really expects an ArrayBuffer | ||
// hence this little awkward override | ||
visitArrayBuffer() { | ||
const u8arr = super.visitArrayBuffer(); | ||
return u8arr.buffer; | ||
} | ||
} |
{ | ||
"name": "@aldea/vm", | ||
"description": "The Aldea Computer virtual machine implemented in JavaScript.", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"license": "Apache-2.0", | ||
@@ -40,4 +40,4 @@ "type": "module", | ||
"dependencies": { | ||
"@aldea/compiler": "workspace:^", | ||
"@aldea/core": "workspace:^", | ||
"@aldea/compiler": "^0.2.5", | ||
"@aldea/core": "^0.3.2", | ||
"moment": "^2.29.4" | ||
@@ -62,2 +62,2 @@ }, | ||
} | ||
} | ||
} |
@@ -11,3 +11,3 @@ import { Pointer } from "@aldea/core"; | ||
const object = this.visitPlainObject(node, type) | ||
return Pointer.fromBytes(object.$output.origin) | ||
return Pointer.fromBytes(new Uint8Array(object.$output.origin)) | ||
// const intRef = new Internref(node.name, Number(this.ptr)) | ||
@@ -25,3 +25,3 @@ // const jigRef = this.instance.currentExec.findJigByRef(intRef) | ||
return Pointer.fromBytes(extRef.originBuf) | ||
return Pointer.fromBytes(new Uint8Array(extRef.originBuf)) | ||
} | ||
@@ -39,2 +39,11 @@ | ||
} | ||
// Here we override LiftValueVisitor.visitArrayBuffer() | ||
// The original method is programmed to return arraybuffers as uint8arrays | ||
// But for jig state, BCS really expects an ArrayBuffer | ||
// hence this little awkward override | ||
visitArrayBuffer(): any { | ||
const u8arr = super.visitArrayBuffer() | ||
return u8arr.buffer | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2090276
213
19364
+ Added@aldea/assemblyscript@0.1.0(transitive)
+ Added@aldea/compiler@0.2.8(transitive)
+ Added@aldea/core@0.3.9(transitive)
+ Added@noble/ed25519@2.2.3(transitive)
+ Added@noble/hashes@1.7.1(transitive)
+ Added@scure/base@1.2.4(transitive)
+ Addedbinaryen@112.0.0-nightly.20230411(transitive)
+ Addedcomment-parser@1.4.1(transitive)
+ Addedlong@5.2.4(transitive)
Updated@aldea/compiler@^0.2.5
Updated@aldea/core@^0.3.2