@volter/tabnode 0.5.31 → 0.5.33

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.
@@ -21136,10 +21136,17 @@ var implementation$1 = function bind2(that) {
21136
21136
  var implementation = implementation$1;
21137
21137
  var functionBind = Function.prototype.bind || implementation;
21138
21138
  var functionCall = Function.prototype.call;
21139
- var functionApply = Function.prototype.apply;
21139
+ var functionApply;
21140
+ var hasRequiredFunctionApply;
21141
+ function requireFunctionApply() {
21142
+ if (hasRequiredFunctionApply) return functionApply;
21143
+ hasRequiredFunctionApply = 1;
21144
+ functionApply = Function.prototype.apply;
21145
+ return functionApply;
21146
+ }
21140
21147
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
21141
21148
  var bind$2 = functionBind;
21142
- var $apply$1 = functionApply;
21149
+ var $apply$1 = requireFunctionApply();
21143
21150
  var $call$2 = functionCall;
21144
21151
  var $reflectApply = reflectApply;
21145
21152
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
@@ -21259,7 +21266,7 @@ var hasSymbols = requireHasSymbols()();
21259
21266
  var getProto = requireGetProto();
21260
21267
  var $ObjectGPO = requireObject_getPrototypeOf();
21261
21268
  var $ReflectGPO = requireReflect_getPrototypeOf();
21262
- var $apply = functionApply;
21269
+ var $apply = requireFunctionApply();
21263
21270
  var $call = functionCall;
21264
21271
  var needsEval = {};
21265
21272
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
@@ -21900,7 +21907,7 @@ function requireApplyBind() {
21900
21907
  if (hasRequiredApplyBind) return applyBind;
21901
21908
  hasRequiredApplyBind = 1;
21902
21909
  var bind3 = functionBind;
21903
- var $apply2 = functionApply;
21910
+ var $apply2 = requireFunctionApply();
21904
21911
  var actualApply$1 = actualApply;
21905
21912
  applyBind = function applyBind2() {
21906
21913
  return actualApply$1(bind3, $apply2, arguments);
@@ -79665,6 +79672,15 @@ function createRequire(vfs2, fsShim, process2, currentDir, moduleCache, options,
79665
79672
  runModuleBody(module, vfs2.readFileSync(prepared, "utf8"), resolvedPath, dirname$1, true);
79666
79673
  return module;
79667
79674
  }
79675
+ if (prepared) {
79676
+ const body = __substrateScopeGlobalCalls(prepareModuleCode(rawCode, resolvedPath));
79677
+ try {
79678
+ vfs2.writeFileSync(prepared, body);
79679
+ } catch {
79680
+ }
79681
+ runModuleBody(module, body, resolvedPath, dirname$1, true);
79682
+ return module;
79683
+ }
79668
79684
  }
79669
79685
  runModuleBody(module, prepareModuleCode(rawCode, resolvedPath, format2), resolvedPath, dirname$1);
79670
79686
  return module;
package/dist/index.mjs CHANGED
@@ -39326,6 +39326,15 @@ function createRequire(vfs2, fsShim, process2, currentDir, moduleCache, options,
39326
39326
  runModuleBody(module, vfs2.readFileSync(prepared, "utf8"), resolvedPath, dirname$1, true);
39327
39327
  return module;
39328
39328
  }
39329
+ if (prepared) {
39330
+ const body = __substrateScopeGlobalCalls(prepareModuleCode(rawCode, resolvedPath));
39331
+ try {
39332
+ vfs2.writeFileSync(prepared, body);
39333
+ } catch {
39334
+ }
39335
+ runModuleBody(module, body, resolvedPath, dirname$1, true);
39336
+ return module;
39337
+ }
39329
39338
  }
39330
39339
  runModuleBody(module, prepareModuleCode(rawCode, resolvedPath, format2), resolvedPath, dirname$1);
39331
39340
  return module;
@@ -40218,7 +40227,7 @@ class WorkerRuntime {
40218
40227
  this.worker = new Worker(
40219
40228
  new URL(
40220
40229
  /* @vite-ignore */
40221
- "/assets/runtime-worker-CvLlu5oq.js",
40230
+ "/assets/runtime-worker-b9-COQEP.js",
40222
40231
  import.meta.url
40223
40232
  ),
40224
40233
  { type: "module" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/tabnode",
3
- "version": "0.5.31",
3
+ "version": "0.5.33",
4
4
  "description": "Node's own library, in a browser tab.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/runtime.ts CHANGED
@@ -1997,6 +1997,20 @@ function createRequire(
1997
1997
  runModuleBody(module, vfs.readFileSync(prepared, 'utf8'), resolvedPath, dirname, true);
1998
1998
  return module;
1999
1999
  }
2000
+ // A file the image carries no body for (a package installed in the
2001
+ // tab) is prepared here once and kept under the same name, so the next
2002
+ // process takes it: every Playwright test worker required
2003
+ // playwright-core afresh, 28 s each, measured in a tab.
2004
+ if (prepared) {
2005
+ const body = __substrateScopeGlobalCalls(prepareModuleCode(rawCode, resolvedPath));
2006
+ // One write is one step of the tab's filesystem, so no reader sees
2007
+ // half a body; a rename after it failed in a forked process's realm
2008
+ // and left the half-named file behind.
2009
+ try { vfs.writeFileSync(prepared, body); }
2010
+ catch { /* a process that may not write there prepares its own */ }
2011
+ runModuleBody(module, body, resolvedPath, dirname, true);
2012
+ return module;
2013
+ }
2000
2014
  }
2001
2015
  runModuleBody(module, prepareModuleCode(rawCode, resolvedPath, format), resolvedPath, dirname);
2002
2016
  return module;