Socket
Socket
Sign inDemoInstall

quickjs-emscripten

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quickjs-emscripten - npm Package Compare versions

Comparing version 0.21.1 to 0.21.2

6

dist/context.d.ts

@@ -335,3 +335,7 @@ import { QuickJSDeferredPromise } from "./deferred-promise";

/** @private */
protected fnMap: Map<number, VmFunctionImplementation<QuickJSHandle>>;
protected fnMaps: Map<number, Map<number, VmFunctionImplementation<QuickJSHandle>>>;
/** @private */
protected getFunction(fn_id: number): VmFunctionImplementation<QuickJSHandle> | undefined;
/** @private */
protected setFunction(fn_id: number, handle: VmFunctionImplementation<QuickJSHandle>): Map<number, VmFunctionImplementation<QuickJSHandle>>;
/**

@@ -338,0 +342,0 @@ * @hidden

@@ -102,5 +102,5 @@ "use strict";

/** @private */
this.fnNextId = 0;
this.fnNextId = -32768; // min value of signed 16bit int used by Quickjs
/** @private */
this.fnMap = new Map();
this.fnMaps = new Map();
/**

@@ -114,4 +114,5 @@ * @hidden

}
const fn = this.fnMap.get(fn_id);
const fn = this.getFunction(fn_id);
if (!fn) {
// this "throw" is not catch-able from the TS side. could we somehow handle this higher up?
throw new Error(`QuickJSContext had no callback with id ${fn_id}`);

@@ -316,3 +317,3 @@ }

const fnId = ++this.fnNextId;
this.fnMap.set(fnId, fn);
this.setFunction(fnId, fn);
return this.memory.heapValueHandle(this.ffi.QTS_NewFunction(this.ctx.value, fnId, name));

@@ -603,2 +604,21 @@ }

}
/** @private */
getFunction(fn_id) {
const map_id = fn_id >> 8;
const fnMap = this.fnMaps.get(map_id);
if (!fnMap) {
return undefined;
}
return fnMap.get(fn_id);
}
/** @private */
setFunction(fn_id, handle) {
const map_id = fn_id >> 8;
let fnMap = this.fnMaps.get(map_id);
if (!fnMap) {
fnMap = new Map();
this.fnMaps.set(map_id, fnMap);
}
return fnMap.set(fn_id, handle);
}
errorToHandle(error) {

@@ -605,0 +625,0 @@ if (error instanceof lifetime_1.Lifetime) {

2

package.json
{
"name": "quickjs-emscripten",
"version": "0.21.1",
"version": "0.21.2",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "sideEffects": false,

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 too big to display

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 too big to display

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