Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

primea-wasm-container

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

primea-wasm-container - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

.nyc_output/52637a6e68168254fbf7bef4fc0aa4bf.json

19

index.js

@@ -58,4 +58,4 @@ const ReferanceMap = require('reference-map')

*/
onMessage (message) {
return this._run(message, 'onMessage')
onMessage (message, method = 'onMessage') {
return this._run(message, method)
}

@@ -67,9 +67,11 @@

this.instance = result.instance
if (this.instance.exports[method]) {
// add the message and ports to the refereance map
const messageRef = this.referanceMap.add(message)
// add the message and ports to the refereance map
const messageRef = this.referanceMap.add(message)
// runs the wasm code
this.instance.exports[method](messageRef)
return this.onDone()
// runs the wasm code
this.instance.exports[method](messageRef)
await this.onDone()
this.referanceMap.clear()
}
}

@@ -87,3 +89,2 @@

}
this.referanceMap.clear()
}

@@ -90,0 +91,0 @@

{
"name": "primea-wasm-container",
"version": "0.3.3",
"version": "0.3.4",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -172,1 +172,18 @@ const tape = require('tape')

})
tape('shouldnt run non exstant methods', async t => {
const hypervisor = new Hypervisor(tree)
const main = fs.readFileSync(`${__dirname}/wasm/referances.wasm`)
hypervisor.registerContainer(WasmContainer, {
env: ContainerTestInterface,
test: testInterface(t)
})
const cap = await hypervisor.createActor(WasmContainer.typeId, new Message({
data: main
}))
const actor = await hypervisor.getActor(cap.destId)
await actor.container.onMessage(new Message(), 'test')
t.end()
})

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc