@oxc-parser/binding-wasm32-wasi 0.87.0 → 0.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10181,7 +10181,7 @@ function getDefaultContext() {
10181
10181
  return defaultContext;
10182
10182
  }
10183
10183
 
10184
- // ../../node_modules/.pnpm/@tybys+wasm-util@0.10.0/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js
10184
+ // ../../node_modules/.pnpm/@tybys+wasm-util@0.10.1/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js
10185
10185
  var _WebAssembly3 = typeof WebAssembly !== "undefined" ? WebAssembly : typeof WXWebAssembly !== "undefined" ? WXWebAssembly : void 0;
10186
10186
  if (!_WebAssembly3) {
10187
10187
  throw new Error("WebAssembly is not supported in this environment");
@@ -11048,24 +11048,38 @@ function defineName(name, f) {
11048
11048
  Object.defineProperty(f, "name", { value: name });
11049
11049
  return f;
11050
11050
  }
11051
+ function tryCall(f, wasi, args) {
11052
+ let r;
11053
+ try {
11054
+ r = f.apply(wasi, args);
11055
+ } catch (err) {
11056
+ return handleError(err);
11057
+ }
11058
+ if (isPromiseLike(r)) {
11059
+ return r.then((_) => _, handleError);
11060
+ }
11061
+ return r;
11062
+ }
11051
11063
  function syscallWrap(self2, name, f) {
11052
- return defineName(name, function() {
11053
- if (process.env.NODE_DEBUG_NATIVE === "wasi") {
11054
- const args = Array.prototype.slice.call(arguments);
11055
- let debugArgs = [`${name}(${Array.from({ length: arguments.length }).map(() => "%d").join(", ")})`];
11056
- debugArgs = debugArgs.concat(args);
11057
- console.debug.apply(console, debugArgs);
11058
- }
11059
- let r;
11064
+ let debug = false;
11065
+ const NODE_DEBUG_NATIVE = (() => {
11060
11066
  try {
11061
- r = f.apply(self2, arguments);
11062
- } catch (err) {
11063
- return handleError(err);
11064
- }
11065
- if (isPromiseLike(r)) {
11066
- return r.then((_) => _, handleError);
11067
+ return process.env.NODE_DEBUG_NATIVE;
11068
+ } catch (_) {
11069
+ return void 0;
11067
11070
  }
11068
- return r;
11071
+ })();
11072
+ if (typeof NODE_DEBUG_NATIVE === "string" && NODE_DEBUG_NATIVE.split(",").includes("wasi")) {
11073
+ debug = true;
11074
+ }
11075
+ return debug ? defineName(name, function() {
11076
+ const args = Array.prototype.slice.call(arguments);
11077
+ let debugArgs = [`${name}(${Array.from({ length: arguments.length }).map(() => "%d").join(", ")})`];
11078
+ debugArgs = debugArgs.concat(args);
11079
+ console.debug.apply(console, debugArgs);
11080
+ return tryCall(f, self2, args);
11081
+ }) : defineName(name, function() {
11082
+ return tryCall(f, self2, arguments);
11069
11083
  });
11070
11084
  }
11071
11085
  function resolvePathSync(fs, fileDescriptor, path, flags) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxc-parser/binding-wasm32-wasi",
3
- "version": "0.87.0",
3
+ "version": "0.89.0",
4
4
  "cpu": [
5
5
  "wasm32"
6
6
  ],
@@ -36,6 +36,6 @@
36
36
  },
37
37
  "browser": "parser.wasi-browser.js",
38
38
  "dependencies": {
39
- "@napi-rs/wasm-runtime": "^1.0.3"
39
+ "@napi-rs/wasm-runtime": "^1.0.5"
40
40
  }
41
41
  }
Binary file