@php-wasm/node 2.0.18 → 2.0.19

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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/jspi/php_7_2.js CHANGED
@@ -8,7 +8,7 @@ import path from 'path';
8
8
 
9
9
  const dependencyFilename = path.join(__dirname, '7_2_34', 'php_7_2.wasm');
10
10
  export { dependencyFilename };
11
- export const dependenciesTotalSize = 22384215;
11
+ export const dependenciesTotalSize = 22384535;
12
12
  const phpVersionString = '7.2.34';
13
13
  export function init(RuntimeName, PHPLoader) {
14
14
  // The rest of the code comes from the built php.js file and esm-suffix.js
@@ -6884,26 +6884,36 @@ export function init(RuntimeName, PHPLoader) {
6884
6884
 
6885
6885
  var _fd_close = function fd_close(fd) {
6886
6886
  return Asyncify.handleAsync(async () => {
6887
- const [vfsPath, pathResolutionErrno] =
6888
- locking.get_vfs_path_from_fd(fd);
6889
- if (pathResolutionErrno !== 0) {
6890
- _js_wasm_trace(
6891
- 'fd_close(%d) get_vfs_path_from_fd error %d',
6892
- fd,
6893
- pathResolutionErrno
6894
- );
6895
- return -ERRNO_CODES.EBADF;
6896
- }
6897
-
6898
- const result = _builtin_fd_close(fd);
6899
- if (result !== 0 || !locking.maybeLockedFds.has(fd)) {
6900
- _js_wasm_trace('fd_close(%d) result %d', fd, result);
6901
- return result;
6887
+ const fdCloseResult = _builtin_fd_close(fd);
6888
+ if (fdCloseResult !== 0 || !locking.maybeLockedFds.has(fd)) {
6889
+ _js_wasm_trace('fd_close(%d) result %d', fd, fdCloseResult);
6890
+ return fdCloseResult;
6902
6891
  }
6903
- const nativeFilePath =
6904
- locking.get_native_path_from_vfs_path(vfsPath);
6905
6892
 
6906
6893
  try {
6894
+ const [vfsPath, pathResolutionErrno] =
6895
+ locking.get_vfs_path_from_fd(fd);
6896
+ if (pathResolutionErrno !== 0) {
6897
+ _js_wasm_trace(
6898
+ 'fd_close(%d) get_vfs_path_from_fd error %d',
6899
+ fd,
6900
+ pathResolutionErrno
6901
+ );
6902
+ /*
6903
+ * It looks like the file may have had an associated lock,
6904
+ * but since we cannot look up the path,
6905
+ * there is nothing more for us to do.
6906
+ *
6907
+ * NOTE: This seems possible for files that are locked and
6908
+ * then unlinked before close. It is an opportunity for a
6909
+ * lock to be orphaned in the lock manager.
6910
+ * @TODO: Explore how to ensure cleanup in this case.
6911
+ */
6912
+ return fdCloseResult;
6913
+ }
6914
+
6915
+ const nativeFilePath =
6916
+ locking.get_native_path_from_vfs_path(vfsPath);
6907
6917
  await PHPLoader.fileLockManager.releaseLocksForProcessFd(
6908
6918
  PHPLoader.processId,
6909
6919
  fd,
@@ -6915,7 +6925,7 @@ export function init(RuntimeName, PHPLoader) {
6915
6925
  } finally {
6916
6926
  locking.maybeLockedFds.delete(fd);
6917
6927
  }
6918
- return result;
6928
+ return fdCloseResult;
6919
6929
  });
6920
6930
  };
6921
6931
  _fd_close.sig = 'ii';
@@ -7030,8 +7040,12 @@ export function init(RuntimeName, PHPLoader) {
7030
7040
  }
7031
7041
  },
7032
7042
  get_native_path_from_vfs_path(vfsPath) {
7033
- // TODO: Should there be a try/catch here?
7034
- const { node } = FS.lookupPath(vfsPath, {});
7043
+ const { node } = FS.lookupPath(vfsPath, {
7044
+ noent_okay: true,
7045
+ });
7046
+ if (!node) {
7047
+ throw new Error(`No node found for VFS path ${vfsPath}`);
7048
+ }
7035
7049
  if (node.mount.type === NODEFS) {
7036
7050
  return NODEFS.realPath(node);
7037
7051
  } else if (node.mount.type === PROXYFS) {
@@ -7312,10 +7326,9 @@ export function init(RuntimeName, PHPLoader) {
7312
7326
  return -ERRNO_CODES.EINVAL;
7313
7327
  }
7314
7328
 
7315
- const nativeFilePath =
7316
- locking.get_native_path_from_vfs_path(vfsPath);
7317
-
7318
7329
  try {
7330
+ const nativeFilePath =
7331
+ locking.get_native_path_from_vfs_path(vfsPath);
7319
7332
  const conflictingLock = await Promise.resolve(
7320
7333
  PHPLoader.fileLockManager.findFirstConflictingByteRangeLock(
7321
7334
  nativeFilePath,
@@ -7451,16 +7464,16 @@ export function init(RuntimeName, PHPLoader) {
7451
7464
  pid,
7452
7465
  };
7453
7466
 
7454
- const nativeFilePath =
7455
- locking.get_native_path_from_vfs_path(vfsPath);
7456
- _js_wasm_trace(
7457
- 'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
7458
- fd,
7459
- vfsPath,
7460
- rangeLock
7461
- );
7462
-
7463
7467
  try {
7468
+ const nativeFilePath =
7469
+ locking.get_native_path_from_vfs_path(vfsPath);
7470
+ _js_wasm_trace(
7471
+ 'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
7472
+ fd,
7473
+ vfsPath,
7474
+ rangeLock
7475
+ );
7476
+
7464
7477
  const succeeded = await Promise.resolve(
7465
7478
  PHPLoader.fileLockManager.lockFileByteRange(
7466
7479
  nativeFilePath,
@@ -17367,9 +17380,9 @@ export function init(RuntimeName, PHPLoader) {
17367
17380
  return -ERRNO_CODES.EINVAL;
17368
17381
  }
17369
17382
 
17370
- const nativeFilePath =
17371
- locking.get_native_path_from_vfs_path(vfsPath);
17372
17383
  try {
17384
+ const nativeFilePath =
17385
+ locking.get_native_path_from_vfs_path(vfsPath);
17373
17386
  const obtainedLock = await Promise.resolve(
17374
17387
  PHPLoader.fileLockManager.lockWholeFile(nativeFilePath, {
17375
17388
  type: lockOpType,
@@ -17705,9 +17718,9 @@ export function init(RuntimeName, PHPLoader) {
17705
17718
  if (!cp.stdin.closed) {
17706
17719
  cp.stdin.end();
17707
17720
  }
17708
- _free(buffer);
17709
- _free(iov);
17710
- _free(pnum);
17721
+ PHPLoader['free'](buffer);
17722
+ PHPLoader['free'](iov);
17723
+ PHPLoader['free'](pnum);
17711
17724
  }
17712
17725
 
17713
17726
  // pump() can never alter the result of this function.
@@ -18354,6 +18367,11 @@ export function init(RuntimeName, PHPLoader) {
18354
18367
  return ret;
18355
18368
  };
18356
18369
 
18370
+ var setErrNo = (value) => {
18371
+ HEAP32[___errno_location() >> 2] = value;
18372
+ return value;
18373
+ };
18374
+
18357
18375
  var FS_createPath = FS.createPath;
18358
18376
 
18359
18377
  var FS_unlink = (path) => FS.unlink(path);
@@ -30778,11 +30796,6 @@ export function init(RuntimeName, PHPLoader) {
30778
30796
 
30779
30797
  var allocateUTF8 = stringToNewUTF8;
30780
30798
 
30781
- var setErrNo = (value) => {
30782
- HEAP32[___errno_location() >> 2] = value;
30783
- return value;
30784
- };
30785
-
30786
30799
  var demangle = (func) => {
30787
30800
  // If demangle has failed before, stop demangling any further function names
30788
30801
  // This avoids an infinite recursion with malloc()->abort()->stackTrace()->demangle()->malloc()->...
@@ -34263,6 +34276,7 @@ export function init(RuntimeName, PHPLoader) {
34263
34276
  Module['FS_createDevice'] = FS_createDevice;
34264
34277
  Module['FS_createDataFile'] = FS_createDataFile;
34265
34278
  Module['FS_createLazyFile'] = FS_createLazyFile;
34279
+ Module['setErrNo'] = setErrNo;
34266
34280
  Module['PROXYFS'] = PROXYFS;
34267
34281
 
34268
34282
  async function callMain(args = []) {
package/jspi/php_7_3.js CHANGED
@@ -6884,26 +6884,36 @@ export function init(RuntimeName, PHPLoader) {
6884
6884
 
6885
6885
  var _fd_close = function fd_close(fd) {
6886
6886
  return Asyncify.handleAsync(async () => {
6887
- const [vfsPath, pathResolutionErrno] =
6888
- locking.get_vfs_path_from_fd(fd);
6889
- if (pathResolutionErrno !== 0) {
6890
- _js_wasm_trace(
6891
- 'fd_close(%d) get_vfs_path_from_fd error %d',
6892
- fd,
6893
- pathResolutionErrno
6894
- );
6895
- return -ERRNO_CODES.EBADF;
6896
- }
6897
-
6898
- const result = _builtin_fd_close(fd);
6899
- if (result !== 0 || !locking.maybeLockedFds.has(fd)) {
6900
- _js_wasm_trace('fd_close(%d) result %d', fd, result);
6901
- return result;
6887
+ const fdCloseResult = _builtin_fd_close(fd);
6888
+ if (fdCloseResult !== 0 || !locking.maybeLockedFds.has(fd)) {
6889
+ _js_wasm_trace('fd_close(%d) result %d', fd, fdCloseResult);
6890
+ return fdCloseResult;
6902
6891
  }
6903
- const nativeFilePath =
6904
- locking.get_native_path_from_vfs_path(vfsPath);
6905
6892
 
6906
6893
  try {
6894
+ const [vfsPath, pathResolutionErrno] =
6895
+ locking.get_vfs_path_from_fd(fd);
6896
+ if (pathResolutionErrno !== 0) {
6897
+ _js_wasm_trace(
6898
+ 'fd_close(%d) get_vfs_path_from_fd error %d',
6899
+ fd,
6900
+ pathResolutionErrno
6901
+ );
6902
+ /*
6903
+ * It looks like the file may have had an associated lock,
6904
+ * but since we cannot look up the path,
6905
+ * there is nothing more for us to do.
6906
+ *
6907
+ * NOTE: This seems possible for files that are locked and
6908
+ * then unlinked before close. It is an opportunity for a
6909
+ * lock to be orphaned in the lock manager.
6910
+ * @TODO: Explore how to ensure cleanup in this case.
6911
+ */
6912
+ return fdCloseResult;
6913
+ }
6914
+
6915
+ const nativeFilePath =
6916
+ locking.get_native_path_from_vfs_path(vfsPath);
6907
6917
  await PHPLoader.fileLockManager.releaseLocksForProcessFd(
6908
6918
  PHPLoader.processId,
6909
6919
  fd,
@@ -6915,7 +6925,7 @@ export function init(RuntimeName, PHPLoader) {
6915
6925
  } finally {
6916
6926
  locking.maybeLockedFds.delete(fd);
6917
6927
  }
6918
- return result;
6928
+ return fdCloseResult;
6919
6929
  });
6920
6930
  };
6921
6931
  _fd_close.sig = 'ii';
@@ -7030,8 +7040,12 @@ export function init(RuntimeName, PHPLoader) {
7030
7040
  }
7031
7041
  },
7032
7042
  get_native_path_from_vfs_path(vfsPath) {
7033
- // TODO: Should there be a try/catch here?
7034
- const { node } = FS.lookupPath(vfsPath, {});
7043
+ const { node } = FS.lookupPath(vfsPath, {
7044
+ noent_okay: true,
7045
+ });
7046
+ if (!node) {
7047
+ throw new Error(`No node found for VFS path ${vfsPath}`);
7048
+ }
7035
7049
  if (node.mount.type === NODEFS) {
7036
7050
  return NODEFS.realPath(node);
7037
7051
  } else if (node.mount.type === PROXYFS) {
@@ -7312,10 +7326,9 @@ export function init(RuntimeName, PHPLoader) {
7312
7326
  return -ERRNO_CODES.EINVAL;
7313
7327
  }
7314
7328
 
7315
- const nativeFilePath =
7316
- locking.get_native_path_from_vfs_path(vfsPath);
7317
-
7318
7329
  try {
7330
+ const nativeFilePath =
7331
+ locking.get_native_path_from_vfs_path(vfsPath);
7319
7332
  const conflictingLock = await Promise.resolve(
7320
7333
  PHPLoader.fileLockManager.findFirstConflictingByteRangeLock(
7321
7334
  nativeFilePath,
@@ -7451,16 +7464,16 @@ export function init(RuntimeName, PHPLoader) {
7451
7464
  pid,
7452
7465
  };
7453
7466
 
7454
- const nativeFilePath =
7455
- locking.get_native_path_from_vfs_path(vfsPath);
7456
- _js_wasm_trace(
7457
- 'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
7458
- fd,
7459
- vfsPath,
7460
- rangeLock
7461
- );
7462
-
7463
7467
  try {
7468
+ const nativeFilePath =
7469
+ locking.get_native_path_from_vfs_path(vfsPath);
7470
+ _js_wasm_trace(
7471
+ 'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
7472
+ fd,
7473
+ vfsPath,
7474
+ rangeLock
7475
+ );
7476
+
7464
7477
  const succeeded = await Promise.resolve(
7465
7478
  PHPLoader.fileLockManager.lockFileByteRange(
7466
7479
  nativeFilePath,
@@ -17367,9 +17380,9 @@ export function init(RuntimeName, PHPLoader) {
17367
17380
  return -ERRNO_CODES.EINVAL;
17368
17381
  }
17369
17382
 
17370
- const nativeFilePath =
17371
- locking.get_native_path_from_vfs_path(vfsPath);
17372
17383
  try {
17384
+ const nativeFilePath =
17385
+ locking.get_native_path_from_vfs_path(vfsPath);
17373
17386
  const obtainedLock = await Promise.resolve(
17374
17387
  PHPLoader.fileLockManager.lockWholeFile(nativeFilePath, {
17375
17388
  type: lockOpType,
@@ -17705,9 +17718,9 @@ export function init(RuntimeName, PHPLoader) {
17705
17718
  if (!cp.stdin.closed) {
17706
17719
  cp.stdin.end();
17707
17720
  }
17708
- _free(buffer);
17709
- _free(iov);
17710
- _free(pnum);
17721
+ PHPLoader['free'](buffer);
17722
+ PHPLoader['free'](iov);
17723
+ PHPLoader['free'](pnum);
17711
17724
  }
17712
17725
 
17713
17726
  // pump() can never alter the result of this function.
@@ -18354,6 +18367,11 @@ export function init(RuntimeName, PHPLoader) {
18354
18367
  return ret;
18355
18368
  };
18356
18369
 
18370
+ var setErrNo = (value) => {
18371
+ HEAP32[___errno_location() >> 2] = value;
18372
+ return value;
18373
+ };
18374
+
18357
18375
  var FS_createPath = FS.createPath;
18358
18376
 
18359
18377
  var FS_unlink = (path) => FS.unlink(path);
@@ -30778,11 +30796,6 @@ export function init(RuntimeName, PHPLoader) {
30778
30796
 
30779
30797
  var allocateUTF8 = stringToNewUTF8;
30780
30798
 
30781
- var setErrNo = (value) => {
30782
- HEAP32[___errno_location() >> 2] = value;
30783
- return value;
30784
- };
30785
-
30786
30799
  var demangle = (func) => {
30787
30800
  // If demangle has failed before, stop demangling any further function names
30788
30801
  // This avoids an infinite recursion with malloc()->abort()->stackTrace()->demangle()->malloc()->...
@@ -34263,6 +34276,7 @@ export function init(RuntimeName, PHPLoader) {
34263
34276
  Module['FS_createDevice'] = FS_createDevice;
34264
34277
  Module['FS_createDataFile'] = FS_createDataFile;
34265
34278
  Module['FS_createLazyFile'] = FS_createLazyFile;
34279
+ Module['setErrNo'] = setErrNo;
34266
34280
  Module['PROXYFS'] = PROXYFS;
34267
34281
 
34268
34282
  async function callMain(args = []) {
package/jspi/php_7_4.js CHANGED
@@ -8,7 +8,7 @@ import path from 'path';
8
8
 
9
9
  const dependencyFilename = path.join(__dirname, '7_4_33', 'php_7_4.wasm');
10
10
  export { dependencyFilename };
11
- export const dependenciesTotalSize = 23088313;
11
+ export const dependenciesTotalSize = 23088361;
12
12
  const phpVersionString = '7.4.33';
13
13
  export function init(RuntimeName, PHPLoader) {
14
14
  // The rest of the code comes from the built php.js file and esm-suffix.js
@@ -848,7 +848,7 @@ export function init(RuntimeName, PHPLoader) {
848
848
  },
849
849
  };
850
850
 
851
- var ___heap_base = 11743136;
851
+ var ___heap_base = 11743200;
852
852
 
853
853
  var alignMemory = (size, alignment) => {
854
854
  return Math.ceil(size / alignment) * alignment;
@@ -1743,13 +1743,13 @@ export function init(RuntimeName, PHPLoader) {
1743
1743
  1024
1744
1744
  );
1745
1745
 
1746
- var ___stack_high = 11743136;
1746
+ var ___stack_high = 11743200;
1747
1747
 
1748
- var ___stack_low = 10694560;
1748
+ var ___stack_low = 10694624;
1749
1749
 
1750
1750
  var ___stack_pointer = new WebAssembly.Global(
1751
1751
  { value: 'i32', mutable: true },
1752
- 11743136
1752
+ 11743200
1753
1753
  );
1754
1754
 
1755
1755
  var PATH = {
@@ -6884,26 +6884,36 @@ export function init(RuntimeName, PHPLoader) {
6884
6884
 
6885
6885
  var _fd_close = function fd_close(fd) {
6886
6886
  return Asyncify.handleAsync(async () => {
6887
- const [vfsPath, pathResolutionErrno] =
6888
- locking.get_vfs_path_from_fd(fd);
6889
- if (pathResolutionErrno !== 0) {
6890
- _js_wasm_trace(
6891
- 'fd_close(%d) get_vfs_path_from_fd error %d',
6892
- fd,
6893
- pathResolutionErrno
6894
- );
6895
- return -ERRNO_CODES.EBADF;
6896
- }
6897
-
6898
- const result = _builtin_fd_close(fd);
6899
- if (result !== 0 || !locking.maybeLockedFds.has(fd)) {
6900
- _js_wasm_trace('fd_close(%d) result %d', fd, result);
6901
- return result;
6887
+ const fdCloseResult = _builtin_fd_close(fd);
6888
+ if (fdCloseResult !== 0 || !locking.maybeLockedFds.has(fd)) {
6889
+ _js_wasm_trace('fd_close(%d) result %d', fd, fdCloseResult);
6890
+ return fdCloseResult;
6902
6891
  }
6903
- const nativeFilePath =
6904
- locking.get_native_path_from_vfs_path(vfsPath);
6905
6892
 
6906
6893
  try {
6894
+ const [vfsPath, pathResolutionErrno] =
6895
+ locking.get_vfs_path_from_fd(fd);
6896
+ if (pathResolutionErrno !== 0) {
6897
+ _js_wasm_trace(
6898
+ 'fd_close(%d) get_vfs_path_from_fd error %d',
6899
+ fd,
6900
+ pathResolutionErrno
6901
+ );
6902
+ /*
6903
+ * It looks like the file may have had an associated lock,
6904
+ * but since we cannot look up the path,
6905
+ * there is nothing more for us to do.
6906
+ *
6907
+ * NOTE: This seems possible for files that are locked and
6908
+ * then unlinked before close. It is an opportunity for a
6909
+ * lock to be orphaned in the lock manager.
6910
+ * @TODO: Explore how to ensure cleanup in this case.
6911
+ */
6912
+ return fdCloseResult;
6913
+ }
6914
+
6915
+ const nativeFilePath =
6916
+ locking.get_native_path_from_vfs_path(vfsPath);
6907
6917
  await PHPLoader.fileLockManager.releaseLocksForProcessFd(
6908
6918
  PHPLoader.processId,
6909
6919
  fd,
@@ -6915,7 +6925,7 @@ export function init(RuntimeName, PHPLoader) {
6915
6925
  } finally {
6916
6926
  locking.maybeLockedFds.delete(fd);
6917
6927
  }
6918
- return result;
6928
+ return fdCloseResult;
6919
6929
  });
6920
6930
  };
6921
6931
  _fd_close.sig = 'ii';
@@ -7030,8 +7040,12 @@ export function init(RuntimeName, PHPLoader) {
7030
7040
  }
7031
7041
  },
7032
7042
  get_native_path_from_vfs_path(vfsPath) {
7033
- // TODO: Should there be a try/catch here?
7034
- const { node } = FS.lookupPath(vfsPath, {});
7043
+ const { node } = FS.lookupPath(vfsPath, {
7044
+ noent_okay: true,
7045
+ });
7046
+ if (!node) {
7047
+ throw new Error(`No node found for VFS path ${vfsPath}`);
7048
+ }
7035
7049
  if (node.mount.type === NODEFS) {
7036
7050
  return NODEFS.realPath(node);
7037
7051
  } else if (node.mount.type === PROXYFS) {
@@ -7312,10 +7326,9 @@ export function init(RuntimeName, PHPLoader) {
7312
7326
  return -ERRNO_CODES.EINVAL;
7313
7327
  }
7314
7328
 
7315
- const nativeFilePath =
7316
- locking.get_native_path_from_vfs_path(vfsPath);
7317
-
7318
7329
  try {
7330
+ const nativeFilePath =
7331
+ locking.get_native_path_from_vfs_path(vfsPath);
7319
7332
  const conflictingLock = await Promise.resolve(
7320
7333
  PHPLoader.fileLockManager.findFirstConflictingByteRangeLock(
7321
7334
  nativeFilePath,
@@ -7451,16 +7464,16 @@ export function init(RuntimeName, PHPLoader) {
7451
7464
  pid,
7452
7465
  };
7453
7466
 
7454
- const nativeFilePath =
7455
- locking.get_native_path_from_vfs_path(vfsPath);
7456
- _js_wasm_trace(
7457
- 'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
7458
- fd,
7459
- vfsPath,
7460
- rangeLock
7461
- );
7462
-
7463
7467
  try {
7468
+ const nativeFilePath =
7469
+ locking.get_native_path_from_vfs_path(vfsPath);
7470
+ _js_wasm_trace(
7471
+ 'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
7472
+ fd,
7473
+ vfsPath,
7474
+ rangeLock
7475
+ );
7476
+
7464
7477
  const succeeded = await Promise.resolve(
7465
7478
  PHPLoader.fileLockManager.lockFileByteRange(
7466
7479
  nativeFilePath,
@@ -17367,9 +17380,9 @@ export function init(RuntimeName, PHPLoader) {
17367
17380
  return -ERRNO_CODES.EINVAL;
17368
17381
  }
17369
17382
 
17370
- const nativeFilePath =
17371
- locking.get_native_path_from_vfs_path(vfsPath);
17372
17383
  try {
17384
+ const nativeFilePath =
17385
+ locking.get_native_path_from_vfs_path(vfsPath);
17373
17386
  const obtainedLock = await Promise.resolve(
17374
17387
  PHPLoader.fileLockManager.lockWholeFile(nativeFilePath, {
17375
17388
  type: lockOpType,
@@ -17705,9 +17718,9 @@ export function init(RuntimeName, PHPLoader) {
17705
17718
  if (!cp.stdin.closed) {
17706
17719
  cp.stdin.end();
17707
17720
  }
17708
- _free(buffer);
17709
- _free(iov);
17710
- _free(pnum);
17721
+ PHPLoader['free'](buffer);
17722
+ PHPLoader['free'](iov);
17723
+ PHPLoader['free'](pnum);
17711
17724
  }
17712
17725
 
17713
17726
  // pump() can never alter the result of this function.
@@ -18358,6 +18371,11 @@ export function init(RuntimeName, PHPLoader) {
18358
18371
  return ret;
18359
18372
  };
18360
18373
 
18374
+ var setErrNo = (value) => {
18375
+ HEAP32[___errno_location() >> 2] = value;
18376
+ return value;
18377
+ };
18378
+
18361
18379
  var FS_createPath = FS.createPath;
18362
18380
 
18363
18381
  var FS_unlink = (path) => FS.unlink(path);
@@ -30782,11 +30800,6 @@ export function init(RuntimeName, PHPLoader) {
30782
30800
 
30783
30801
  var allocateUTF8 = stringToNewUTF8;
30784
30802
 
30785
- var setErrNo = (value) => {
30786
- HEAP32[___errno_location() >> 2] = value;
30787
- return value;
30788
- };
30789
-
30790
30803
  var demangle = (func) => {
30791
30804
  // If demangle has failed before, stop demangling any further function names
30792
30805
  // This avoids an infinite recursion with malloc()->abort()->stackTrace()->demangle()->malloc()->...
@@ -31262,13 +31275,13 @@ export function init(RuntimeName, PHPLoader) {
31262
31275
  // End JS library code
31263
31276
 
31264
31277
  var ASM_CONSTS = {
31265
- 10534878: ($0) => {
31278
+ 10534926: ($0) => {
31266
31279
  if (!$0) {
31267
31280
  AL.alcErr = 0xa004;
31268
31281
  return 1;
31269
31282
  }
31270
31283
  },
31271
- 10534926: ($0) => {
31284
+ 10534974: ($0) => {
31272
31285
  if (!AL.currentCtx) {
31273
31286
  err('alGetProcAddress() called without a valid context');
31274
31287
  return 1;
@@ -34263,6 +34276,7 @@ export function init(RuntimeName, PHPLoader) {
34263
34276
  Module['FS_createDevice'] = FS_createDevice;
34264
34277
  Module['FS_createDataFile'] = FS_createDataFile;
34265
34278
  Module['FS_createLazyFile'] = FS_createLazyFile;
34279
+ Module['setErrNo'] = setErrNo;
34266
34280
  Module['PROXYFS'] = PROXYFS;
34267
34281
 
34268
34282
  async function callMain(args = []) {