@scriptc/compiler 0.0.11 → 0.0.12

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.
Files changed (90) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +12 -9
  2. package/ambient/scriptc.d.ts +2 -2
  3. package/dist/backend/cc.d.ts +2 -2
  4. package/dist/backend/emission/emit-async.js +1 -1
  5. package/dist/backend/emission/emit-exprs.js +97 -52
  6. package/dist/backend/emission/emit-exprs.js.map +1 -1
  7. package/dist/backend/emission/emit-island.js +1 -1
  8. package/dist/backend/emission/emit-shapes.js +1 -1
  9. package/dist/backend/emission/emit-walkers.d.ts +14 -14
  10. package/dist/backend/emission/emit-walkers.js +44 -44
  11. package/dist/backend/emission/emit-walkers.js.map +1 -1
  12. package/dist/backend/emission/emitter.d.ts +3 -3
  13. package/dist/backend/emission/emitter.js +8 -8
  14. package/dist/backend/emission/may-throw.js +1 -1
  15. package/dist/backend/llvm/dyn.d.ts +10 -10
  16. package/dist/backend/llvm/dyn.js +26 -26
  17. package/dist/backend/llvm/dyn.js.map +1 -1
  18. package/dist/backend/llvm/emitter.js +97 -43
  19. package/dist/backend/llvm/emitter.js.map +1 -1
  20. package/dist/backend/llvm/shapes.js +1 -1
  21. package/dist/backend/llvm/walkers.js +2 -2
  22. package/dist/backend/llvm/walkers.js.map +1 -1
  23. package/dist/diagnostics/diagnostic.d.ts +1 -1
  24. package/dist/diagnostics/diagnostic.js +4 -3
  25. package/dist/diagnostics/diagnostic.js.map +1 -1
  26. package/dist/frontend/lowering/lib-boundary.js +5 -5
  27. package/dist/frontend/lowering/lib-boundary.js.map +1 -1
  28. package/dist/frontend/lowering/lower-assert.js +12 -12
  29. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  30. package/dist/frontend/lowering/lower-builtins.d.ts +7 -7
  31. package/dist/frontend/lowering/lower-builtins.js +92 -31
  32. package/dist/frontend/lowering/lower-builtins.js.map +1 -1
  33. package/dist/frontend/lowering/lower-calls.d.ts +4 -4
  34. package/dist/frontend/lowering/lower-calls.js +66 -66
  35. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  36. package/dist/frontend/lowering/lower-classes.js +31 -5
  37. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  38. package/dist/frontend/lowering/lower-containers.d.ts +5 -5
  39. package/dist/frontend/lowering/lower-containers.js +19 -19
  40. package/dist/frontend/lowering/lower-containers.js.map +1 -1
  41. package/dist/frontend/lowering/lower-emitter.js +2 -2
  42. package/dist/frontend/lowering/lower-emitter.js.map +1 -1
  43. package/dist/frontend/lowering/lower-exprs.d.ts +7 -7
  44. package/dist/frontend/lowering/lower-exprs.js +158 -112
  45. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  46. package/dist/frontend/lowering/lower-inspect.js +5 -5
  47. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  48. package/dist/frontend/lowering/lower-island.js +12 -3
  49. package/dist/frontend/lowering/lower-island.js.map +1 -1
  50. package/dist/frontend/lowering/lower-modules.js +16 -16
  51. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  52. package/dist/frontend/lowering/lower-namespaces.d.ts +11 -1
  53. package/dist/frontend/lowering/lower-namespaces.js +41 -6
  54. package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
  55. package/dist/frontend/lowering/lower-server.js +11 -11
  56. package/dist/frontend/lowering/lower-server.js.map +1 -1
  57. package/dist/frontend/lowering/lower-stmts.d.ts +1 -1
  58. package/dist/frontend/lowering/lower-stmts.js +191 -30
  59. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  60. package/dist/frontend/lowering/lower-stream.js +66 -22
  61. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  62. package/dist/frontend/lowering/lowerer.d.ts +10 -10
  63. package/dist/frontend/lowering/lowerer.js +51 -37
  64. package/dist/frontend/lowering/lowerer.js.map +1 -1
  65. package/dist/frontend/lowering/surfaces.js +2 -2
  66. package/dist/frontend/lowering/surfaces.js.map +1 -1
  67. package/dist/frontend/program.js +1 -1
  68. package/dist/frontend/shared.js +7 -7
  69. package/dist/frontend/shared.js.map +1 -1
  70. package/dist/frontend/types.d.ts +2 -2
  71. package/dist/frontend/types.js +15 -15
  72. package/dist/frontend/types.js.map +1 -1
  73. package/dist/index.js +38 -7
  74. package/dist/index.js.map +1 -1
  75. package/dist/ir/nodes.d.ts +110 -98
  76. package/dist/ir/nodes.js +48 -21
  77. package/dist/ir/nodes.js.map +1 -1
  78. package/dist/ir/validate.js +44 -34
  79. package/dist/ir/validate.js.map +1 -1
  80. package/dist/library/int-infer.js +13 -0
  81. package/dist/library/int-infer.js.map +1 -1
  82. package/dist/library/profile.d.ts +8 -6
  83. package/dist/library/profile.js.map +1 -1
  84. package/dist/library/sidecar-validate.js +1 -1
  85. package/dist/library/sidecar-validate.js.map +1 -1
  86. package/dist/library/sidecar.d.ts +1 -1
  87. package/dist/library/sidecar.js +20 -7
  88. package/dist/library/sidecar.js.map +1 -1
  89. package/package.json +2 -2
  90. package/surface-manifest.json +4 -4
@@ -474,6 +474,32 @@ export function collectClassShape(L, decl) {
474
474
  }
475
475
  }
476
476
  }
477
+ // A poisoned BASE this class EXTENDS must report EAGERLY for the same
478
+ // reason: the derived statement evaluates its heritage when module
479
+ // init reaches it (these are top-level declarations), and the base's
480
+ // fence is the COMPILER's, not Node's — Node defines the base fine and
481
+ // runs on — so a deferred trap there is a manufactured divergence, not
482
+ // the Node-parity deferral is licensed by (classFieldSuperAccessibleJs2:
483
+ // the binary refused at `class D extends C` where Node prints five
484
+ // lines). Leaf poisoned classes stay deferred — only the extends edge
485
+ // reports. Resolution runs under the collect pass's guard (this is
486
+ // collectProgram), so the lookup neither flushes nor fences.
487
+ {
488
+ const baseIdent = decl.heritageClauses
489
+ ?.find((h) => h.token === ts.SyntaxKind.ExtendsKeyword)
490
+ ?.types.map((t) => t.expression)
491
+ .filter(ts.isIdentifier)[0];
492
+ const baseSym = baseIdent ? L.resolveValueSymbol(baseIdent) : null;
493
+ const baseDiags = baseSym ? L.deferredDiags.get(baseSym) : undefined;
494
+ if (baseSym && baseDiags) {
495
+ L.deferredDiags.delete(baseSym);
496
+ if (!L.alreadyFlushed.has(baseSym)) {
497
+ L.flushedSymbols.add(baseSym);
498
+ for (const d of baseDiags)
499
+ L.pushDiag(d);
500
+ }
501
+ }
502
+ }
477
503
  }
478
504
  export function collectClassShapeInner(L, decl, jsNameOverride, inst,
479
505
  /** MIXIN instantiation mode (lower-mixins.ts): the class inside a
@@ -4362,7 +4388,7 @@ export function lowerNew(L, expr) {
4362
4388
  // like Node's message property default.
4363
4389
  const errInfo = L.builtinErrorInfoOf(symbol);
4364
4390
  // `new DOMException(message?, nameOrOptions?)`: both arguments cross
4365
- // as DOM values (absent → the DOM undefined), and the runtime owns
4391
+ // as dyn values (absent → the dyn undefined), and the runtime owns
4366
4392
  // WebIDL's resolution — ToString of the message ("" for undefined),
4367
4393
  // name from a string / an options object's `name` member (with the
4368
4394
  // `cause` own-property record) / "Error" for absent, and the legacy
@@ -4623,7 +4649,7 @@ export function lowerNew(L, expr) {
4623
4649
  const targs = L.checker.getTypeArguments(tsType);
4624
4650
  // JAVASCRIPT `new Map()` whose arguments never resolved past
4625
4651
  // Map<any, any> (no annotation, no contextual type, no seed): the
4626
- // WeakMap stance below — the VALUE lowers as an opaque DOM object
4652
+ // WeakMap stance below — the VALUE lowers as an opaque dyn object
4627
4653
  // (identity and truthiness are real), and every reached METHOD use
4628
4654
  // meets its own per-site fence at runtime. The formatter's
4629
4655
  // config-cache shape: module init constructs the caches
@@ -4656,7 +4682,7 @@ export function lowerNew(L, expr) {
4656
4682
  // `new WeakMap()` / `new WeakSet()` in JAVASCRIPT sources: no weak
4657
4683
  // container exists in the value model, but harness code constructs
4658
4684
  // one unconditionally and touches it only on paths tests don't
4659
- // reach — the value lowers as an opaque DOM object (identity only;
4685
+ // reach — the value lowers as an opaque dyn object (identity only;
4660
4686
  // every reached METHOD use meets its own per-site fence → runtime
4661
4687
  // fence). TypeScript keeps the compile fence.
4662
4688
  if ((symbol?.name === "WeakMap" || symbol?.name === "WeakSet") &&
@@ -4756,14 +4782,14 @@ export function lowerNew(L, expr) {
4756
4782
  // `new Promise(setImmediate)` (the Node-suite early-exit shape):
4757
4783
  // the executor IS the stdlib setImmediate, so resolve rides the
4758
4784
  // immediate queue — a dedicated runtime constructor arms an
4759
- // immediate that fulfills with the undefined DOM value.
4785
+ // immediate that fulfills with the undefined dyn value.
4760
4786
  {
4761
4787
  const a0 = args[0];
4762
4788
  if (ts.isIdentifier(a0) && a0.text === "setImmediate") {
4763
4789
  const sym = L.checker.getSymbolAtLocation(a0);
4764
4790
  const decls = sym ? L.checker.declarationsOf(sym) : [];
4765
4791
  if (decls.length > 0 && decls.every((d) => L.isStdlibFile(d.getSourceFile()))) {
4766
- // The settled value is the undefined DOM value — the result
4792
+ // The settled value is the undefined dyn value — the result
4767
4793
  // is promise<dyn> whatever T the checker inferred for the
4768
4794
  // unusual executor (Promise<unknown> in the suite's shape).
4769
4795
  return {