@geastack/compiler 1.0.26 → 1.0.29

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 (946) hide show
  1. package/dist/cli-coverage.js +2 -2
  2. package/dist/cli-emit.js +36 -12
  3. package/dist/compiler.d.ts +11 -9
  4. package/dist/compiler.js +264 -43
  5. package/dist/conversion/algebra.d.ts +84 -4
  6. package/dist/conversion/algebra.js +39 -0
  7. package/dist/conversion/array-view.d.ts +63 -0
  8. package/dist/conversion/array-view.js +186 -0
  9. package/dist/conversion/build.d.ts +8 -8
  10. package/dist/conversion/build.js +56 -50
  11. package/dist/conversion/certified-iterator-object-view.d.ts +13 -0
  12. package/dist/conversion/certified-iterator-object-view.js +31 -0
  13. package/dist/conversion/certified-iterator-protocols.d.ts +23 -0
  14. package/dist/conversion/certified-iterator-protocols.js +50 -0
  15. package/dist/conversion/checked-native-field-read.d.ts +7 -0
  16. package/dist/conversion/checked-native-field-read.js +36 -0
  17. package/dist/conversion/constructor-identity-family.d.ts +6 -6
  18. package/dist/conversion/constructor-identity-family.js +3 -3
  19. package/dist/conversion/derive.js +11 -8
  20. package/dist/conversion/dictionary-view.d.ts +114 -0
  21. package/dist/conversion/dictionary-view.js +275 -0
  22. package/dist/conversion/document-record-view.d.ts +89 -0
  23. package/dist/conversion/document-record-view.js +269 -0
  24. package/dist/conversion/dynamic-result-carriers.d.ts +6 -0
  25. package/dist/conversion/dynamic-result-carriers.js +43 -0
  26. package/dist/conversion/dynamic-wrapper.d.ts +52 -0
  27. package/dist/conversion/dynamic-wrapper.js +82 -0
  28. package/dist/conversion/impossible-field-read.d.ts +9 -0
  29. package/dist/conversion/impossible-field-read.js +28 -0
  30. package/dist/conversion/iterable-object-view.d.ts +1 -1
  31. package/dist/conversion/iterator-object-view.d.ts +2 -2
  32. package/dist/conversion/native-absence.d.ts +4 -0
  33. package/dist/conversion/native-absence.js +4 -0
  34. package/dist/conversion/native-buffer-method.d.ts +16 -0
  35. package/dist/conversion/native-buffer-method.js +37 -0
  36. package/dist/conversion/native-callable-adapter.d.ts +13 -0
  37. package/dist/conversion/native-callable-adapter.js +73 -0
  38. package/dist/conversion/native-descriptor-snapshot.d.ts +30 -0
  39. package/dist/conversion/native-descriptor-snapshot.js +75 -0
  40. package/dist/conversion/native-entry-writer.d.ts +21 -0
  41. package/dist/conversion/native-entry-writer.js +32 -0
  42. package/dist/conversion/native-field-view.d.ts +42 -0
  43. package/dist/conversion/native-field-view.js +145 -0
  44. package/dist/conversion/native-logical-receiver.d.ts +11 -0
  45. package/dist/conversion/native-logical-receiver.js +19 -0
  46. package/dist/conversion/native-method.d.ts +43 -0
  47. package/dist/conversion/native-method.js +56 -0
  48. package/dist/conversion/native-object-sample.d.ts +30 -0
  49. package/dist/conversion/native-object-sample.js +37 -0
  50. package/dist/conversion/native-payload-transport.d.ts +1 -1
  51. package/dist/conversion/native-payload-transport.js +1 -1
  52. package/dist/conversion/native-record-products.d.ts +15 -0
  53. package/dist/conversion/native-record-products.js +73 -0
  54. package/dist/conversion/native-selection.d.ts +18 -1
  55. package/dist/conversion/native-selection.js +117 -4
  56. package/dist/conversion/native-sum.d.ts +27 -0
  57. package/dist/conversion/native-sum.js +74 -9
  58. package/dist/conversion/native-view-origins.d.ts +12 -0
  59. package/dist/conversion/native-view-origins.js +97 -0
  60. package/dist/conversion/nodes.d.ts +75 -7
  61. package/dist/conversion/nodes.js +694 -19
  62. package/dist/conversion/number-storage.d.ts +8 -0
  63. package/dist/conversion/number-storage.js +8 -0
  64. package/dist/conversion/operand-view.js +10 -1
  65. package/dist/conversion/promise-adoption.d.ts +15 -0
  66. package/dist/conversion/promise-adoption.js +29 -0
  67. package/dist/conversion/protocol-iterator.d.ts +3 -3
  68. package/dist/conversion/recipe-closure.d.ts +14 -0
  69. package/dist/conversion/recipe-closure.js +135 -0
  70. package/dist/conversion/record-view.d.ts +51 -26
  71. package/dist/conversion/record-view.js +160 -97
  72. package/dist/conversion/registry.d.ts +18 -2
  73. package/dist/conversion/sibling-class.d.ts +4 -0
  74. package/dist/conversion/sibling-class.js +7 -0
  75. package/dist/conversion/structural-plan.d.ts +87 -0
  76. package/dist/conversion/structural-plan.js +480 -0
  77. package/dist/ir/absent-class-arm.d.ts +1 -1
  78. package/dist/ir/absent-class-arm.js +1 -1
  79. package/dist/ir/async-result-conventions.d.ts +15 -0
  80. package/dist/ir/async-result-conventions.js +140 -0
  81. package/dist/ir/borrowed-call-arguments.d.ts +3 -3
  82. package/dist/ir/borrowed-call-arguments.js +9 -9
  83. package/dist/ir/build.d.ts +20 -29
  84. package/dist/ir/build.js +116 -19
  85. package/dist/ir/call-dispatch.js +153 -40
  86. package/dist/ir/call-entry.d.ts +14 -3
  87. package/dist/ir/call-entry.js +63 -5
  88. package/dist/ir/callable-class-flow.d.ts +48 -3
  89. package/dist/ir/callable-class-flow.js +1509 -81
  90. package/dist/ir/callable-flow-candidates.d.ts +25 -0
  91. package/dist/ir/callable-flow-candidates.js +135 -0
  92. package/dist/ir/callable-identity-demand.d.ts +2 -2
  93. package/dist/ir/callable-identity-demand.js +33 -1
  94. package/dist/ir/callable-member-candidates.d.ts +1 -1
  95. package/dist/ir/callable-member-candidates.js +2 -2
  96. package/dist/ir/callable-records.js +1 -0
  97. package/dist/ir/callable-site-escape.js +3 -4
  98. package/dist/ir/captures.js +1 -1
  99. package/dist/ir/certificate.d.ts +1 -0
  100. package/dist/ir/certificate.js +2 -1
  101. package/dist/ir/certify/carrier-keys.d.ts +2 -2
  102. package/dist/ir/certify/carrier-keys.js +4 -4
  103. package/dist/ir/certify/has-property-key.d.ts +3 -3
  104. package/dist/ir/certify/has-property-key.js +3 -3
  105. package/dist/ir/certify/parallel-region.d.ts +26 -0
  106. package/dist/ir/certify/parallel-region.js +1331 -0
  107. package/dist/ir/certify/property-access-keys.d.ts +11 -11
  108. package/dist/ir/certify/property-access-keys.js +11 -11
  109. package/dist/ir/certify/property-access.js +7 -9
  110. package/dist/ir/certify.d.ts +66 -3
  111. package/dist/ir/certify.js +1197 -36
  112. package/dist/ir/class-allocation-domain.d.ts +9 -0
  113. package/dist/ir/class-allocation-domain.js +111 -0
  114. package/dist/ir/class-evaluation.d.ts +2 -3
  115. package/dist/ir/class-evaluation.js +2 -3
  116. package/dist/ir/class-static-fields.d.ts +12 -1
  117. package/dist/ir/class-static-fields.js +25 -0
  118. package/dist/ir/closed-normal-results.d.ts +18 -0
  119. package/dist/ir/closed-normal-results.js +208 -0
  120. package/dist/ir/construct-entry.js +1 -0
  121. package/dist/ir/construction-only-fields.d.ts +20 -1
  122. package/dist/ir/construction-only-fields.js +95 -9
  123. package/dist/ir/convert-carriers.d.ts +7 -0
  124. package/dist/ir/convert-carriers.js +12 -0
  125. package/dist/ir/coroutine-bodies.d.ts +74 -0
  126. package/dist/ir/coroutine-bodies.js +93 -0
  127. package/dist/ir/dead-logical-merge.d.ts +7 -0
  128. package/dist/ir/dead-logical-merge.js +84 -0
  129. package/dist/ir/dead-values.d.ts +7 -5
  130. package/dist/ir/dead-values.js +34 -5
  131. package/dist/ir/deferral.d.ts +3 -1
  132. package/dist/ir/deferral.js +19 -6
  133. package/dist/ir/dense-loops.d.ts +96 -7
  134. package/dist/ir/dense-loops.js +333 -17
  135. package/dist/ir/descriptor-own-protocol.d.ts +12 -0
  136. package/dist/ir/descriptor-own-protocol.js +35 -0
  137. package/dist/ir/dynamic-constructor-conversions.d.ts +17 -0
  138. package/dist/ir/dynamic-constructor-conversions.js +52 -0
  139. package/dist/ir/emission-representations.js +44 -2
  140. package/dist/ir/facts.d.ts +14 -2
  141. package/dist/ir/facts.js +23 -9
  142. package/dist/ir/fixed-data-definition-attributes.d.ts +10 -0
  143. package/dist/ir/fixed-data-definition-attributes.js +200 -0
  144. package/dist/ir/fixed-data-definition.d.ts +23 -5
  145. package/dist/ir/fixed-data-definition.js +80 -2
  146. package/dist/ir/function-reflection-demand.d.ts +11 -0
  147. package/dist/ir/function-reflection-demand.js +71 -0
  148. package/dist/ir/generic-call-entry.d.ts +18 -0
  149. package/dist/ir/generic-call-entry.js +94 -0
  150. package/dist/ir/hoist.d.ts +16 -3
  151. package/dist/ir/hoist.js +121 -8
  152. package/dist/ir/host-method-aliases.d.ts +15 -0
  153. package/dist/ir/host-method-aliases.js +61 -0
  154. package/dist/ir/host-namespace-reads.d.ts +24 -0
  155. package/dist/ir/host-namespace-reads.js +151 -0
  156. package/dist/ir/host-promise-conversions.d.ts +5 -0
  157. package/dist/ir/host-promise-conversions.js +61 -0
  158. package/dist/ir/host-template-conversions.d.ts +34 -0
  159. package/dist/ir/host-template-conversions.js +357 -0
  160. package/dist/ir/instance-reparenting.d.ts +3 -4
  161. package/dist/ir/instantiation.d.ts +1 -1
  162. package/dist/ir/instantiation.js +1 -1
  163. package/dist/ir/integer-storage.d.ts +19 -9
  164. package/dist/ir/integer-storage.js +158 -44
  165. package/dist/ir/integers.d.ts +34 -7
  166. package/dist/ir/integers.js +240 -7
  167. package/dist/ir/integrity-restrictions.d.ts +4 -4
  168. package/dist/ir/integrity-restrictions.js +7 -4
  169. package/dist/ir/internal-operation-conversions.d.ts +7 -0
  170. package/dist/ir/internal-operation-conversions.js +195 -0
  171. package/dist/ir/intrinsic-call-facts.d.ts +40 -0
  172. package/dist/ir/intrinsic-call-facts.js +176 -0
  173. package/dist/ir/key-order-observation.d.ts +1 -1
  174. package/dist/ir/lazy-splits.d.ts +20 -0
  175. package/dist/ir/lazy-splits.js +58 -0
  176. package/dist/ir/literal-set-membership.d.ts +2 -2
  177. package/dist/ir/literal-set-membership.js +2 -2
  178. package/dist/ir/logical-receivers.d.ts +15 -0
  179. package/dist/ir/logical-receivers.js +98 -0
  180. package/dist/ir/lower-allocation.js +16 -13
  181. package/dist/ir/lower-destructuring.js +7 -6
  182. package/dist/ir/lower-graph.d.ts +4 -4
  183. package/dist/ir/lower-graph.js +2 -2
  184. package/dist/ir/lower-invocation.d.ts +2 -2
  185. package/dist/ir/lower-invocation.js +99 -57
  186. package/dist/ir/lower-narrow.js +35 -13
  187. package/dist/ir/lower-operands.d.ts +40 -11
  188. package/dist/ir/lower-operands.js +206 -87
  189. package/dist/ir/lower-property.js +31 -8
  190. package/dist/ir/lower.js +9 -9
  191. package/dist/ir/merge-conversions.d.ts +18 -0
  192. package/dist/ir/merge-conversions.js +106 -0
  193. package/dist/ir/model.d.ts +138 -28
  194. package/dist/ir/native-accessor-definition.d.ts +104 -0
  195. package/dist/ir/native-accessor-definition.js +735 -0
  196. package/dist/ir/native-array-descriptor-snapshot.d.ts +45 -0
  197. package/dist/ir/native-array-descriptor-snapshot.js +380 -0
  198. package/dist/ir/native-array-insertion.d.ts +16 -0
  199. package/dist/ir/native-array-insertion.js +42 -0
  200. package/dist/ir/native-callable-argument.d.ts +38 -0
  201. package/dist/ir/native-callable-argument.js +128 -0
  202. package/dist/ir/native-callable-data-flow.d.ts +9 -0
  203. package/dist/ir/native-callable-data-flow.js +59 -0
  204. package/dist/ir/native-callable-data-owner.d.ts +45 -0
  205. package/dist/ir/native-callable-data-owner.js +755 -0
  206. package/dist/ir/native-callable-data-reads.d.ts +45 -0
  207. package/dist/ir/native-callable-data-reads.js +282 -0
  208. package/dist/ir/native-callable-data-slots.d.ts +78 -0
  209. package/dist/ir/native-callable-data-slots.js +403 -0
  210. package/dist/ir/native-callable-data-write.d.ts +58 -0
  211. package/dist/ir/native-callable-data-write.js +254 -0
  212. package/dist/ir/native-callable-integrity.d.ts +23 -0
  213. package/dist/ir/native-callable-integrity.js +77 -0
  214. package/dist/ir/native-callable-own-property.d.ts +42 -0
  215. package/dist/ir/native-callable-own-property.js +505 -0
  216. package/dist/ir/native-callable-prototype.d.ts +38 -0
  217. package/dist/ir/native-callable-prototype.js +307 -0
  218. package/dist/ir/native-callable-readonly-set.d.ts +25 -0
  219. package/dist/ir/native-callable-readonly-set.js +238 -0
  220. package/dist/ir/native-class-accessor.d.ts +3 -3
  221. package/dist/ir/native-class-accessor.js +3 -3
  222. package/dist/ir/native-class-construction.js +2 -2
  223. package/dist/ir/native-constructor-reads.d.ts +15 -0
  224. package/dist/ir/native-constructor-reads.js +156 -0
  225. package/dist/ir/native-constructor-static.d.ts +18 -0
  226. package/dist/ir/native-constructor-static.js +61 -0
  227. package/dist/ir/native-data-definition.d.ts +43 -0
  228. package/dist/ir/native-data-definition.js +222 -0
  229. package/dist/ir/native-document-array-entries.d.ts +15 -0
  230. package/dist/ir/native-document-array-entries.js +37 -0
  231. package/dist/ir/native-document-entries.d.ts +21 -0
  232. package/dist/ir/native-document-entries.js +74 -0
  233. package/dist/ir/native-entry-field-views.d.ts +18 -0
  234. package/dist/ir/native-entry-field-views.js +62 -0
  235. package/dist/ir/native-field-view-domains.d.ts +43 -0
  236. package/dist/ir/native-field-view-domains.js +300 -0
  237. package/dist/ir/native-field-view-facts.d.ts +97 -0
  238. package/dist/ir/native-field-view-facts.js +341 -0
  239. package/dist/ir/native-fixed-layout.js +1 -1
  240. package/dist/ir/native-host-construction.d.ts +4 -6
  241. package/dist/ir/native-host-construction.js +4 -6
  242. package/dist/ir/native-host-method-reads.d.ts +13 -0
  243. package/dist/ir/native-host-method-reads.js +53 -0
  244. package/dist/ir/native-iterator-field-views.d.ts +15 -0
  245. package/dist/ir/native-iterator-field-views.js +39 -0
  246. package/dist/ir/native-iterator-receivers.d.ts +8 -0
  247. package/dist/ir/native-iterator-receivers.js +59 -0
  248. package/dist/ir/native-logical-receiver-body.d.ts +8 -0
  249. package/dist/ir/native-logical-receiver-body.js +23 -0
  250. package/dist/ir/native-method-frames.d.ts +18 -0
  251. package/dist/ir/native-method-frames.js +127 -0
  252. package/dist/ir/native-method-read-source.d.ts +16 -0
  253. package/dist/ir/native-method-read-source.js +61 -0
  254. package/dist/ir/native-object-data-slots.d.ts +60 -0
  255. package/dist/ir/native-object-data-slots.js +493 -0
  256. package/dist/ir/native-object-sample.d.ts +32 -0
  257. package/dist/ir/native-object-sample.js +113 -0
  258. package/dist/ir/native-own-assignment.d.ts +123 -0
  259. package/dist/ir/native-own-assignment.js +529 -0
  260. package/dist/ir/native-property-coercibility.d.ts +3 -0
  261. package/dist/ir/native-property-coercibility.js +10 -0
  262. package/dist/ir/native-property-key-texts.d.ts +11 -0
  263. package/dist/ir/native-property-key-texts.js +41 -0
  264. package/dist/ir/native-property-presence-effects.d.ts +11 -0
  265. package/dist/ir/native-property-presence-effects.js +19 -0
  266. package/dist/ir/native-property-presence.d.ts +27 -0
  267. package/dist/ir/native-property-presence.js +275 -0
  268. package/dist/ir/native-prototype-calls.d.ts +19 -0
  269. package/dist/ir/native-prototype-calls.js +53 -0
  270. package/dist/ir/native-prototype-conversions.d.ts +5 -0
  271. package/dist/ir/native-prototype-conversions.js +46 -0
  272. package/dist/ir/native-prototype-presence-demand.d.ts +9 -0
  273. package/dist/ir/native-prototype-presence-demand.js +58 -0
  274. package/dist/ir/native-record-index.d.ts +1 -1
  275. package/dist/ir/native-union-method-targets.d.ts +8 -0
  276. package/dist/ir/native-union-method-targets.js +69 -0
  277. package/dist/ir/no-normal-call-completion.d.ts +15 -0
  278. package/dist/ir/no-normal-call-completion.js +184 -0
  279. package/dist/ir/non-normal-receiver.d.ts +39 -0
  280. package/dist/ir/non-normal-receiver.js +253 -0
  281. package/dist/ir/operation-conversions.d.ts +29 -0
  282. package/dist/ir/operation-conversions.js +484 -0
  283. package/dist/ir/operation-index.d.ts +1 -1
  284. package/dist/ir/presence-proof.d.ts +1 -1
  285. package/dist/ir/presence-proof.js +1 -0
  286. package/dist/ir/program-conversions.d.ts +48 -0
  287. package/dist/ir/program-conversions.js +221 -0
  288. package/dist/ir/program-facts.d.ts +4 -1
  289. package/dist/ir/program-facts.js +9 -7
  290. package/dist/ir/promise-reaction-conversions.d.ts +6 -0
  291. package/dist/ir/promise-reaction-conversions.js +92 -0
  292. package/dist/ir/property-read-conversions.d.ts +10 -0
  293. package/dist/ir/property-read-conversions.js +124 -0
  294. package/dist/ir/proven-branches.d.ts +2 -1
  295. package/dist/ir/proven-branches.js +97 -10
  296. package/dist/ir/publish-conversion-recipes.d.ts +27 -0
  297. package/dist/ir/publish-conversion-recipes.js +246 -0
  298. package/dist/ir/publish-native-field-view-facts.d.ts +17 -0
  299. package/dist/ir/publish-native-field-view-facts.js +119 -0
  300. package/dist/ir/queries.js +42 -4
  301. package/dist/ir/read-only-dictionary.d.ts +38 -0
  302. package/dist/ir/read-only-dictionary.js +281 -0
  303. package/dist/ir/reflection-demand.d.ts +2 -0
  304. package/dist/ir/reflection-demand.js +600 -44
  305. package/dist/ir/shake.d.ts +3 -0
  306. package/dist/ir/shake.js +24 -14
  307. package/dist/ir/shared-empty-records.js +1 -1
  308. package/dist/ir/short-circuit-threading.d.ts +23 -0
  309. package/dist/ir/short-circuit-threading.js +133 -0
  310. package/dist/ir/spread-conversions.d.ts +27 -0
  311. package/dist/ir/spread-conversions.js +134 -0
  312. package/dist/ir/spread-copy-elision.d.ts +2 -2
  313. package/dist/ir/spread-copy-elision.js +7 -4
  314. package/dist/ir/string-layout-reuse.d.ts +9 -8
  315. package/dist/ir/string-layout-reuse.js +8 -16
  316. package/dist/ir/string-length-reuse.d.ts +20 -4
  317. package/dist/ir/string-length-reuse.js +57 -13
  318. package/dist/ir/transfer.d.ts +5 -5
  319. package/dist/ir/transfer.js +53 -31
  320. package/dist/ir/typed-property-access.d.ts +2 -0
  321. package/dist/ir/typed-property-access.js +21 -8
  322. package/dist/ir/virtual-call-frames.d.ts +7 -0
  323. package/dist/ir/virtual-call-frames.js +8 -0
  324. package/dist/native-signatures.d.ts +45 -0
  325. package/dist/native-signatures.js +368 -0
  326. package/dist/plugins/gea/host.d.ts +6 -1
  327. package/dist/plugins/gea/host.js +30 -1
  328. package/dist/plugins/gea/lower.js +9 -3
  329. package/dist/plugins/gea/members.js +1 -1
  330. package/dist/plugins/gea/plugin.js +2 -1
  331. package/dist/plugins/gea/prelude.d.ts +1 -1
  332. package/dist/plugins/gea/prelude.js +1 -1
  333. package/dist/plugins/gea/reactive-slots.js +6 -6
  334. package/dist/plugins/gea/render-bridge.js +5 -6
  335. package/dist/plugins/gea/user-agent-styles.js +1 -1
  336. package/dist/plugins/installed.d.ts +2 -2
  337. package/dist/plugins/installed.js +2 -2
  338. package/dist/plugins/load.js +1 -1
  339. package/dist/plugins/model.d.ts +21 -36
  340. package/dist/plugins/webgl/host.d.ts +23 -23
  341. package/dist/plugins/webgl/host.js +25 -26
  342. package/dist/plugins/webgl/plugin.d.ts +16 -19
  343. package/dist/plugins/webgl/plugin.js +16 -23
  344. package/dist/project-preparation.js +12 -14
  345. package/dist/projection/abi.js +13 -10
  346. package/dist/projection/bindings.d.ts +8 -0
  347. package/dist/projection/bindings.js +36 -5
  348. package/dist/projection/callee.d.ts +17 -15
  349. package/dist/projection/callee.js +108 -81
  350. package/dist/projection/class-property-presence.d.ts +1 -1
  351. package/dist/projection/class-property-presence.js +1 -1
  352. package/dist/projection/classes.d.ts +2 -0
  353. package/dist/projection/classes.js +4 -1
  354. package/dist/projection/dispatch.d.ts +19 -3
  355. package/dist/projection/dispatch.js +39 -16
  356. package/dist/projection/fields.d.ts +14 -2
  357. package/dist/projection/fields.js +100 -38
  358. package/dist/projection/function-source.d.ts +5 -0
  359. package/dist/projection/function-source.js +15 -0
  360. package/dist/projection/immediate-callees.d.ts +12 -0
  361. package/dist/projection/immediate-callees.js +36 -0
  362. package/dist/projection/index-protocols.d.ts +12 -0
  363. package/dist/projection/index-protocols.js +39 -0
  364. package/dist/projection/instance-test.d.ts +8 -0
  365. package/dist/projection/instance-test.js +3 -1
  366. package/dist/projection/method-values.d.ts +7 -0
  367. package/dist/projection/method-values.js +29 -0
  368. package/dist/projection/native-accessor-access.d.ts +26 -0
  369. package/dist/projection/native-accessor-access.js +18 -0
  370. package/dist/projection/native-callable-data.d.ts +24 -0
  371. package/dist/projection/native-callable-data.js +101 -0
  372. package/dist/projection/native-expando.d.ts +3 -0
  373. package/dist/projection/native-expando.js +13 -0
  374. package/dist/projection/native-object-data.d.ts +47 -0
  375. package/dist/projection/native-object-data.js +203 -0
  376. package/dist/projection/native-prototype-methods.d.ts +22 -0
  377. package/dist/projection/native-prototype-methods.js +161 -0
  378. package/dist/projection/regexp-fields.d.ts +35 -0
  379. package/dist/projection/regexp-fields.js +80 -0
  380. package/dist/projection/slots.d.ts +5 -1
  381. package/dist/projection/slots.js +89 -10
  382. package/dist/representation/derive.d.ts +5 -7
  383. package/dist/representation/derive.js +78 -78
  384. package/dist/representation/difference.js +1 -1
  385. package/dist/representation/host-abi.d.ts +2 -2
  386. package/dist/representation/host-abi.js +4 -5
  387. package/dist/representation/host-templates.d.ts +6 -2
  388. package/dist/representation/host-templates.js +8 -2
  389. package/dist/representation/intersection.d.ts +3 -3
  390. package/dist/representation/intersection.js +3 -3
  391. package/dist/representation/merge.js +1 -1
  392. package/dist/representation/model.d.ts +27 -22
  393. package/dist/representation/model.js +35 -22
  394. package/dist/representation/native-callable-data-storage.d.ts +85 -0
  395. package/dist/representation/native-callable-data-storage.js +398 -0
  396. package/dist/representation/native-data-properties.d.ts +14 -0
  397. package/dist/representation/native-data-properties.js +52 -0
  398. package/dist/representation/native-logical-receiver.d.ts +36 -0
  399. package/dist/representation/native-logical-receiver.js +92 -0
  400. package/dist/representation/object-shape.d.ts +1 -1
  401. package/dist/representation/object-shape.js +1 -1
  402. package/dist/representation/optional.js +2 -2
  403. package/dist/representation/physical-carrier.d.ts +25 -0
  404. package/dist/representation/physical-carrier.js +153 -0
  405. package/dist/representation/policies.d.ts +16 -10
  406. package/dist/representation/policies.js +5 -1
  407. package/dist/representation/primitives.js +3 -0
  408. package/dist/representation/promise-resolution.d.ts +19 -0
  409. package/dist/representation/promise-resolution.js +50 -0
  410. package/dist/representation/prototype-domains.d.ts +43 -0
  411. package/dist/representation/prototype-domains.js +226 -0
  412. package/dist/representation/proxy-carriers.d.ts +3 -3
  413. package/dist/representation/proxy-carriers.js +2 -3
  414. package/dist/representation/publish.d.ts +4 -0
  415. package/dist/representation/publish.js +73 -42
  416. package/dist/representation/record-fields.d.ts +2 -2
  417. package/dist/representation/record-fields.js +2 -2
  418. package/dist/representation/static-field-cells.d.ts +1 -1
  419. package/dist/representation/structural-method-abi.d.ts +6 -0
  420. package/dist/representation/structural-method-abi.js +13 -0
  421. package/dist/representation/unassigned-binding-cells.d.ts +3 -3
  422. package/dist/representation/union.js +19 -4
  423. package/dist/representation/unwritten-record-members.d.ts +6 -6
  424. package/dist/representation/unwritten-record-members.js +1 -1
  425. package/dist/representation/value-records.js +77 -5
  426. package/dist/representation/verify.js +1 -1
  427. package/dist/representation/well-known-symbols.d.ts +3 -0
  428. package/dist/representation/well-known-symbols.js +11 -0
  429. package/dist/semantics/alias-this-field-declaration-transform.js +3 -3
  430. package/dist/semantics/ambient-type-realization-transform.d.ts +19 -20
  431. package/dist/semantics/ambient-type-realization-transform.js +20 -12
  432. package/dist/semantics/ambient.d.ts +13 -13
  433. package/dist/semantics/ambient.js +12 -12
  434. package/dist/semantics/borrowed-builtin-call-bind-source-transform.d.ts +5 -0
  435. package/dist/semantics/borrowed-builtin-call-bind-source-transform.js +110 -52
  436. package/dist/semantics/borrowed-method-receiver-copy-source-transform.d.ts +4 -4
  437. package/dist/semantics/borrowed-method-receiver-copy-source-transform.js +4 -4
  438. package/dist/semantics/call-invalidated-narrowing.js +2 -2
  439. package/dist/semantics/callable-origins.d.ts +49 -1
  440. package/dist/semantics/callable-origins.js +148 -32
  441. package/dist/semantics/callable-own-data-slots.d.ts +122 -0
  442. package/dist/semantics/callable-own-data-slots.js +421 -0
  443. package/dist/semantics/class-alias.d.ts +4 -4
  444. package/dist/semantics/class-alias.js +4 -4
  445. package/dist/semantics/class-heritage.d.ts +8 -7
  446. package/dist/semantics/class-heritage.js +8 -7
  447. package/dist/semantics/commonjs-wrapper.js +5 -2
  448. package/dist/semantics/constructor-function-class-source-transform.js +2 -3
  449. package/dist/semantics/constructor-slot-subclasses.d.ts +1 -1
  450. package/dist/semantics/constructor-slot-subclasses.js +5 -5
  451. package/dist/semantics/declaration-overlay-transform.d.ts +9 -12
  452. package/dist/semantics/declaration-overlay-transform.js +138 -141
  453. package/dist/semantics/declared-integers.d.ts +24 -0
  454. package/dist/semantics/declared-integers.js +34 -0
  455. package/dist/semantics/define-property-source-transform.js +21 -8
  456. package/dist/semantics/dynamic-fallback.d.ts +1 -1
  457. package/dist/semantics/dynamic-fallback.js +1 -1
  458. package/dist/semantics/frontend.d.ts +12 -16
  459. package/dist/semantics/frontend.js +187 -75
  460. package/dist/semantics/host-methods.d.ts +3 -3
  461. package/dist/semantics/host-methods.js +1 -1
  462. package/dist/semantics/host-protocols.d.ts +3 -3
  463. package/dist/semantics/host-protocols.js +26 -26
  464. package/dist/semantics/interface-families.d.ts +2 -2
  465. package/dist/semantics/interface-families.js +46 -47
  466. package/dist/semantics/interface-implementors.d.ts +12 -15
  467. package/dist/semantics/interface-implementors.js +12 -15
  468. package/dist/semantics/jsdoc-namepath-transform.js +7 -7
  469. package/dist/semantics/model/operands.d.ts +18 -3
  470. package/dist/semantics/model/operands.js +41 -0
  471. package/dist/semantics/model/operations.d.ts +82 -1
  472. package/dist/semantics/model/selected-signature.d.ts +24 -3
  473. package/dist/semantics/model/structural-type-table.js +24 -6
  474. package/dist/semantics/model/structural-types.d.ts +10 -8
  475. package/dist/semantics/model/structural-types.js +7 -5
  476. package/dist/semantics/module-resolution.js +3 -2
  477. package/dist/semantics/native-callable-readonly-set.d.ts +17 -0
  478. package/dist/semantics/native-callable-readonly-set.js +1 -0
  479. package/dist/semantics/native-function-signatures.d.ts +14 -0
  480. package/dist/semantics/native-function-signatures.js +96 -0
  481. package/dist/semantics/native-object-data-slots.d.ts +72 -0
  482. package/dist/semantics/native-object-data-slots.js +679 -0
  483. package/dist/semantics/native-own-assignment.d.ts +62 -0
  484. package/dist/semantics/native-own-assignment.js +1 -0
  485. package/dist/semantics/normalize/absent-globals.d.ts +8 -8
  486. package/dist/semantics/normalize/absent-globals.js +5 -5
  487. package/dist/semantics/normalize/arguments-objects.d.ts +3 -1
  488. package/dist/semantics/normalize/arguments-objects.js +1 -1
  489. package/dist/semantics/normalize/asserted-argument-arms.d.ts +7 -7
  490. package/dist/semantics/normalize/asserted-arm-absence.d.ts +1 -2
  491. package/dist/semantics/normalize/asserted-arm-absence.js +1 -2
  492. package/dist/semantics/normalize/binding-fixpoint.js +3 -3
  493. package/dist/semantics/normalize/bivariant-slot-parameter.d.ts +2 -2
  494. package/dist/semantics/normalize/bivariant-slot-parameter.js +6 -6
  495. package/dist/semantics/normalize/callable-data-write.d.ts +46 -0
  496. package/dist/semantics/normalize/callable-data-write.js +182 -0
  497. package/dist/semantics/normalize/census.js +5 -5
  498. package/dist/semantics/normalize/class-instance-record-statement.d.ts +1 -1
  499. package/dist/semantics/normalize/class-instance-record-statement.js +1 -1
  500. package/dist/semantics/normalize/collection-bindings.d.ts +11 -13
  501. package/dist/semantics/normalize/collection-bindings.js +60 -33
  502. package/dist/semantics/normalize/commonjs-module-record.d.ts +7 -4
  503. package/dist/semantics/normalize/commonjs-module-record.js +93 -4
  504. package/dist/semantics/normalize/contribution.js +4 -4
  505. package/dist/semantics/normalize/dead-method-copies.d.ts +5 -5
  506. package/dist/semantics/normalize/dead-typeof-guards.d.ts +2 -2
  507. package/dist/semantics/normalize/dead-typeof-guards.js +6 -6
  508. package/dist/semantics/normalize/deferred-intrinsic-protocols.d.ts +22 -13
  509. package/dist/semantics/normalize/deferred-intrinsic-protocols.js +85 -13
  510. package/dist/semantics/normalize/derived-expression-type.d.ts +129 -91
  511. package/dist/semantics/normalize/derived-expression-type.js +419 -192
  512. package/dist/semantics/normalize/field-bindings.d.ts +4 -4
  513. package/dist/semantics/normalize/field-bindings.js +334 -67
  514. package/dist/semantics/normalize/flow/array-element-continuation.d.ts +2 -2
  515. package/dist/semantics/normalize/flow/array-element-continuation.js +35 -18
  516. package/dist/semantics/normalize/flow/callable-array-origins.d.ts +1 -1
  517. package/dist/semantics/normalize/flow/callable-array-origins.js +3 -3
  518. package/dist/semantics/normalize/flow/callable-completions.d.ts +2 -2
  519. package/dist/semantics/normalize/flow/callable-completions.js +2 -2
  520. package/dist/semantics/normalize/flow/callable-reach.d.ts +19 -6
  521. package/dist/semantics/normalize/flow/callable-reach.js +722 -289
  522. package/dist/semantics/normalize/flow/class-family-member-read.js +24 -29
  523. package/dist/semantics/normalize/flow/collection-value-continuation.d.ts +2 -2
  524. package/dist/semantics/normalize/flow/collection-value-continuation.js +2 -2
  525. package/dist/semantics/normalize/flow/component-solver.d.ts +19 -16
  526. package/dist/semantics/normalize/flow/component-solver.js +138 -69
  527. package/dist/semantics/normalize/flow/computed-key-set.d.ts +6 -7
  528. package/dist/semantics/normalize/flow/computed-key-set.js +20 -1
  529. package/dist/semantics/normalize/flow/export-importers.js +4 -4
  530. package/dist/semantics/normalize/flow/host-text-sink.d.ts +3 -2
  531. package/dist/semantics/normalize/flow/host-text-sink.js +4 -3
  532. package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.js +3 -2
  533. package/dist/semantics/normalize/flow/intrinsic-data-definition.d.ts +2 -2
  534. package/dist/semantics/normalize/flow/intrinsic-data-definition.js +3 -3
  535. package/dist/semantics/normalize/flow/invocation-facts.d.ts +3 -2
  536. package/dist/semantics/normalize/flow/invocation-facts.js +3 -3
  537. package/dist/semantics/normalize/flow/member-call-forwarding.d.ts +12 -6
  538. package/dist/semantics/normalize/flow/member-call-forwarding.js +94 -21
  539. package/dist/semantics/normalize/flow/model.d.ts +5 -5
  540. package/dist/semantics/normalize/flow/model.js +11 -11
  541. package/dist/semantics/normalize/flow/node-path-token.js +3 -3
  542. package/dist/semantics/normalize/flow/origin-authority.d.ts +3 -3
  543. package/dist/semantics/normalize/flow/owned-class-receivers.js +8 -7
  544. package/dist/semantics/normalize/flow/parameter-values.js +6 -6
  545. package/dist/semantics/normalize/flow/proof-hypotheses.d.ts +30 -4
  546. package/dist/semantics/normalize/flow/proof-hypotheses.js +56 -5
  547. package/dist/semantics/normalize/flow/proof-memo-settlement.d.ts +21 -0
  548. package/dist/semantics/normalize/flow/proof-memo-settlement.js +32 -0
  549. package/dist/semantics/normalize/flow/record-alias-closure.d.ts +1 -1
  550. package/dist/semantics/normalize/flow/record-alias-closure.js +1 -1
  551. package/dist/semantics/normalize/flow/seeded-origins.d.ts +4 -4
  552. package/dist/semantics/normalize/flow/seeded-origins.js +4 -4
  553. package/dist/semantics/normalize/flow/source-accessor-descriptor.d.ts +22 -0
  554. package/dist/semantics/normalize/flow/source-accessor-descriptor.js +210 -0
  555. package/dist/semantics/normalize/flow/source-callable-own-data.d.ts +33 -0
  556. package/dist/semantics/normalize/flow/source-callable-own-data.js +238 -0
  557. package/dist/semantics/normalize/flow/source-callable-readonly-set.d.ts +26 -0
  558. package/dist/semantics/normalize/flow/source-callable-readonly-set.js +337 -0
  559. package/dist/semantics/normalize/flow/source-class-data.d.ts +7 -7
  560. package/dist/semantics/normalize/flow/source-class-data.js +25 -26
  561. package/dist/semantics/normalize/flow/source-class-static-data.d.ts +2 -2
  562. package/dist/semantics/normalize/flow/source-class-static-data.js +2 -2
  563. package/dist/semantics/normalize/flow/source-commonjs-exports.d.ts +15 -0
  564. package/dist/semantics/normalize/flow/source-commonjs-exports.js +7 -0
  565. package/dist/semantics/normalize/flow/source-descriptor-protocol.d.ts +20 -0
  566. package/dist/semantics/normalize/flow/source-descriptor-protocol.js +75 -0
  567. package/dist/semantics/normalize/flow/source-executing-parameter-values.d.ts +8 -0
  568. package/dist/semantics/normalize/flow/source-executing-parameter-values.js +93 -0
  569. package/dist/semantics/normalize/flow/source-global-binding.d.ts +13 -0
  570. package/dist/semantics/normalize/flow/source-global-binding.js +42 -0
  571. package/dist/semantics/normalize/flow/source-intrinsic-member-data.d.ts +27 -0
  572. package/dist/semantics/normalize/flow/source-intrinsic-member-data.js +178 -0
  573. package/dist/semantics/normalize/flow/source-invocation-frame-layout.d.ts +1 -1
  574. package/dist/semantics/normalize/flow/source-invocation-frame-layout.js +31 -11
  575. package/dist/semantics/normalize/flow/source-invocation-receiver.d.ts +7 -3
  576. package/dist/semantics/normalize/flow/source-invocation-receiver.js +30 -2
  577. package/dist/semantics/normalize/flow/source-native-class-alias.d.ts +7 -0
  578. package/dist/semantics/normalize/flow/source-native-class-alias.js +91 -0
  579. package/dist/semantics/normalize/flow/source-normal-predecessor.d.ts +10 -0
  580. package/dist/semantics/normalize/flow/source-normal-predecessor.js +90 -0
  581. package/dist/semantics/normalize/flow/source-property-key.d.ts +3 -0
  582. package/dist/semantics/normalize/flow/source-property-key.js +7 -0
  583. package/dist/semantics/normalize/flow/source-read-protocol.d.ts +20 -0
  584. package/dist/semantics/normalize/flow/source-read-protocol.js +108 -0
  585. package/dist/semantics/normalize/flow/source-record-data.js +31 -30
  586. package/dist/semantics/normalize/flow/source-value-session.d.ts +106 -3
  587. package/dist/semantics/normalize/flow/source-value-session.js +1172 -218
  588. package/dist/semantics/normalize/flow/standard-prototype-method-source.d.ts +16 -0
  589. package/dist/semantics/normalize/flow/standard-prototype-method-source.js +64 -0
  590. package/dist/semantics/normalize/flow/targets.d.ts +13 -14
  591. package/dist/semantics/normalize/flow/targets.js +20 -23
  592. package/dist/semantics/normalize/flow/value-flow.d.ts +2 -4
  593. package/dist/semantics/normalize/flow/value-flow.js +4 -13
  594. package/dist/semantics/normalize/flow/value-provenance.d.ts +23 -3
  595. package/dist/semantics/normalize/flow/value-provenance.js +44 -4
  596. package/dist/semantics/normalize/fresh-dictionary-storage.d.ts +32 -0
  597. package/dist/semantics/normalize/fresh-dictionary-storage.js +530 -0
  598. package/dist/semantics/normalize/fresh-indexed-storage.d.ts +43 -0
  599. package/dist/semantics/normalize/fresh-indexed-storage.js +88 -0
  600. package/dist/semantics/normalize/fresh-ordinary-object.d.ts +8 -0
  601. package/dist/semantics/normalize/fresh-ordinary-object.js +27 -0
  602. package/dist/semantics/normalize/gating.js +2 -2
  603. package/dist/semantics/normalize/global-host-mutations.js +770 -261
  604. package/dist/semantics/normalize/host-effect-contracts.d.ts +1 -1
  605. package/dist/semantics/normalize/host-effect-contracts.js +1 -1
  606. package/dist/semantics/normalize/host-mutation-computed-keys.d.ts +2 -2
  607. package/dist/semantics/normalize/host-mutation-computed-keys.js +8 -0
  608. package/dist/semantics/normalize/host-mutation-key-reader.d.ts +6 -11
  609. package/dist/semantics/normalize/host-mutation-key-reader.js +11 -28
  610. package/dist/semantics/normalize/host-mutation-keys.d.ts +11 -7
  611. package/dist/semantics/normalize/host-mutation-keys.js +26 -15
  612. package/dist/semantics/normalize/identities.js +20 -17
  613. package/dist/semantics/normalize/implicit-arguments-tuple.d.ts +8 -3
  614. package/dist/semantics/normalize/implicit-arguments-tuple.js +21 -4
  615. package/dist/semantics/normalize/installed-global-properties.d.ts +17 -0
  616. package/dist/semantics/normalize/installed-global-properties.js +214 -0
  617. package/dist/semantics/normalize/instantiation.js +6 -6
  618. package/dist/semantics/normalize/intrinsic-accessor-getter.d.ts +1 -1
  619. package/dist/semantics/normalize/intrinsic-property-call.d.ts +6 -1
  620. package/dist/semantics/normalize/intrinsic-property-call.js +19 -0
  621. package/dist/semantics/normalize/intrinsic-prototype.d.ts +7 -0
  622. package/dist/semantics/normalize/intrinsic-prototype.js +10 -0
  623. package/dist/semantics/normalize/intrinsic-return-identity.d.ts +5 -0
  624. package/dist/semantics/normalize/intrinsic-return-identity.js +29 -0
  625. package/dist/semantics/normalize/jsdoc-type-names.js +59 -63
  626. package/dist/semantics/normalize/keyof.js +3 -3
  627. package/dist/semantics/normalize/local-bindings.d.ts +4 -4
  628. package/dist/semantics/normalize/local-bindings.js +60 -61
  629. package/dist/semantics/normalize/logical-object-truthiness.d.ts +8 -0
  630. package/dist/semantics/normalize/logical-object-truthiness.js +20 -0
  631. package/dist/semantics/normalize/merged-declaration.d.ts +3 -3
  632. package/dist/semantics/normalize/merged-declaration.js +3 -3
  633. package/dist/semantics/normalize/never-override-result.d.ts +2 -3
  634. package/dist/semantics/normalize/never-override-result.js +2 -3
  635. package/dist/semantics/normalize/null-blind-parameter.d.ts +2 -2
  636. package/dist/semantics/normalize/null-blind-parameter.js +2 -2
  637. package/dist/semantics/normalize/object-bag-bindings.d.ts +19 -19
  638. package/dist/semantics/normalize/object-bag-bindings.js +334 -141
  639. package/dist/semantics/normalize/omitted-stated-parameter.d.ts +8 -8
  640. package/dist/semantics/normalize/omitted-stated-parameter.js +8 -9
  641. package/dist/semantics/normalize/override-field-arms.d.ts +3 -3
  642. package/dist/semantics/normalize/override-field-arms.js +15 -16
  643. package/dist/semantics/normalize/parameter-bindings.d.ts +13 -12
  644. package/dist/semantics/normalize/parameter-bindings.js +173 -139
  645. package/dist/semantics/normalize/parameter-slot.d.ts +9 -10
  646. package/dist/semantics/normalize/parameter-slot.js +16 -17
  647. package/dist/semantics/normalize/physical-overload-result.d.ts +8 -8
  648. package/dist/semantics/normalize/physical-overload-result.js +10 -10
  649. package/dist/semantics/normalize/producer-context.d.ts +27 -12
  650. package/dist/semantics/normalize/producers/allocations.js +5 -1
  651. package/dist/semantics/normalize/producers/bindings.js +8 -7
  652. package/dist/semantics/normalize/producers/class-lifecycle.js +52 -7
  653. package/dist/semantics/normalize/producers/computations.js +27 -3
  654. package/dist/semantics/normalize/producers/control.js +5 -5
  655. package/dist/semantics/normalize/producers/declaration-lifecycle.js +4 -4
  656. package/dist/semantics/normalize/producers/destructuring.js +10 -5
  657. package/dist/semantics/normalize/producers/erasure.d.ts +9 -0
  658. package/dist/semantics/normalize/producers/erasure.js +22 -0
  659. package/dist/semantics/normalize/producers/invocations.d.ts +1 -1
  660. package/dist/semantics/normalize/producers/invocations.js +200 -55
  661. package/dist/semantics/normalize/producers/logical-merge-type.d.ts +2 -2
  662. package/dist/semantics/normalize/producers/logical-merge-type.js +12 -12
  663. package/dist/semantics/normalize/producers/native-callable-readonly-set.d.ts +6 -0
  664. package/dist/semantics/normalize/producers/native-callable-readonly-set.js +24 -0
  665. package/dist/semantics/normalize/producers/native-own-assignment.d.ts +14 -0
  666. package/dist/semantics/normalize/producers/native-own-assignment.js +153 -0
  667. package/dist/semantics/normalize/producers/properties.js +153 -20
  668. package/dist/semantics/normalize/producers/protocol.js +4 -4
  669. package/dist/semantics/normalize/producers/references.js +21 -19
  670. package/dist/semantics/normalize/producers/shared.d.ts +1 -1
  671. package/dist/semantics/normalize/producers/shared.js +59 -58
  672. package/dist/semantics/normalize/producers/spread-arguments.js +7 -3
  673. package/dist/semantics/normalize/producers/tuple-spread.d.ts +2 -2
  674. package/dist/semantics/normalize/producers/tuple-spread.js +5 -5
  675. package/dist/semantics/normalize/property-key-domain.d.ts +6 -6
  676. package/dist/semantics/normalize/property-key-domain.js +7 -7
  677. package/dist/semantics/normalize/reachability.d.ts +6 -7
  678. package/dist/semantics/normalize/reachability.js +60 -62
  679. package/dist/semantics/normalize/record-home-arms.js +2 -3
  680. package/dist/semantics/normalize/record-link-families.d.ts +1 -1
  681. package/dist/semantics/normalize/record-link-families.js +1 -1
  682. package/dist/semantics/normalize/record-stand-in-arms.d.ts +4 -5
  683. package/dist/semantics/normalize/return-bindings.d.ts +19 -9
  684. package/dist/semantics/normalize/return-bindings.js +49 -41
  685. package/dist/semantics/normalize/script-global-redefinition.d.ts +1 -1
  686. package/dist/semantics/normalize/script-global-redefinition.js +1 -1
  687. package/dist/semantics/normalize/shared-array-storage.d.ts +4 -5
  688. package/dist/semantics/normalize/shared-array-storage.js +7 -8
  689. package/dist/semantics/normalize/sloppy-absence.d.ts +6 -3
  690. package/dist/semantics/normalize/sloppy-absence.js +7 -3
  691. package/dist/semantics/normalize/source-object-prototype-absence.d.ts +7 -0
  692. package/dist/semantics/normalize/source-object-prototype-absence.js +19 -0
  693. package/dist/semantics/normalize/specialization.d.ts +10 -10
  694. package/dist/semantics/normalize/specialization.js +107 -112
  695. package/dist/semantics/normalize/specialized-source-frames.d.ts +11 -0
  696. package/dist/semantics/normalize/specialized-source-frames.js +41 -0
  697. package/dist/semantics/normalize/structural-array-element.d.ts +5 -5
  698. package/dist/semantics/normalize/structural-array-element.js +40 -39
  699. package/dist/semantics/normalize/structural-array-read.js +3 -3
  700. package/dist/semantics/normalize/structural-callable.d.ts +15 -1
  701. package/dist/semantics/normalize/structural-callable.js +35 -3
  702. package/dist/semantics/normalize/structural-creation-order.d.ts +2 -2
  703. package/dist/semantics/normalize/structural-declarations.d.ts +22 -21
  704. package/dist/semantics/normalize/structural-declarations.js +42 -42
  705. package/dist/semantics/normalize/structural-declared-body.js +10 -11
  706. package/dist/semantics/normalize/structural-indexed-access.js +2 -2
  707. package/dist/semantics/normalize/structural-instantiated-member.d.ts +9 -10
  708. package/dist/semantics/normalize/structural-instantiated-member.js +43 -30
  709. package/dist/semantics/normalize/structural-joins.d.ts +4 -16
  710. package/dist/semantics/normalize/structural-joins.js +5 -65
  711. package/dist/semantics/normalize/structural-layout-relevance.d.ts +5 -5
  712. package/dist/semantics/normalize/structural-layout-relevance.js +22 -23
  713. package/dist/semantics/normalize/structural-layout-type.d.ts +1 -1
  714. package/dist/semantics/normalize/structural-layout-type.js +140 -107
  715. package/dist/semantics/normalize/structural-local-union.d.ts +1 -1
  716. package/dist/semantics/normalize/structural-local-union.js +38 -12
  717. package/dist/semantics/normalize/structural-mutable-field.d.ts +9 -0
  718. package/dist/semantics/normalize/structural-mutable-field.js +152 -0
  719. package/dist/semantics/normalize/structural-parts.d.ts +6 -0
  720. package/dist/semantics/normalize/structural-parts.js +35 -32
  721. package/dist/semantics/normalize/structural-receiver.d.ts +3 -3
  722. package/dist/semantics/normalize/structural-receiver.js +12 -13
  723. package/dist/semantics/normalize/structural-self-reference.d.ts +12 -11
  724. package/dist/semantics/normalize/structural-self-reference.js +24 -25
  725. package/dist/semantics/normalize/structural.d.ts +13 -3
  726. package/dist/semantics/normalize/structural.js +400 -201
  727. package/dist/semantics/normalize/suppressed-write-arms.d.ts +10 -11
  728. package/dist/semantics/normalize/symbol-keyed-this-slots.d.ts +6 -6
  729. package/dist/semantics/normalize/symbol-keyed-this-slots.js +4 -4
  730. package/dist/semantics/normalize/unresolvable-names.d.ts +2 -3
  731. package/dist/semantics/normalize/unresolvable-names.js +2 -2
  732. package/dist/semantics/normalize/unshared-array-result.d.ts +4 -4
  733. package/dist/semantics/normalize/unshared-array-result.js +4 -4
  734. package/dist/semantics/package-sources.js +2 -3
  735. package/dist/semantics/program.d.ts +10 -13
  736. package/dist/semantics/program.js +80 -26
  737. package/dist/semantics/property-key.d.ts +9 -0
  738. package/dist/semantics/property-key.js +25 -0
  739. package/dist/semantics/prototype-object-class-source-transform.js +2 -2
  740. package/dist/semantics/prototype-reparenting.d.ts +1 -1
  741. package/dist/semantics/prototype-reparenting.js +1 -1
  742. package/dist/semantics/shared-declaration-files.d.ts +6 -1
  743. package/dist/semantics/shared-declaration-files.js +2 -2
  744. package/dist/semantics/source-transform-protocol.d.ts +26 -0
  745. package/dist/semantics/source-transform-protocol.js +1 -0
  746. package/dist/semantics/stable-checker.js +9 -13
  747. package/dist/semantics/subclass-member-overlay-transform.d.ts +2 -2
  748. package/dist/semantics/subclass-member-overlay-transform.js +89 -88
  749. package/dist/semantics/this-constructor-source-transform.js +2 -2
  750. package/dist/semantics/unchecked-guard-argument-copies.d.ts +3 -3
  751. package/dist/semantics/unchecked-write-member-declarations.d.ts +9 -11
  752. package/dist/semantics/unchecked-write-member-declarations.js +11 -13
  753. package/dist/semantics/uninstantiable-classes.d.ts +1 -1
  754. package/dist/semantics/uninstantiable-classes.js +1 -1
  755. package/dist/targets/cpp/balanced-units.d.ts +1 -1
  756. package/dist/targets/cpp/balanced-units.js +1 -1
  757. package/dist/targets/cpp/borrowed-arm-projections.d.ts +2 -3
  758. package/dist/targets/cpp/borrowed-arm-projections.js +2 -3
  759. package/dist/targets/cpp/borrowed-call-entry.js +3 -3
  760. package/dist/targets/cpp/captures.d.ts +2 -2
  761. package/dist/targets/cpp/captures.js +4 -4
  762. package/dist/targets/cpp/char-code-buffers.d.ts +1 -1
  763. package/dist/targets/cpp/char-code-buffers.js +4 -1
  764. package/dist/targets/cpp/class-layout.d.ts +7 -17
  765. package/dist/targets/cpp/class-layout.js +6 -13
  766. package/dist/targets/cpp/class-properties/computed-method-value.d.ts +1 -1
  767. package/dist/targets/cpp/class-properties/computed-method-value.js +5 -27
  768. package/dist/targets/cpp/class-properties/emit-class-properties.d.ts +49 -59
  769. package/dist/targets/cpp/class-properties/emit-class-properties.js +68 -232
  770. package/dist/targets/cpp/class-properties/native-method-read.d.ts +5 -0
  771. package/dist/targets/cpp/class-properties/native-method-read.js +60 -0
  772. package/dist/targets/cpp/class-properties/native-prototype.d.ts +3 -1
  773. package/dist/targets/cpp/class-properties/native-prototype.js +5 -6
  774. package/dist/targets/cpp/class-ref-transport.d.ts +1 -11
  775. package/dist/targets/cpp/class-ref-transport.js +1 -9
  776. package/dist/targets/cpp/conversions.js +613 -252
  777. package/dist/targets/cpp/coroutine-bodies.d.ts +1 -97
  778. package/dist/targets/cpp/coroutine-bodies.js +1 -187
  779. package/dist/targets/cpp/document.js +1 -1
  780. package/dist/targets/cpp/emit-allocation.d.ts +0 -38
  781. package/dist/targets/cpp/emit-allocation.js +63 -88
  782. package/dist/targets/cpp/emit-array-view.d.ts +7 -0
  783. package/dist/targets/cpp/emit-array-view.js +47 -0
  784. package/dist/targets/cpp/emit-arrays.d.ts +9 -52
  785. package/dist/targets/cpp/emit-arrays.js +177 -113
  786. package/dist/targets/cpp/emit-binding-reference.d.ts +10 -0
  787. package/dist/targets/cpp/emit-binding-reference.js +19 -1
  788. package/dist/targets/cpp/emit-bindings.js +19 -24
  789. package/dist/targets/cpp/emit-buffers.d.ts +8 -4
  790. package/dist/targets/cpp/emit-buffers.js +88 -47
  791. package/dist/targets/cpp/emit-callable-view.d.ts +6 -0
  792. package/dist/targets/cpp/emit-callable-view.js +133 -0
  793. package/dist/targets/cpp/emit-callable.d.ts +11 -1
  794. package/dist/targets/cpp/emit-callable.js +225 -266
  795. package/dist/targets/cpp/emit-carrier-members.d.ts +2 -2
  796. package/dist/targets/cpp/emit-carrier-members.js +42 -35
  797. package/dist/targets/cpp/emit-certified-conversion.d.ts +7 -0
  798. package/dist/targets/cpp/emit-certified-conversion.js +27 -0
  799. package/dist/targets/cpp/emit-context.d.ts +123 -64
  800. package/dist/targets/cpp/emit-context.js +147 -44
  801. package/dist/targets/cpp/emit-descriptor-snapshot.d.ts +10 -0
  802. package/dist/targets/cpp/emit-descriptor-snapshot.js +60 -0
  803. package/dist/targets/cpp/emit-dictionary-view.d.ts +6 -0
  804. package/dist/targets/cpp/emit-dictionary-view.js +102 -0
  805. package/dist/targets/cpp/emit-document-record-view.d.ts +3 -0
  806. package/dist/targets/cpp/emit-document-record-view.js +104 -0
  807. package/dist/targets/cpp/emit-dynamic-properties.d.ts +42 -17
  808. package/dist/targets/cpp/emit-dynamic-properties.js +118 -72
  809. package/dist/targets/cpp/emit-equality.d.ts +2 -1
  810. package/dist/targets/cpp/emit-equality.js +65 -45
  811. package/dist/targets/cpp/emit-exceptions.js +1 -1
  812. package/dist/targets/cpp/emit-in.js +22 -11
  813. package/dist/targets/cpp/emit-instanceof.js +15 -14
  814. package/dist/targets/cpp/emit-integers.d.ts +40 -3
  815. package/dist/targets/cpp/emit-integers.js +76 -5
  816. package/dist/targets/cpp/emit-iterable-object-view.d.ts +2 -0
  817. package/dist/targets/cpp/emit-iterable-object-view.js +15 -11
  818. package/dist/targets/cpp/emit-iterator-object-view.d.ts +2 -0
  819. package/dist/targets/cpp/emit-iterator-object-view.js +24 -16
  820. package/dist/targets/cpp/emit-iterator.d.ts +2 -0
  821. package/dist/targets/cpp/emit-iterator.js +115 -43
  822. package/dist/targets/cpp/emit-json.js +6 -6
  823. package/dist/targets/cpp/emit-jsx.js +2 -2
  824. package/dist/targets/cpp/emit-live-field-view.d.ts +26 -0
  825. package/dist/targets/cpp/emit-live-field-view.js +50 -0
  826. package/dist/targets/cpp/emit-narrowing.d.ts +60 -139
  827. package/dist/targets/cpp/emit-narrowing.js +694 -624
  828. package/dist/targets/cpp/emit-native-accessor-definition.d.ts +10 -0
  829. package/dist/targets/cpp/emit-native-accessor-definition.js +94 -0
  830. package/dist/targets/cpp/emit-native-callable-data.d.ts +23 -0
  831. package/dist/targets/cpp/emit-native-callable-data.js +117 -0
  832. package/dist/targets/cpp/emit-native-document-entry.d.ts +4 -0
  833. package/dist/targets/cpp/emit-native-document-entry.js +52 -0
  834. package/dist/targets/cpp/emit-native-field-view.d.ts +26 -0
  835. package/dist/targets/cpp/emit-native-field-view.js +217 -0
  836. package/dist/targets/cpp/emit-native-method.d.ts +16 -0
  837. package/dist/targets/cpp/emit-native-method.js +90 -0
  838. package/dist/targets/cpp/emit-native-object-data.d.ts +7 -0
  839. package/dist/targets/cpp/emit-native-object-data.js +66 -0
  840. package/dist/targets/cpp/emit-native-object-sample.d.ts +8 -0
  841. package/dist/targets/cpp/emit-native-object-sample.js +34 -0
  842. package/dist/targets/cpp/emit-native-own-assignment.d.ts +7 -0
  843. package/dist/targets/cpp/emit-native-own-assignment.js +119 -0
  844. package/dist/targets/cpp/emit-native-selection.d.ts +2 -2
  845. package/dist/targets/cpp/emit-native-selection.js +14 -5
  846. package/dist/targets/cpp/emit-number-storage.d.ts +2 -0
  847. package/dist/targets/cpp/emit-number-storage.js +1 -0
  848. package/dist/targets/cpp/emit-presence.d.ts +3 -4
  849. package/dist/targets/cpp/emit-presence.js +43 -21
  850. package/dist/targets/cpp/emit-properties.js +224 -111
  851. package/dist/targets/cpp/emit-protocol-iterator.d.ts +2 -0
  852. package/dist/targets/cpp/emit-protocol-iterator.js +45 -23
  853. package/dist/targets/cpp/emit-record-view.d.ts +5 -10
  854. package/dist/targets/cpp/emit-record-view.js +223 -269
  855. package/dist/targets/cpp/emit-return.js +33 -8
  856. package/dist/targets/cpp/emit-scopes.d.ts +2 -2
  857. package/dist/targets/cpp/emit-sum-widening.js +13 -5
  858. package/dist/targets/cpp/emit-tonumber.d.ts +1 -1
  859. package/dist/targets/cpp/emit-tonumber.js +3 -3
  860. package/dist/targets/cpp/emit-tostring.d.ts +20 -2
  861. package/dist/targets/cpp/emit-tostring.js +131 -28
  862. package/dist/targets/cpp/emit-typeof.d.ts +4 -0
  863. package/dist/targets/cpp/emit-typeof.js +29 -1
  864. package/dist/targets/cpp/emit-union-properties.d.ts +6 -23
  865. package/dist/targets/cpp/emit-union-properties.js +127 -235
  866. package/dist/targets/cpp/emit.d.ts +4 -1
  867. package/dist/targets/cpp/emit.js +336 -119
  868. package/dist/targets/cpp/error-types.d.ts +1 -3
  869. package/dist/targets/cpp/error-types.js +1 -2
  870. package/dist/targets/cpp/evaluated-once.d.ts +4 -4
  871. package/dist/targets/cpp/evaluated-once.js +5 -5
  872. package/dist/targets/cpp/function-source-reads.d.ts +2 -15
  873. package/dist/targets/cpp/function-source-reads.js +3 -38
  874. package/dist/targets/cpp/host/core-globals.d.ts +5 -0
  875. package/dist/targets/cpp/host/core-globals.js +10 -0
  876. package/dist/targets/cpp/host/emit-host-arity.js +1 -1
  877. package/dist/targets/cpp/host/emit-host-invoke.js +73 -23
  878. package/dist/targets/cpp/host/emit-host-object.d.ts +2 -1
  879. package/dist/targets/cpp/host/emit-host-object.js +328 -145
  880. package/dist/targets/cpp/host/emit-host-properties.js +4 -6
  881. package/dist/targets/cpp/host/emit-host-reflect.js +29 -5
  882. package/dist/targets/cpp/host/emit-host-value.d.ts +1 -1
  883. package/dist/targets/cpp/host/emit-host-value.js +2 -2
  884. package/dist/targets/cpp/host/host-members.d.ts +11 -0
  885. package/dist/targets/cpp/host/host-members.js +27 -5
  886. package/dist/targets/cpp/host/host-method-aliases.d.ts +1 -30
  887. package/dist/targets/cpp/host/host-method-aliases.js +1 -76
  888. package/dist/targets/cpp/host/native-protocols.js +1 -1
  889. package/dist/targets/cpp/host/object-protocol.d.ts +1 -1
  890. package/dist/targets/cpp/host/object-protocol.js +24 -24
  891. package/dist/targets/cpp/host-namespace-reads.d.ts +1 -83
  892. package/dist/targets/cpp/host-namespace-reads.js +1 -113
  893. package/dist/targets/cpp/manifest/capabilities.js +33 -33
  894. package/dist/targets/cpp/manifest.d.ts +5 -0
  895. package/dist/targets/cpp/manifest.js +38 -14
  896. package/dist/targets/cpp/native-collection-base.js +7 -6
  897. package/dist/targets/cpp/native-debug-source.d.ts +15 -0
  898. package/dist/targets/cpp/native-debug-source.js +21 -0
  899. package/dist/targets/cpp/native-error-base.d.ts +1 -1
  900. package/dist/targets/cpp/native-error-base.js +1 -1
  901. package/dist/targets/cpp/native-narrowing-transport.d.ts +2 -0
  902. package/dist/targets/cpp/native-narrowing-transport.js +25 -5
  903. package/dist/targets/cpp/native-view-targets.d.ts +3 -0
  904. package/dist/targets/cpp/native-view-targets.js +5 -0
  905. package/dist/targets/cpp/prototype/emit-prototype-array.d.ts +3 -33
  906. package/dist/targets/cpp/prototype/emit-prototype-array.js +40 -22
  907. package/dist/targets/cpp/prototype/emit-prototype-date.d.ts +1 -58
  908. package/dist/targets/cpp/prototype/emit-prototype-date.js +14 -97
  909. package/dist/targets/cpp/prototype/emit-prototype-error.d.ts +20 -0
  910. package/dist/targets/cpp/prototype/emit-prototype-error.js +2 -2
  911. package/dist/targets/cpp/prototype/emit-prototype-invoke.d.ts +3 -27
  912. package/dist/targets/cpp/prototype/emit-prototype-invoke.js +60 -52
  913. package/dist/targets/cpp/prototype/emit-prototype-iterator.d.ts +1 -41
  914. package/dist/targets/cpp/prototype/emit-prototype-iterator.js +4 -43
  915. package/dist/targets/cpp/prototype/emit-prototype-promise.d.ts +2 -13
  916. package/dist/targets/cpp/prototype/emit-prototype-promise.js +10 -58
  917. package/dist/targets/cpp/prototype/emit-prototype-regexp.d.ts +4 -25
  918. package/dist/targets/cpp/prototype/emit-prototype-regexp.js +16 -81
  919. package/dist/targets/cpp/prototype/emit-prototype-string.d.ts +1 -1
  920. package/dist/targets/cpp/prototype/emit-prototype-string.js +17 -28
  921. package/dist/targets/cpp/prototype/prototype-method-reads.js +4 -80
  922. package/dist/targets/cpp/reactive-dependencies.d.ts +12 -6
  923. package/dist/targets/cpp/reactive-dependencies.js +62 -42
  924. package/dist/targets/cpp/reactive-origins.js +12 -0
  925. package/dist/targets/cpp/records.d.ts +133 -14
  926. package/dist/targets/cpp/records.js +345 -153
  927. package/dist/targets/cpp/regexp-types.d.ts +1 -26
  928. package/dist/targets/cpp/regexp-types.js +4 -29
  929. package/dist/targets/cpp/segment-scopes.d.ts +30 -0
  930. package/dist/targets/cpp/segment-scopes.js +294 -0
  931. package/dist/targets/cpp/translation-unit.d.ts +21 -2
  932. package/dist/targets/cpp/translation-unit.js +121 -276
  933. package/dist/targets/cpp/types.d.ts +8 -3
  934. package/dist/targets/cpp/types.js +30 -6
  935. package/dist/targets/cpp/virtual-callees.d.ts +18 -0
  936. package/dist/targets/cpp/virtual-callees.js +27 -0
  937. package/dist/targets/cpp/virtual-methods.d.ts +7 -7
  938. package/dist/targets/cpp/virtual-methods.js +213 -58
  939. package/package.json +8 -3
  940. package/src/targets/cpp/runtime/gea_dictionary_view.h +204 -0
  941. package/src/targets/cpp/runtime/gea_document_view.h +845 -0
  942. package/src/targets/cpp/runtime/gea_dynamic_proxy.h +66 -23
  943. package/src/targets/cpp/runtime/gea_eval.h +6 -6
  944. package/src/targets/cpp/runtime/gea_runtime.h +7550 -1166
  945. package/dist/targets/cpp/direct-call-receivers.d.ts +0 -37
  946. package/dist/targets/cpp/direct-call-receivers.js +0 -79
@@ -1,24 +1,32 @@
1
1
  import { passingOf, representationKey } from '../../../representation/model.js';
2
2
  import { hostMemberTemplateOf } from '../../../representation/host-templates.js';
3
3
  import { instanceReparentVerdictOf, isClassConstructorCarrier } from '../../../ir/instance-reparenting.js';
4
- import { createCppEmitBlockedError, isCppEmitBlockedError, operandText } from '../emit-context.js';
4
+ import { createCppEmitBlockedError, operandText } from '../emit-context.js';
5
5
  import { evaluatedOnceText } from '../evaluated-once.js';
6
6
  import { canonicalIndexLiteral, memberAccessOperator } from '../emit-carrier-members.js';
7
+ import { callableIdentityEqualityText } from '../emit-equality.js';
7
8
  import { classMemberOf, lazyArrowFieldPlanOf } from '../class-layout.js';
8
- import { alignedValueText, dynamicCarrierBoxText, recipeText } from '../emit-narrowing.js';
9
- import { getOwnValue, isDynamicCarrier, objectViewFrom, objectViewOf, ownEnumerableKeysText, ownKeyFields, ownKeyPresenceText, refuseDictionaryArm, refuseObjectCarrier, runtimeOwnKeyText, setOwnCallableText, setOwnText } from './object-protocol.js';
9
+ import { alignedValueText, dynamicCarrierBoxText, namedConversionText, recipeText } from '../emit-narrowing.js';
10
+ import { nativeAccessorDefinitionText, nativeAccessorObservedFunctionText } from '../emit-native-accessor-definition.js';
11
+ import { nativeOwnAssignmentText } from '../emit-native-own-assignment.js';
12
+ import { nativeArrayDescriptorSnapshotText, nativeDescriptorSnapshotDefinitionLines } from '../emit-descriptor-snapshot.js';
13
+ import { nativeCallablePrototypeObservationText } from '../emit-native-callable-data.js';
14
+ import { getOwnValue, isDynamicCarrier, objectViewFrom, objectViewOf, nativeHandleShapeCallText, callableShapeCallText, ownEnumerableKeysText, ownKeyFields, ownKeyPresenceText, refuseDictionaryArm, refuseObjectCarrier, runtimeOwnKeyText, setOwnCallableText, setOwnText } from './object-protocol.js';
10
15
  import { hostIntrinsicLengthOf, hostMemberOf } from './host-members.js';
11
16
  import { hostFunctionValueText, hostPrototypeMethodValueText } from './emit-host-value.js';
12
17
  import { armAt, armIs } from '../emit-union-properties.js';
13
18
  import { constructorStateText, constructorViewFieldFor } from '../class-properties/emit-class-properties.js';
14
19
  import { isNativeError } from '../error-types.js';
15
- import { nativeBaseFieldOf, recordFieldsOfShape, recordIndexesOfShape } from '../records.js';
20
+ import { nativeBaseFieldOf, nativeFieldPolicyType, recordFieldsOfShape, recordIndexesOfShape } from '../records.js';
16
21
  import { keyOrderUnobservedIn } from '../key-order-tracking.js';
17
22
  import { indexedRecordViewOf } from '../../../ir/certify/carrier-keys.js';
18
23
  import { cppArrayExtensionStructName, cppBodyName, cppClassName, cppRecordFieldAttributesName, cppRecordFieldName, cppRecordFieldPresenceName, cppRecordStructName, cppStringLiteral, cppTypeOf, cppUndefinedValue, unitFunctionName } from '../types.js';
19
24
  import { isNativeCallableCarrier, ownershipOfGeneratedCarrier, propertyKeyText as propertyKeyOperandText, stringKeyPreludeText } from '../emit-dynamic-properties.js';
20
25
  import { regexpRoleOf } from '../prototype/emit-prototype-regexp.js';
21
26
  import { ownPropertySymbolsText } from './emit-host-reflect.js';
27
+ import { hostObjectRouteKey } from '../../../ir/host-template-conversions.js';
28
+ import { structuralConversionKey } from '../../../conversion/structural-plan.js';
29
+ import { nativeCallableDataDefinitionValueText } from '../emit-native-callable-data.js';
22
30
  /**
23
31
  * `Object`'s statics -- the call-site half of the `ObjectConstructor@1`
24
32
  * boundary.
@@ -113,9 +121,9 @@ const targetOf = (ctx, member, operation) => {
113
121
  * chain is well typed whatever mix of records and dictionaries the union
114
122
  * holds.
115
123
  *
116
- * hono's `#newResponse` is the measured case: `Object.entries( headers )`
117
- * where `headers: HeaderRecord` is `Record<'Content-Type', BaseMime> |
118
- * Record<ResponseHeader, string> | Record<string, string>` -- two records and
124
+ * The case: `Object.entries( headers )` where `headers` is
125
+ * `Record<'Content-Type', Mime> | Record<HeaderName, string> |
126
+ * Record<string, string>` -- two records and
119
127
  * a dictionary, and refusing the union outright refused a program in which
120
128
  * every arm on its own is renderable.
121
129
  *
@@ -132,11 +140,11 @@ const overCarrier = (ctx, member, operation, render, renderArray) => {
132
140
  * A deferred value's text IS the expression that computes it
133
141
  * (`isDeferredValue`), and the static arms of `entries`, `values` and `keys`
134
142
  * name the receiver once per field -- in the read, the presence test, the
135
- * `[[Enumerable]]` test and the creation-order walk. mongodb's
136
- * `Object.entries(this.options)` reads a class's options through a record
137
- * conversion, and pasting that conversion 188 times made one 8 MB statement
138
- * (`CreateCollectionOperation.execute`) that no C++ compiler finishes, and
139
- * evaluated the options' sidecar reads 188 times at run time. A named value is
143
+ * `[[Enumerable]]` test and the creation-order walk.
144
+ * `Object.entries(this.options)` reading a class's options through a record
145
+ * conversion pasted that conversion once per field use -- hundreds of times
146
+ * over a wide options family, one multi-megabyte statement no C++ compiler
147
+ * finishes -- and evaluated the options' sidecar reads as often at run time. A named value is
140
148
  * already evaluated once and renders unchanged; `evaluated-once.ts` is the one
141
149
  * binding rule, shared with the conversion printer.
142
150
  */
@@ -240,12 +248,6 @@ const valuesOfView = (ctx, operation, view) => {
240
248
  }
241
249
  const element = representationKey(result.element);
242
250
  const ordered = ownKeyFields(view);
243
- for (const field of ordered) {
244
- if (!field.required) {
245
- throw createCppEmitBlockedError('host-member-call:Object.values', `"Object.values" cannot include the optional field "${field.key}": an absent field contributes no element, and ` +
246
- 'the length of the array would then depend on a presence flag this arm does not test');
247
- }
248
- }
249
251
  // A field whose carrier differs from the element (`{ on: true, none: 'none' }`
250
252
  // read as `(boolean | string)[]`) widens into it through the conversion
251
253
  // census, the same authority every other slot write uses; a pair the census
@@ -261,17 +263,30 @@ const valuesOfView = (ctx, operation, view) => {
261
263
  }
262
264
  return converted;
263
265
  });
264
- const fixed = `gea::detail::hostArrayResult(std::vector<${cppTypeOf(result.element)}>{${reads.join(', ')}})`;
265
266
  // The one own-key order `keys` and `entries` also take: a key outside the
266
267
  // layout contributes its value, where it was created.
267
- const creationOrdered = creationOrderedOwnCopyText(ctx, view, (_key, value) => {
268
- const converted = alignedValueText(ctx, 'host/emit-host-object.ts:values-in-creation-order', dynamicCarrier, result.element, value);
268
+ const creationOrdered = creationOrderedOwnCopyText(ctx, view, 'values', (_key, value, walkCtx) => {
269
+ const converted = alignedValueText(walkCtx, 'host/emit-host-object.ts:values-in-creation-order', dynamicCarrier, result.element, value);
269
270
  return converted === null ? null : `__gea_values.push_back(${converted});`;
270
271
  });
271
- if (creationOrdered === null)
272
- return fixed;
273
- return (`([&]() { std::vector<${cppTypeOf(result.element)}> __gea_values; ` +
274
- `if (${creationOrdered}) return gea::detail::hostArrayResult(std::move(__gea_values)); return ${fixed}; })()`);
272
+ if (ordered.every((field) => field.required)) {
273
+ const fixed = `gea::detail::hostArrayResult(std::vector<${cppTypeOf(result.element)}>{${reads.join(', ')}})`;
274
+ if (creationOrdered === null)
275
+ return fixed;
276
+ return (`([&]() { std::vector<${cppTypeOf(result.element)}> __gea_values; ` +
277
+ `if (${creationOrdered}) return gea::detail::hostArrayResult(std::move(__gea_values)); return ${fixed}; })()`);
278
+ }
279
+ // An optional field is an own key only while its presence bit says so, so
280
+ // the array's LENGTH is a run-time fact: the same presence-and-enumerable
281
+ // gate `entries` and `keys` apply, so the three cannot disagree.
282
+ const pushes = ordered.map((field, index) => {
283
+ const present = ownKeyPresenceText('values', view, field);
284
+ const enumerable = `${view.receiver}${view.accessor}${cppRecordFieldAttributesName(field.key)}.enumerable`;
285
+ return `if (${present === null ? enumerable : `(${present} && ${enumerable})`}) __gea_values.push_back(${reads[index]});`;
286
+ });
287
+ const walked = creationOrdered === null ? pushes.join(' ') : `if (!${creationOrdered}) { ${pushes.join(' ')} }`;
288
+ return (`([&]() { std::vector<${cppTypeOf(result.element)}> __gea_values; ${walked} ` +
289
+ `return gea::detail::hostArrayResult(std::move(__gea_values)); })()`);
275
290
  };
276
291
  /** Consume the representation already selected for the entry's [string, T] tuple. */
277
292
  const entryCarrierOf = (ctx, operation) => {
@@ -316,7 +331,7 @@ const entryCarrierOf = (ctx, operation) => {
316
331
  // The KEY has to be a string -- `OwnPropertyKeys` yields one and there is
317
332
  // nothing to convert it into. The VALUE slot is whatever the checker typed
318
333
  // it: `dynamic` for a target the program declared `any`, and a real carrier
319
- // wherever the source's own values have one -- hono's `HeaderRecord` entries
334
+ // wherever the source's own values have one -- a header record's entries
320
335
  // are `[string, string | string[]]`, a tagged union and not a box. Demanding
321
336
  // `dynamic` here refused that program for having stated MORE than the arm
322
337
  // expected; each value is reconciled into the slot by `convertedValueText`
@@ -365,8 +380,8 @@ const entriesText = (ctx, operation) => overCarrier(ctx, 'entries', operation, (
365
380
  /**
366
381
  * A known view's entries depend on nothing at the site but the receiver: a
367
382
  * push per declared field behind its presence and `[[Enumerable]]` tests,
368
- * after the creation-order walk. Over mongodb's options family that is a
369
- * 60 KB expression per call, so a unit defines it once per receiver carrier
383
+ * after the creation-order walk. Over a 100+-field options family that is a
384
+ * tens-of-KB expression per call, so a unit defines it once per receiver carrier
370
385
  * and entry carrier and every site calls it (`unitFunctionName`).
371
386
  */
372
387
  const entriesOfKnownView = (ctx, operation, view) => {
@@ -381,8 +396,8 @@ const entriesOfKnownView = (ctx, operation, view) => {
381
396
  /**
382
397
  * `Object.entries` of an Array: one entry per present index, then one per
383
398
  * enumerable sidecar key (`gea::host::ObjectConstructor::arrayEntriesOf`).
384
- * mongodb's `constructIndexDescriptionMap` reaches it through a union whose
385
- * `ReadonlyArray` arm `Array.isArray` has already excluded -- the checker
399
+ * A program reaches it through a union whose `ReadonlyArray` arm
400
+ * `Array.isArray` has already excluded -- the checker
386
401
  * keeps the arm, so the dispatch must still be able to spell it.
387
402
  */
388
403
  const arrayEntriesText = (ctx, operation, array, receiver) => {
@@ -439,8 +454,8 @@ const entriesOfView = (ctx, operation, view) => {
439
454
  const value = intoSlot(read.representation, read.text, `the field "${field.key}"`);
440
455
  return `[&]() { ${entryText(entry, cppStringLiteral(field.key), value)} }()`;
441
456
  };
442
- const creationOrdered = creationOrderedOwnCopyText(ctx, view, (key, value) => {
443
- const converted = alignedValueText(ctx, 'host/emit-host-object.ts:entries-in-creation-order', dynamicCarrier, entry.value, value);
457
+ const creationOrdered = creationOrderedOwnCopyText(ctx, view, 'entries', (key, value, walkCtx) => {
458
+ const converted = alignedValueText(walkCtx, 'host/emit-host-object.ts:entries-in-creation-order', dynamicCarrier, entry.value, value);
444
459
  return converted === null ? null : `__gea_entries.push_back([&]() { ${entryText(entry, key, converted)} }());`;
445
460
  });
446
461
  if (creationOrdered === null && ordered.every((field) => field.required)) {
@@ -461,38 +476,29 @@ const entriesOfView = (ctx, operation, view) => {
461
476
  return (`([&]() { std::vector<${cppTypeOf(entry.element)}> __gea_entries; ${walked} ` +
462
477
  `return gea::detail::hostArrayResult(std::move(__gea_entries)); })()`);
463
478
  };
464
- /**
465
- * The own enumerable properties of a shared record, walked by the runtime in
466
- * creation order, as a call answering whether it walked them.
467
- *
468
- * The static arms of `entries`, `values` and `assign` list a known view's
469
- * declared fields, and a record can have more own keys than that -- its index
470
- * sidecar's entries, or the expando keys any shared record gains through a
471
- * dynamic write -- in an order interleaved with the fields once a key outside
472
- * the layout exists (`gea::copyOwnPropertiesInCreationOrder`). An indexed
473
- * record is walked whenever it has a property protocol, since the static arm
474
- * never sees its sidecar; any other only once it has such a key, since until
475
- * then the static arm is exactly its own keys. The call answers false where
476
- * it does not walk, so the static arm still runs. `each` renders the store of
477
- * one key and its property value, or null when that value has no conversion
478
- * into the destination; there is then no runtime walk.
479
- */
480
- const creationOrderedOwnCopyText = (ctx, view, each, assigned = null) => {
479
+ const creationOrderedOwnCopyText = (ctx, view, destination, each, assigned = null) => {
481
480
  const indexed = indexedRecordViewOf(ctx.deriver, view.representation);
482
481
  const ownership = indexed !== null ? indexed.ownership : ownershipOfGeneratedCarrier(view.representation);
483
482
  if (ownership !== 'shared-refcount')
484
483
  return null;
485
- let body;
486
- try {
487
- body = each('__gea_ordered_key', '__gea_ordered_value');
488
- }
489
- catch (error) {
490
- if (isCppEmitBlockedError(error))
491
- return null;
492
- throw error;
493
- }
494
- if (body === null)
484
+ const leaves = ctx.hostObjectWalkPlan?.routes.get(hostObjectRouteKey(view.representation, destination));
485
+ if (leaves === undefined)
495
486
  return null;
487
+ const walkCtx = {
488
+ ...ctx,
489
+ conversions: {
490
+ ...ctx.conversions,
491
+ nodeFor: (source, target) => {
492
+ const node = leaves.get(structuralConversionKey(source, target));
493
+ if (node === undefined)
494
+ throw createCppEmitBlockedError('runtime-helper:host-object-walk-recipes', 'an Object walk requested a conversion outside its sealed callback');
495
+ return node;
496
+ }
497
+ }
498
+ };
499
+ const body = each('__gea_ordered_key', '__gea_ordered_value', walkCtx);
500
+ if (body === null)
501
+ throw createCppEmitBlockedError('runtime-helper:host-object-walk-recipes', 'an admitted Object walk callback has no rendering');
496
502
  // A copy into a known target with its static copy in hand: the runtime runs
497
503
  // that copy itself when the source's keys only left layout order
498
504
  // (`gea::assignOwnPropertiesInCreationOrderWith`).
@@ -580,16 +586,8 @@ const declaredFixedFieldOf = (ctx, representation, key) => {
580
586
  : null;
581
587
  return fields?.find((field) => field.key === key) ?? null;
582
588
  };
583
- /**
584
- * Do not send a named native slot through nativeDynamicDefineProperty first:
585
- * a deleted configurable fixed field no longer reads as present, but it is
586
- * still a declared slot and must be redefined there rather than shadowed in
587
- * the expando. The generated match hooks retain that distinction.
588
- */
589
- const generatedDefineOwnText = (receiver, key, descriptor) => `([&]() -> bool { const gea::PropertyKey __gea_key = ${key}; ` +
590
- `if (${receiver}->gea_matchesOwnField(__gea_key)) return ${receiver}->gea_defineOwnField(__gea_key, ${descriptor}, gea::nativeIsExtensible(${receiver})); ` +
591
- `if (${receiver}->gea_matchesOwnIndex(__gea_key)) return ${receiver}->gea_defineOwnIndex(__gea_key, ${descriptor}, gea::nativeIsExtensible(${receiver})); ` +
592
- `return gea::nativeDynamicDefineProperty(${receiver}, __gea_key, ${descriptor}); })()`;
589
+ /** The native substrate dispatches fixed fields, available index hooks and expandos against one property identity. */
590
+ const generatedDefineOwnText = (receiver, key, descriptor) => `gea::record::defineLiveField(${receiver}, ${key}, ${descriptor})`;
593
591
  /**
594
592
  * `Object.freeze` / `Object.isFrozen` -- the two members of this family that
595
593
  * are NOT a loop over the three primitives.
@@ -601,6 +599,36 @@ const generatedDefineOwnText = (receiver, key, descriptor) => `([&]() -> bool {
601
599
  */
602
600
  const integrityText = (ctx, member, operation, call) => {
603
601
  const target = targetOf(ctx, member, operation);
602
+ if (isNativeCallableCarrier(target.representation.kind) && target.representation.kind !== 'function-and-constructor') {
603
+ if (operation.nativeCallableIntegrity === undefined)
604
+ return refuseObjectCarrier(member, target.representation, 'the source Function own-prototype descriptors are not authenticated');
605
+ // Own facts and native payload holders share this exact Function table.
606
+ // Integrity changes descriptor attributes without observing those payloads
607
+ // or requesting the Function's dynamic materializer.
608
+ const prepare = `const auto __gea_callable = ${operandText(ctx, target)}; ` +
609
+ 'const auto& __gea_identity = __gea_callable.functionObjectIdentity(); ' +
610
+ `if (!__gea_identity) return ${call === 'isExtensible' ? 'false' : call === 'isFrozen' || call === 'isSealed' ? 'true' : '__gea_callable'}; ` +
611
+ 'gea::installCallableOwnFacts(__gea_identity, __gea_callable.name(), __gea_callable.length()); ' +
612
+ (operation.nativeCallableIntegrity.prototype ? 'gea::installCallableNativePrototype(__gea_callable); ' : '') +
613
+ 'const auto& __gea_properties = __gea_identity->properties; ';
614
+ if (call === 'freeze')
615
+ return `([&]() { ${prepare}__gea_properties->freezeIntegrity(); return __gea_callable; })()`;
616
+ if (call === 'isFrozen')
617
+ return `([&]() -> bool { ${prepare}return __gea_properties->hasFrozenIntegrity(); })()`;
618
+ if (call === 'isExtensible')
619
+ return `([&]() -> bool { ${prepare}return __gea_properties->extensible(); })()`;
620
+ if (call === 'preventExtensions')
621
+ return `([&]() { ${prepare}__gea_properties->preventExtensions(); return __gea_callable; })()`;
622
+ if (call === 'seal')
623
+ return (`([&]() { ${prepare}for (const auto& __gea_key : __gea_properties->ownKeys()) { ` +
624
+ 'gea::PropertyDescriptor __gea_update; __gea_update.hasConfigurable = true; __gea_update.configurable = false; ' +
625
+ 'if (!__gea_properties->defineOwnProperty(__gea_key, __gea_update)) gea::host::throwRuntimeError("TypeError", "Cannot seal Function own property"); } ' +
626
+ '__gea_properties->preventExtensions(); return __gea_callable; })()');
627
+ return (`([&]() -> bool { ${prepare}if (__gea_properties->extensible()) return false; ` +
628
+ 'for (const auto& __gea_key : __gea_properties->ownKeys()) { ' +
629
+ 'const gea::PropertyDescriptor* __gea_descriptor = __gea_properties->ownProperty(__gea_key); ' +
630
+ 'if (__gea_descriptor != nullptr && __gea_descriptor->configurable) return false; } return true; })()');
631
+ }
604
632
  if (target.representation.kind === 'array-object' && target.representation.ownership === 'shared-refcount') {
605
633
  if (call === 'seal' || call === 'isSealed' || call === 'preventExtensions') {
606
634
  return refuseObjectCarrier(member, target.representation, 'this array path has no native seal/preventExtensions implementation');
@@ -647,13 +675,16 @@ const integrityText = (ctx, member, operation, call) => {
647
675
  view.representation.kind === 'class-ref' ||
648
676
  (view.representation.kind === 'native-record-ref' && view.representation.native === null);
649
677
  const receiver = view.receiver;
678
+ const indexed = view.representation.kind === 'class-ref'
679
+ ? ctx.classIndexProtocols.get(view.representation.declaration) !== false
680
+ : recordIndexesOfShape(ctx.deriver, view.representation.shapeId).length > 0;
650
681
  const expando = `gea::detail::expandoFor(gea::refCastToVoid(${receiver}), true)`;
651
682
  if (call === 'freeze') {
652
- const fields = generated ? `${receiver}->gea_freezeOwnFields(); ${receiver}->gea_freezeOwnIndex(); ` : '';
683
+ const fields = generated ? `${receiver}->gea_freezeOwnFields(); ${indexed ? `${receiver}->gea_freezeOwnIndex(); ` : ''}` : '';
653
684
  return `([&]() { ${fields}gea::nativeFreeze(${receiver}); return ${receiver}; })()`;
654
685
  }
655
686
  if (call === 'isFrozen') {
656
- const fields = generated ? `${receiver}->gea_ownFieldsFrozen() && ${receiver}->gea_ownIndexFrozen() && ` : '';
687
+ const fields = generated ? `${receiver}->gea_ownFieldsFrozen() && ${indexed ? `${receiver}->gea_ownIndexFrozen() && ` : ''}` : '';
657
688
  return `${fields}gea::nativeIsFrozen(${receiver})`;
658
689
  }
659
690
  if (call === 'isExtensible')
@@ -661,18 +692,20 @@ const integrityText = (ctx, member, operation, call) => {
661
692
  if (call === 'preventExtensions')
662
693
  return `([&]() { ${expando}->preventExtensions(); return ${receiver}; })()`;
663
694
  if (call === 'seal') {
664
- const fields = generated ? `${receiver}->gea_sealOwnFields(); ${receiver}->gea_sealOwnIndex(); ` : '';
695
+ const fields = generated ? `${receiver}->gea_sealOwnFields(); ${indexed ? `${receiver}->gea_sealOwnIndex(); ` : ''}` : '';
665
696
  return (`([&]() { ${fields}const auto __gea_sidecar = ${expando}; ` +
666
697
  'for (const auto& __gea_key : __gea_sidecar->ownKeys()) { gea::PropertyDescriptor __gea_update; __gea_update.hasConfigurable = true; __gea_update.configurable = false; ' +
667
698
  'if (!__gea_sidecar->defineOwnProperty(__gea_key, __gea_update)) gea::host::throwRuntimeError("TypeError", "Cannot seal native own property"); } ' +
668
699
  `__gea_sidecar->preventExtensions(); return ${receiver}; })()`);
669
700
  }
670
- const fields = generated ? `if (!${receiver}->gea_ownFieldsSealed() || !${receiver}->gea_ownIndexSealed()) return false; ` : '';
701
+ const fields = generated
702
+ ? `if (!${receiver}->gea_ownFieldsSealed()${indexed ? ` || !${receiver}->gea_ownIndexSealed()` : ''}) return false; `
703
+ : '';
671
704
  return (`([&]() -> bool { ${fields}const auto __gea_sidecar = gea::detail::expandoFor(gea::refCastToVoid(${receiver}), false); ` +
672
705
  'if (!__gea_sidecar || __gea_sidecar->extensible()) return false; for (const auto& __gea_key : __gea_sidecar->ownKeys()) { ' +
673
706
  'const gea::PropertyDescriptor* __gea_descriptor = __gea_sidecar->ownProperty(__gea_key); if (__gea_descriptor != nullptr && __gea_descriptor->configurable) return false; } return true; })()');
674
707
  }
675
- // A shared Document (the `{ ...command }` a driver freezes before handing it
708
+ // A shared Document (a `{ ...doc }` copy a program freezes before handing it
676
709
  // on) has identity; its frozen state lives in the object the table migrates
677
710
  // into, see `gea::dictionary::freeze`. seal/preventExtensions are not wired.
678
711
  if (view.kind === 'dictionary' &&
@@ -786,6 +819,10 @@ const hasOwnText = (ctx, operation) => {
786
819
  if (regexpRoleOf(target.representation) === 'pattern') {
787
820
  return `gea::nativeDynamicHas(${operandText(ctx, target)}, ${propertyKeyText(ctx, 'hasOwn', key)})`;
788
821
  }
822
+ if (target.representation.kind === 'native-handle')
823
+ return nativeHandleShapeCallText(ctx, 'hasOwnProperty', target.representation.native ?? target.representation.protocol, [key]);
824
+ if (isNativeCallableCarrier(target.representation.kind))
825
+ return callableShapeCallText(ctx, 'hasOwnProperty', operandText(ctx, target), [key]);
789
826
  if (target.representation.kind === 'array-object')
790
827
  return arrayHasOwnText(ctx, target.representation, operandText(ctx, target), key);
791
828
  const view = objectViewOf(ctx, 'hasOwn', target, 'object');
@@ -916,7 +953,7 @@ const mathPackedRestHostMethodValueText = (spelling) => {
916
953
  * accessor" for `get`/`set`, and "no id yet" for whichever `writable` /
917
954
  * `enumerable` / `configurable` field is not among the three passed).
918
955
  */
919
- const descriptorAggregateBuilder = (ctx, resultRepresentation, contextLabel) => {
956
+ const descriptorAggregateBuilder = (ctx, resultRepresentation, contextLabel, operation) => {
920
957
  const optional = resultRepresentation.kind === 'optional' ? resultRepresentation : null;
921
958
  const recordRepresentation = optional ? optional.payload : resultRepresentation;
922
959
  const structNameAndFields = (() => {
@@ -1018,6 +1055,10 @@ const descriptorAggregateBuilder = (ctx, resultRepresentation, contextLabel) =>
1018
1055
  };
1019
1056
  const convertValueField = (source, text) => {
1020
1057
  if (valueFieldRepresentation === null) {
1058
+ // A source-authenticated accessor descriptor states get/set rather
1059
+ // than a data value. aggregateOf ignores keys its native shape lacks.
1060
+ if (operation?.nativeAccessorObservation)
1061
+ return cppUndefinedValue;
1021
1062
  throw createCppEmitBlockedError('host-member-call:Object.getOwnPropertyDescriptor', `${contextLabel} descriptor names no "value" field to store into`);
1022
1063
  }
1023
1064
  if (representationKey(source) === representationKey(valueFieldRepresentation))
@@ -1049,13 +1090,25 @@ const descriptorAggregateBuilder = (ctx, resultRepresentation, contextLabel) =>
1049
1090
  if (field === undefined)
1050
1091
  continue;
1051
1092
  const carried = field.value.kind === 'optional' ? field.value.payload : field.value;
1093
+ const observed = operation?.nativeAccessorObservation?.halves.find((candidate) => candidate.half === half.key);
1094
+ if (observed !== undefined) {
1095
+ if (representationKey(carried) !== representationKey(observed.target))
1096
+ throw createCppEmitBlockedError(`conversion:${observed.conversion}`, 'a reflected accessor field changed its published Function carrier');
1097
+ const built = nativeAccessorObservedFunctionText(ctx, observed, object);
1098
+ const fieldType = cppTypeOf(field.value);
1099
+ const presentFunction = `(${object}.${half.has} && static_cast<bool>(${object}.${half.key === 'get' ? 'nativeGet' : 'nativeSet'}))`;
1100
+ overrides[half.key] = field.value.kind === 'optional' ? `(${presentFunction} ? ${fieldType}(${built}) : ${fieldType}())` : built;
1101
+ present[half.key] = `${object}.${half.has}`;
1102
+ continue;
1103
+ }
1052
1104
  if (cppTypeOf(carried) !== half.type)
1053
1105
  continue;
1054
1106
  const built = `gea::${half.helper}(${object})`;
1055
1107
  const fieldType = cppTypeOf(field.value);
1056
1108
  // A complete accessor property states both halves, and a missing one is
1057
1109
  // present as `undefined` (10.1.6.3): the key is there, the callable is not.
1058
- const callable = `(${object}.${half.has} && static_cast<bool>(${object}.${half.key}))`;
1110
+ const native = half.key === 'get' ? 'nativeGet' : 'nativeSet';
1111
+ const callable = `(${object}.${half.has} && (static_cast<bool>(${object}.${half.key}) || static_cast<bool>(${object}.${native})))`;
1059
1112
  overrides[half.key] = field.value.kind === 'optional' ? `(${callable} ? ${fieldType}(${built}) : ${fieldType}())` : built;
1060
1113
  present[half.key] = `${object}.${half.has}`;
1061
1114
  }
@@ -1185,6 +1238,9 @@ const nativeHandleDescriptorText = (ctx, protocol, key, operation) => {
1185
1238
  * string key all observe the same own-property set as their literal forms.
1186
1239
  */
1187
1240
  const arrayObjectDescriptorText = (ctx, receiver, representation, key, operation) => {
1241
+ const snapshot = nativeArrayDescriptorSnapshotText(ctx, operation, receiver);
1242
+ if (snapshot !== null)
1243
+ return snapshot;
1188
1244
  const resultRepresentation = operation.result?.representation ?? null;
1189
1245
  if (resultRepresentation === null) {
1190
1246
  throw createCppEmitBlockedError('host-member-call:Object.getOwnPropertyDescriptor', '"Object.getOwnPropertyDescriptor" of an array published no result to build a descriptor into');
@@ -1234,9 +1290,12 @@ const arrayObjectDescriptorText = (ctx, receiver, representation, key, operation
1234
1290
  // raw-strings array; a descriptor whose "value" field cannot hold
1235
1291
  // `undefined` at all (a `number[]` literal's own minted record) is one
1236
1292
  // no such array reaches, and the branch is not spelled for it.
1237
- const undefinedValue = valueFieldRepresentation === null
1238
- ? null
1239
- : alignedValueText(ctx, 'host/emit-host-object.ts:1145', { kind: 'undefined' }, valueFieldRepresentation, cppUndefinedValue);
1293
+ const undefinedNode = valueFieldRepresentation === null
1294
+ ? undefined
1295
+ : ctx.hostObjectWalkPlan?.routes
1296
+ .get(hostObjectRouteKey(representation, 'array-undefined'))
1297
+ ?.get(structuralConversionKey({ kind: 'undefined' }, valueFieldRepresentation));
1298
+ const undefinedValue = undefinedNode === undefined ? null : recipeText(ctx, undefinedNode, cppUndefinedValue);
1240
1299
  if (undefinedValue === null)
1241
1300
  return descriptorWith(value);
1242
1301
  return `(${receiver}${accessor}elementIsUndefined(static_cast<std::size_t>(${index})) ? ${descriptorWith(undefinedValue)} : ${descriptorWith(value)})`;
@@ -1288,7 +1347,7 @@ const knownDescriptorText = (ctx, member, view, key, operation) => {
1288
1347
  if (resultRepresentation === null) {
1289
1348
  throw createCppEmitBlockedError(`host-member-call:Object.${member}`, `"Object.${member}" published no result to build a descriptor into`);
1290
1349
  }
1291
- const { resultType, someText, absentText, aggregateOf, convertValueField, attributeText, accessorHalvesOf } = descriptorAggregateBuilder(ctx, resultRepresentation, `"Object.${member}" of a known receiver`);
1350
+ const { resultType, someText, absentText, aggregateOf, convertValueField, attributeText, accessorHalvesOf } = descriptorAggregateBuilder(ctx, resultRepresentation, `"Object.${member}" of a known receiver`, operation);
1292
1351
  const aggregateFor = (valueSource, valueText, attributes) => aggregateOf({
1293
1352
  value: convertValueField(valueSource, valueText),
1294
1353
  writable: attributeText('writable', 'true', `${attributes}.writable`),
@@ -1398,7 +1457,7 @@ const dynamicDescriptorConversionText = (ctx, member, receiver, key, operation)
1398
1457
  if (resultRepresentation === null) {
1399
1458
  throw createCppEmitBlockedError(`host-member-call:Object.${member}`, `"Object.${member}" of a dynamic receiver published no result to build a descriptor into`);
1400
1459
  }
1401
- const { resultType, someText, absentText, aggregateOf, attributeText, convertValueField, accessorHalvesOf } = descriptorAggregateBuilder(ctx, resultRepresentation, `"Object.${member}" of a dynamic receiver`);
1460
+ const { resultType, someText, absentText, aggregateOf, attributeText, convertValueField, accessorHalvesOf } = descriptorAggregateBuilder(ctx, resultRepresentation, `"Object.${member}" of a dynamic receiver`, operation);
1402
1461
  const nativeCall = `gea::host::ObjectConstructor::${member}(${receiver}, ${propertyKeyText(ctx, member, key)})`;
1403
1462
  const halves = accessorHalvesOf('static_cast<const gea::PropertyDescriptor&>(*__gea_native)');
1404
1463
  const aggregate = aggregateOf({
@@ -1482,7 +1541,7 @@ const callableDescriptorText = (ctx, representation, receiver, key, operation) =
1482
1541
  const { resultType, someText, absentText, aggregateOf, convertValueField, attributeText } = descriptorAggregateBuilder(ctx, resultRepresentation, '"Object.getOwnPropertyDescriptor" of a function');
1483
1542
  const dynamic = { kind: 'dynamic', reason: 'declared-any-never-narrowed' };
1484
1543
  const aggregate = aggregateOf({
1485
- value: convertValueField(dynamic, '__gea_descriptor->value'),
1544
+ value: convertValueField(dynamic, '__gea_descriptor->dataValue()'),
1486
1545
  writable: attributeText('writable', '__gea_descriptor->hasWritable', '__gea_descriptor->writable'),
1487
1546
  enumerable: attributeText('enumerable', '__gea_descriptor->hasEnumerable', '__gea_descriptor->enumerable'),
1488
1547
  configurable: attributeText('configurable', '__gea_descriptor->hasConfigurable', '__gea_descriptor->configurable')
@@ -1502,8 +1561,8 @@ const callableDescriptorText = (ctx, representation, receiver, key, operation) =
1502
1561
  'const gea::PropertyDescriptor* __gea_descriptor = __gea_identity->properties->ownProperty(__gea_key); ' +
1503
1562
  `if (__gea_descriptor == nullptr) return ${absentText()}; return ${someText(aggregate)}; })()`);
1504
1563
  }
1505
- const constructorSetup = representation.kind === 'function-and-constructor'
1506
- ? 'if (!__gea_key.isSymbol() && __gea_key.text() == "prototype") gea::installCallableConstructorPrototype(__gea_callable); '
1564
+ const constructorSetup = operation.nativeCallablePrototypeDescriptor
1565
+ ? `${nativeCallablePrototypeObservationText(ctx, operation.nativeCallablePrototypeDescriptor, '__gea_callable')}; `
1507
1566
  : '';
1508
1567
  return (`([&]() -> ${resultType} { const auto& __gea_callable = ${receiver}; ` +
1509
1568
  // A heap-environment callable anchors its identity lazily in its
@@ -1608,14 +1667,14 @@ const createText = (operation) => {
1608
1667
  // `DynamicObject`, so the store's `unboxValue<Ref<Dictionary<V>>>` finds a
1609
1668
  // payload of a different C++ type and refuses at runtime -- a program that
1610
1669
  // aborts on its first statement, which is what `const emptyParams: Params =
1611
- // Object.create(null)` did (hono's pattern router).
1670
+ // Object.create(null)` did.
1612
1671
  if (result !== null && (result.kind === 'dictionary' || result.kind === 'record' || result.kind === 'record-with-index')) {
1613
1672
  const storage = cppTypeOf(result, 'owned');
1614
1673
  return result.ownership === 'shared-refcount' ? `gea::makeRef<${storage}>()` : `${storage}{}`;
1615
1674
  }
1616
- // A NAMED shape is the same empty struct: mongodb's `parseOptions` fills
1617
- // `const mongoOptions = Object.create(null)` and returns it as the
1618
- // `MongoOptions` interface, so the census gives the call that interface's
1675
+ // A NAMED shape is the same empty struct: a function fills
1676
+ // `const options = Object.create(null)` and returns it as a named
1677
+ // interface, so the census gives the call that interface's
1619
1678
  // carrier. Spelled the way `emitAllocateRecord` spells the same carrier --
1620
1679
  // the host's own struct when one is stated -- since `gea::Value::object()`
1621
1680
  // is not a value of it at all.
@@ -1667,10 +1726,10 @@ const assignedKeyFields = (ctx, view) => ownKeyFields(view).filter((field) => !n
1667
1726
  * Between two known shapes the copy's text depends on nothing but the two
1668
1727
  * carriers and the two receivers: a static store per source field, then the
1669
1728
  * creation-order walk, whose callback routes every run-time key through the
1670
- * target's own field list. Into mongodb's 131-field options family that walk
1671
- * alone is a 131-branch chain, and `Object.assign({}, a, b)` over the same
1672
- * pair recurs at dozens of sites -- 3.6 MB of the ping driver's unit in chains
1673
- * that differed only in which local named the target. Rendered over the
1729
+ * target's own field list. Into a 100+-field options family that walk alone
1730
+ * is a 100+-branch chain, and `Object.assign({}, a, b)` over the same pair
1731
+ * recurs at dozens of sites -- megabytes of a unit in chains that differed
1732
+ * only in which local named the target. Rendered over the
1674
1733
  * function's own formals, the pair is defined once and every site calls it
1675
1734
  * (`unitFunctionName`). The target is shared, so the stores the function
1676
1735
  * makes through its formal are stores into the site's object.
@@ -1743,8 +1802,8 @@ const assignSourceTextAt = (ctx, targetView, sourceView) => {
1743
1802
  const presence = ownKeyPresenceText('assign', sourceView, field);
1744
1803
  return presence === null ? store : `if (${presence}) ${store}`;
1745
1804
  });
1746
- const creationOrdered = creationOrderedOwnCopyText(ctx, sourceView, (key, value) => {
1747
- const converted = alignedValueText(ctx, 'host/emit-host-object.ts:assign-in-creation-order', dynamicCarrier, targetView.value, value);
1805
+ const creationOrdered = creationOrderedOwnCopyText(ctx, sourceView, `assign:${representationKey(targetView.representation)}`, (key, value, walkCtx) => {
1806
+ const converted = alignedValueText(walkCtx, 'host/emit-host-object.ts:assign-in-creation-order', dynamicCarrier, targetView.value, value);
1748
1807
  return converted === null
1749
1808
  ? null
1750
1809
  : `if (!${targetView.receiver}.setProperty(${key}, ${converted})) gea::host::throwRuntimeError("TypeError", "Cannot assign to read only property");`;
@@ -1758,8 +1817,8 @@ const assignSourceTextAt = (ctx, targetView, sourceView) => {
1758
1817
  return `gea::host::ObjectConstructor::assignInto(${targetView.receiver}, ${sourceView.receiver});`;
1759
1818
  }
1760
1819
  // A dynamic source into a string-keyed dictionary whose values are typed
1761
- // (three's `Object.assign( this.spaces, colorSpaces )` with an untyped
1762
- // `colorSpaces`). The source's keys exist only at runtime, so each
1820
+ // (`Object.assign( this.table, source )` with an untyped `source`). The
1821
+ // source's keys exist only at runtime, so each
1763
1822
  // enumerable own string key is read as a `gea::Value` and stored through the
1764
1823
  // same checked per-value conversion a typed dictionary store uses -- an
1765
1824
  // entry the target's value type cannot hold is refused at run time by that
@@ -1834,9 +1893,8 @@ const assignSourceTextAt = (ctx, targetView, sourceView) => {
1834
1893
  }
1835
1894
  if (targetView.kind === 'dynamic' && sourceView.kind === 'known') {
1836
1895
  // The source's keys are known here and the target is an object the
1837
- // program declared `any` and never narrowed -- mongodb's
1838
- // `Object.assign(command.readConcern, { afterClusterTime })` over a
1839
- // `Document`. 7.3.25 is then one `[[Set]]` per present source field on
1896
+ // program declared `any` and never narrowed --
1897
+ // `Object.assign(doc.nested, { field })` over a `Document`. 7.3.25 is then one `[[Set]]` per present source field on
1840
1898
  // the dynamic object; each value is boxed because the dynamic object is
1841
1899
  // where it lands, not because the source is. The target is bound once:
1842
1900
  // an operand may be a deferred expression.
@@ -1852,7 +1910,7 @@ const assignSourceTextAt = (ctx, targetView, sourceView) => {
1852
1910
  const presence = ownKeyPresenceText('assign', sourceView, field);
1853
1911
  stores.push(presence === null ? store : `if (${presence}) ${store}`);
1854
1912
  }
1855
- const creationOrdered = creationOrderedOwnCopyText(ctx, sourceView, (key, value) => `__gea_target.setProperty(gea::PropertyKey::string(${key}), ${value});`);
1913
+ const creationOrdered = creationOrderedOwnCopyText(ctx, sourceView, 'assign:dynamic', (key, value) => `__gea_target.setProperty(gea::PropertyKey::string(${key}), ${value});`);
1856
1914
  const walked = creationOrdered === null ? stores.join(' ') : `if (!${creationOrdered}) { ${stores.join(' ')} }`;
1857
1915
  return `{ gea::Value __gea_target = ${targetView.receiver}; ${walked} }`;
1858
1916
  }
@@ -1880,14 +1938,14 @@ const assignSourceTextAt = (ctx, targetView, sourceView) => {
1880
1938
  const handsOver = targetShared && indexedRecordViewOf(ctx.deriver, sourceView.representation) === null;
1881
1939
  const creationOrdered = !targetShared
1882
1940
  ? null
1883
- : creationOrderedOwnCopyText(ctx, sourceView, (key, value) => {
1941
+ : creationOrderedOwnCopyText(ctx, sourceView, `assign:${representationKey(targetView.representation)}`, (key, value, walkCtx) => {
1884
1942
  // The routing depends on the target alone, whichever source is being
1885
1943
  // walked, so it is one unit function per target carrier.
1886
1944
  const at = (target, name, property) => {
1887
1945
  const view = { ...targetView, receiver: target };
1888
1946
  const declared = view.fields.filter((field) => !field.key.startsWith('sym('));
1889
1947
  const branches = declared.map((field) => `if (${name} == ${cppStringLiteral(field.key)}) { ` +
1890
- `${setOwnText(ctx, 'assign', view, field.key, { text: property, representation: dynamicCarrier })} }`);
1948
+ `${setOwnText(walkCtx, 'assign', view, field.key, { text: property, representation: dynamicCarrier })} }`);
1891
1949
  const created = `{ if (!gea::nativeDynamicSet(${target}, gea::PropertyKey::string(${name}), ${property})) ` +
1892
1950
  'gea::host::throwRuntimeError("TypeError", "Cannot assign to read only property"); }';
1893
1951
  return [...branches, created].join(' else ');
@@ -1911,10 +1969,10 @@ const assignSourceTextAt = (ctx, targetView, sourceView) => {
1911
1969
  * lambda over the two receivers, beside the source field's presence member.
1912
1970
  * The loop tests presence from the table and calls only the present fields'
1913
1971
  * stores, so the code the copy executes is proportional to the fields the
1914
- * source has rather than to the fields the layout declares: mongodb's
1915
- * `Object.assign({}, options, resolveBSONOptions(...))` copied one 134-field
1916
- * family struct into another as 26 KB of straight-line code per call, 2% of
1917
- * the driver's CPU spent in the front end on tests that nearly all failed.
1972
+ * source has rather than to the fields the layout declares:
1973
+ * `Object.assign({}, options, resolveOptions(...))` copied one 100+-field
1974
+ * family struct into another as tens of KB of straight-line code per call,
1975
+ * with measurable CPU spent in the front end on tests that nearly all failed.
1918
1976
  * Below `steppedAssignFields` the unrolled stores are shorter than the table
1919
1977
  * and its indirect calls, so a small record keeps them.
1920
1978
  */
@@ -1951,8 +2009,8 @@ const steppedAssignText = (ctx, targetView, sourceView) => {
1951
2009
  /**
1952
2010
  * A native `Error` source copied into a struct target.
1953
2011
  *
1954
- * mongodb's `MongoBulkWriteError` constructor ends in `Object.assign(this,
1955
- * error)` over `AnyError`, one of whose arms is a plain `Error`. An Error's
2012
+ * An error subclass's constructor ending in `Object.assign(this, error)` over
2013
+ * a union one of whose arms is a plain `Error`. An Error's
1956
2014
  * own `name`/`message`/`stack` are non-enumerable (20.5.6.3), so its
1957
2015
  * enumerable own keys are exactly what the program added to its expando
1958
2016
  * sidecar -- a set that exists only at runtime, which `gea::nativeDynamicKeys`
@@ -2048,6 +2106,9 @@ const assignIntoCallableText = (ctx, operation, target) => {
2048
2106
  return `([&]() { ${body} return ${targetText}; })()`;
2049
2107
  };
2050
2108
  const assignText = (ctx, operation) => {
2109
+ const native = nativeOwnAssignmentText(ctx, operation);
2110
+ if (native !== null)
2111
+ return native;
2051
2112
  const target = targetOf(ctx, 'assign', operation);
2052
2113
  const targetText = operandText(ctx, target);
2053
2114
  const sources = operation.arguments.slice(1);
@@ -2089,14 +2150,20 @@ const assignText = (ctx, operation) => {
2089
2150
  * struct copy that set every field would rewrite attributes the program
2090
2151
  * never mentioned.
2091
2152
  *
2092
- * The ACCESSOR form (`get`/`set` in the literal) is refused by name. The
2093
- * object model stores accessors as native `std::function`s and invokes them
2094
- * (`gea::runtime::object::get`), so the model is not the gap -- what is
2095
- * missing is the conversion from the program's own callable carrier into that
2096
- * signature, and inventing one that dropped the receiver would make
2097
- * `get: () => this.x` read the wrong object.
2153
+ * Accessor Functions stay in native holders. Each certified half names its
2154
+ * actual zero/one-argument invocation frame, forwarding this at access time.
2098
2155
  */
2099
- const defineDescriptorLines = (ctx, operation, descriptor, slot) => descriptorSlotLines(ctx, operation, descriptor.representation, operandText(ctx, descriptor), slot);
2156
+ const defineDescriptorLines = (ctx, operation, descriptor, slot) => {
2157
+ const snapshot = nativeDescriptorSnapshotDefinitionLines(ctx, operation, slot);
2158
+ if (snapshot !== null)
2159
+ return snapshot;
2160
+ const restored = operation.nativeAccessorReinstallation;
2161
+ if (restored !== undefined) {
2162
+ const lookup = `gea::nativeOwnPropertyDescriptor(${operandText(ctx, restored.snapshotReceiver)}, ${propertyKeyText(ctx, 'defineProperty', restored.snapshotKey)})`;
2163
+ return `const auto ${slot}_snapshot = ${lookup}; if (!${slot}_snapshot.has_value()) gea::host::throwRuntimeError("TypeError", "An accessor descriptor snapshot lost its original property"); const gea::PropertyDescriptor& ${slot} = *${slot}_snapshot;`;
2164
+ }
2165
+ return descriptorSlotLines(ctx, operation, descriptor.representation, operandText(ctx, descriptor), slot);
2166
+ };
2100
2167
  /**
2101
2168
  * The descriptor operand of `Object.defineProperty`, in every carrier a
2102
2169
  * program hands one over as: the host's own `gea::PropertyDescriptor`; an
@@ -2105,7 +2172,7 @@ const defineDescriptorLines = (ctx, operation, descriptor, slot) => descriptorSl
2105
2172
  * OPTIONAL fields carry a presence bit -- a descriptor read back off an
2106
2173
  * accessor states no `value`, and `hasValue` must say so rather than copy a
2107
2174
  * default-constructed one); and an `optional` of that record, which is how
2108
- * test262's `verifyProperty` holds the descriptor it restores with. The
2175
+ * a property-descriptor check holds the descriptor it restores with. The
2109
2176
  * absent optional is ECMA-262 20.1.2.4 step 3's TypeError
2110
2177
  * (`ToPropertyDescriptor` of `undefined`), thrown where the language throws it.
2111
2178
  */
@@ -2133,6 +2200,47 @@ const descriptorSlotLines = (ctx, operation, representation, text, slot) => {
2133
2200
  };
2134
2201
  for (const field of fields) {
2135
2202
  const read = `${text}${accessor}${cppRecordFieldName(field.key)}`;
2203
+ if (field.key === 'get' || field.key === 'set') {
2204
+ const half = operation.nativeAccessorDefinition?.halves.find((candidate) => candidate.half === field.key);
2205
+ if (half !== undefined) {
2206
+ if (representationKey(field.value) !== representationKey(half.source))
2207
+ throw createCppEmitBlockedError(`conversion:${half.conversion}`, 'a native accessor field disagrees with its actual Function carrier');
2208
+ push(field, `gea::${field.key === 'get' ? 'installNativeDescriptorGetter' : 'installNativeDescriptorSetter'}(${slot}, ${nativeAccessorDefinitionText(ctx, half, read)});`);
2209
+ continue;
2210
+ }
2211
+ }
2212
+ if (field.key === 'value' && operation.nativeCallableDataWrite?.definition) {
2213
+ const receipt = operation.nativeCallableDataWrite;
2214
+ if (representationKey(field.value) !== representationKey(receipt.storage))
2215
+ throw createCppEmitBlockedError(`conversion:${receipt.storageConversion}`, 'a native Function definition disagrees with its descriptor value carrier');
2216
+ push(field, `${slot}.hasValue = true; ${slot}.nativeValue = ${nativeCallableDataDefinitionValueText(ctx, receipt, read)};`);
2217
+ continue;
2218
+ }
2219
+ if (field.key === 'value' && operation.nativeDataDefinition) {
2220
+ const recipe = operation.nativeDataDefinition;
2221
+ const node = ctx.conversions.nodeById(recipe.conversion);
2222
+ const converted = node === null ||
2223
+ representationKey(field.value) !== representationKey(recipe.source) ||
2224
+ representationKey(node.source) !== representationKey(recipe.source) ||
2225
+ representationKey(node.target) !== representationKey(recipe.held)
2226
+ ? null
2227
+ : recipeText(ctx, node, read);
2228
+ if (converted === null)
2229
+ throw createCppEmitBlockedError(`conversion:${recipe.conversion}`, 'a native descriptor value lacks its certified destination-field conversion');
2230
+ // A dynamic observer (a `dynamic` arm, a view's original Document) reads
2231
+ // the native payload through its certified Value boundary, run lazily.
2232
+ const materializer = recipe.materialization === undefined ? null : ctx.conversions.nodeById(recipe.materialization);
2233
+ const materialized = materializer === null
2234
+ ? null
2235
+ : namedConversionText(ctx, 'emit-host-object.ts:data-definition-materializer', materializer, 'gea_data');
2236
+ if (recipe.materialization !== undefined && materialized === null)
2237
+ throw createCppEmitBlockedError(`conversion:${recipe.materialization}`, 'a native descriptor value lacks its certified dynamic observation boundary');
2238
+ const held = cppTypeOf(recipe.held);
2239
+ push(field, `${slot}.hasValue = true; ${slot}.nativeValue = gea::NativeDescriptorData::make<${held}, ${nativeFieldPolicyType(recipe.held)}>(${held}{${converted}}` +
2240
+ (materialized === null ? ')' : `, +[](const ${held}& gea_data) -> gea::Value { return ${materialized}; })`) +
2241
+ ';');
2242
+ continue;
2243
+ }
2136
2244
  // A field the descriptor record carries as `optional(T, undefined)` -- the
2137
2245
  // shape `Object.getOwnPropertyDescriptor` publishes for its `value?: any`
2138
2246
  // and `writable?: boolean` members -- states the attribute exactly when
@@ -2148,7 +2256,7 @@ const descriptorSlotLines = (ctx, operation, representation, text, slot) => {
2148
2256
  if ((field.key === 'get' || field.key === 'set') && (!field.required || field.value.kind === 'optional')) {
2149
2257
  // The record `Object.getOwnPropertyDescriptor` publishes declares
2150
2258
  // `get?`/`set?` beside the data fields, and for every data property --
2151
- // which is what test262's `verifyProperty` restores -- both are absent.
2259
+ // which is what a property-descriptor check restores -- both are absent.
2152
2260
  // A PRESENT accessor is the case the compile-time refusal below states,
2153
2261
  // reached here at runtime rather than at compile time because the same
2154
2262
  // record carries both kinds; it refuses by name where the language would
@@ -2158,27 +2266,22 @@ const descriptorSlotLines = (ctx, operation, representation, text, slot) => {
2158
2266
  push(field, stated(`gea::host::throwRuntimeError("TypeError", "Object.defineProperty with an accessor descriptor (${field.key}) is not rendered by this backend");`));
2159
2267
  continue;
2160
2268
  }
2161
- // A literal's accessor half is the program's own function, boxed as a
2162
- // data property's `value` is (the cited conversion keeps its receiver
2163
- // convention) and installed as the half the object model calls with the
2164
- // receiver of each [[Get]]/[[Set]]. ToPropertyDescriptor's own check that
2165
- // a descriptor is not both kinds runs after every field is read, below.
2269
+ // A genuinely dynamic half already carries Value. Typed Functions need
2270
+ // the native receipt above; the ambient PropertyDescriptor signature
2271
+ // cannot authorize boxing their source frame.
2166
2272
  if (field.key === 'get' || field.key === 'set') {
2167
- const boxed = carried.kind === 'dynamic' ? held : objectValueConversionText(ctx, operation, 'descriptor-value', 2, field.key, carried, held);
2168
- push(field, `gea::${field.key === 'get' ? 'installDescriptorGetter' : 'installDescriptorSetter'}(${slot}, ${boxed});`);
2273
+ if (carried.kind === 'undefined') {
2274
+ push(field, `${slot}.${field.key === 'get' ? 'hasGet' : 'hasSet'} = true;`);
2275
+ continue;
2276
+ }
2277
+ if (carried.kind !== 'dynamic')
2278
+ throw createCppEmitBlockedError('call-abi:object-value-conversions', 'a typed accessor Function has no native installation receipt');
2279
+ push(field, `gea::${field.key === 'get' ? 'installDescriptorGetter' : 'installDescriptorSetter'}(${slot}, ${held});`);
2169
2280
  continue;
2170
2281
  }
2171
2282
  if (field.key === 'value') {
2172
- // A descriptor's `value` is `any` -- ECMAScript's own declaration, and
2173
- // one of the four boundaries where a box is the correct carrier rather
2174
- // than a defect. But the LITERAL's field carries whatever the program
2175
- // wrote (`{ value }` where `value: string` carries `std::string`), so
2176
- // the widening has to be spelled: `gea::Value` declares no converting
2177
- // assignment from an arbitrary type, and relying on one would have been
2178
- // a clang error at every call site rather than a named refusal here.
2179
- //
2180
- // A field already carried as `dynamic` assigns straight across -- it is
2181
- // a `gea::Value` on both sides, and boxing a box would nest two.
2283
+ // A genuinely dynamic descriptor already carries Value. Typed data
2284
+ // fields use the certified native destination recipe above.
2182
2285
  if (carried.kind === 'dynamic') {
2183
2286
  push(field, stated(`${slot}.hasValue = true; ${slot}.value = ${held};`));
2184
2287
  continue;
@@ -2251,7 +2354,7 @@ const dictionaryDefinePropertyValue = (ctx, descriptor) => {
2251
2354
  */
2252
2355
  /**
2253
2356
  * `Object.defineProperty` aimed at a namespace-shaped host intrinsic (`Math`):
2254
- * the fourth reflection operation test262's `verifyProperty` performs on one,
2357
+ * the fourth reflection operation a property-descriptor check performs on one,
2255
2358
  * restoring a member with the descriptor it read. A non-configurable member
2256
2359
  * (every 21.3.1 constant) is validated at runtime by
2257
2360
  * `gea::detail::hostIntrinsicRedefineFixed` -- the one admitted redefinition
@@ -2309,8 +2412,41 @@ const fixedFieldDefinePropertyText = (ctx, view, recipe, descriptor, targetOpera
2309
2412
  const accessor = memberAccessOperator(representation.ownership);
2310
2413
  const descriptorText = operandText(ctx, descriptor);
2311
2414
  const read = (member) => `${descriptorText}${accessor}${cppRecordFieldName(member.key)}`;
2312
- const node = ctx.conversions.nodeById(recipe.conversion);
2313
- const incoming = node === null ? null : recipeText(ctx, node, read(recipe.value));
2415
+ if (recipe.attributesOnly !== undefined) {
2416
+ if (recipe.value !== null || recipe.conversion !== null)
2417
+ throw createCppEmitBlockedError('host-member-call:ObjectConstructor.defineProperty', 'attribute-only definition carries a value recipe');
2418
+ const receiver = 'gea_attributes_target';
2419
+ const description = 'gea_attributes_input';
2420
+ const fieldText = `${receiver}${view.accessor}${cppRecordFieldName(field.key)}`;
2421
+ const attributesText = `${receiver}${view.accessor}${cppRecordFieldAttributesName(field.key)}`;
2422
+ const presenceText = `${receiver}${view.accessor}${cppRecordFieldPresenceName(field.key)}`;
2423
+ const flags = recipe.attributes
2424
+ .map((member) => `gea_attributes.has${member.key[0].toUpperCase()}${member.key.slice(1)} = true; ` +
2425
+ `gea_attributes.${member.key} = ${description}${accessor}${cppRecordFieldName(member.key)};`)
2426
+ .join(' ');
2427
+ let create = 'gea::host::throwRuntimeError("TypeError", "A native attribute definition lost its authenticated own property");';
2428
+ if (recipe.attributesOnly.absence !== null) {
2429
+ const node = ctx.conversions.nodeById(recipe.attributesOnly.absence);
2430
+ const value = node && recipeText(ctx, node, cppUndefinedValue);
2431
+ if (value === null || value === undefined)
2432
+ throw createCppEmitBlockedError('host-member-call:ObjectConstructor.defineProperty', 'attribute-only Undefined creation has no renderer');
2433
+ create =
2434
+ `if (!gea::nativeIsExtensible(${receiver}) || !gea::applyNativeFixedDataDescriptor(` +
2435
+ `${fieldText}, ${attributesText}, ${cppTypeOf(held)}{${value}}, false, ` +
2436
+ 'gea_attributes.hasWritable, gea_attributes.writable, gea_attributes.hasEnumerable, gea_attributes.enumerable, ' +
2437
+ 'gea_attributes.hasConfigurable, gea_attributes.configurable)) ' +
2438
+ `gea::host::throwRuntimeError("TypeError", "Cannot redefine property: ${field.key}"); ` +
2439
+ `gea::detail::noteNativeDeclaredKeyCreated(${receiver}, ${cppStringLiteral(field.key)}); ` +
2440
+ `${presenceText} = true;`;
2441
+ }
2442
+ return (`([&]() { const auto& ${receiver} = ${view.receiver}; const auto& ${description} = ${descriptorText}; ` +
2443
+ `gea::PropertyDescriptor gea_attributes; ${flags}bool gea_present = ${presenceText}; ` +
2444
+ `if (!gea_present) { ${create} } else if (!gea::applyNativeFieldDescriptor<${cppTypeOf(held)}, ${nativeFieldPolicyType(held)}>(` +
2445
+ `${fieldText}, ${attributesText}, gea_present, gea_attributes, true, gea::Value::Tag::Object)) ` +
2446
+ `gea::host::throwRuntimeError("TypeError", "Cannot redefine property: ${field.key}"); return ${receiver}; })()`);
2447
+ }
2448
+ const node = recipe.conversion === null ? null : ctx.conversions.nodeById(recipe.conversion);
2449
+ const incoming = node === null || recipe.value === null ? null : recipeText(ctx, node, read(recipe.value));
2314
2450
  if (incoming === null) {
2315
2451
  throw createCppEmitBlockedError('host-member-call:ObjectConstructor.defineProperty', 'fixed data definition conversion has no renderer');
2316
2452
  }
@@ -2391,9 +2527,9 @@ const fixedFieldDefinePropertyText = (ctx, view, recipe, descriptor, targetOpera
2391
2527
  /**
2392
2528
  * `Object.defineProperty` of a union whose every arm is a generated shared
2393
2529
  * record or a box: the live arm defines the key through its own protocol, as
2394
- * the two single-carrier arms of `definePropertyText` below do. mongodb's
2395
- * `decorateDecryptionResult` holds the caller's adopted Document in the record
2396
- * arm and every nested `decrypted[k]` its recursion passes in the box arm.
2530
+ * the two single-carrier arms of `definePropertyText` below do. A recursive
2531
+ * walk holds the caller's adopted Document in the record arm and every nested
2532
+ * `doc[k]` its recursion passes in the box arm.
2397
2533
  * `null` for any other receiver.
2398
2534
  */
2399
2535
  const unionDefinePropertyText = (ctx, operation, target, key, descriptor) => {
@@ -2427,9 +2563,9 @@ const unionDefinePropertyText = (ctx, operation, target, key, descriptor) => {
2427
2563
  * class constructors are viewed as declares: the constructor's own property
2428
2564
  * lives in its view record (`constructorViewFieldFor`), the storage
2429
2565
  * `C.key = v` writes and `(this.constructor as { key?: T }).key` reads, so the
2430
- * define goes through that record's own [[DefineOwnProperty]]. mongodb's
2431
- * `defineAspects(operation: { aspects?: Set<symbol> }, ...)` receives each
2432
- * operation class. `null` for any other arm, or a key no view declares.
2566
+ * define goes through that record's own [[DefineOwnProperty]]: a helper
2567
+ * `f(target: { tags?: Set<symbol> }, ...)` receives each class itself.
2568
+ * `null` for any other arm, or a key no view declares.
2433
2569
  */
2434
2570
  const constructorViewDefineText = (ctx, arm, armText, key, propertyKey, slot) => {
2435
2571
  if (arm.kind !== 'constructor-family' && arm.kind !== 'constructor-identity')
@@ -2454,6 +2590,49 @@ const definePropertyText = (ctx, operation) => {
2454
2590
  if (key === undefined || descriptor === undefined) {
2455
2591
  throw createCppEmitBlockedError('host-member-call:ObjectConstructor.defineProperty', '"Object.defineProperty" takes a target, a key and a descriptor; this call passes fewer');
2456
2592
  }
2593
+ if (operation.nativeArrayDescriptorReinstallation) {
2594
+ const receipt = operation.nativeArrayDescriptorReinstallation;
2595
+ if (target.representation.kind !== 'array-object' ||
2596
+ target.value !== receipt.receiver.value ||
2597
+ key.value !== receipt.key.value ||
2598
+ descriptor.value !== receipt.descriptor.value)
2599
+ throw createCppEmitBlockedError('runtime-helper:native-array-descriptor-snapshot', 'the copied descriptor has no native array owner');
2600
+ const valueNames = new Map(ctx.valueNames)
2601
+ .set(target.value, '__gea_target')
2602
+ .set(key.value, '__gea_key_input')
2603
+ .set(descriptor.value, '__gea_descriptor_input');
2604
+ const deferredTexts = new Map(ctx.deferredTexts);
2605
+ const pendingPacks = new Map(ctx.pendingPacks);
2606
+ for (const operand of [target, key, descriptor]) {
2607
+ deferredTexts.delete(operand.value);
2608
+ pendingPacks.delete(operand.value);
2609
+ }
2610
+ const bound = { ...ctx, valueNames, deferredTexts, pendingPacks };
2611
+ return (`([&]() { const auto& __gea_target = ${operandText(ctx, target)}; const auto& __gea_key_input = ${operandText(ctx, key)}; ` +
2612
+ `const auto& __gea_descriptor_input = ${operandText(ctx, descriptor)}; ` +
2613
+ `${defineDescriptorLines(bound, operation, descriptor, '__gea_descriptor')} ` +
2614
+ `if (!gea::nativeDynamicDefineProperty(__gea_target, ${propertyKeyOperandText(bound, key, '"Object.defineProperty" of a captured native descriptor')}, __gea_descriptor)) ` +
2615
+ 'gea::host::throwRuntimeError("TypeError", "Cannot reinstall native array descriptor"); return __gea_target; })()');
2616
+ }
2617
+ const delegatedReceiver = generatedRecordReceiver(target.representation, '__gea_target');
2618
+ if (operation.nativeDataDefinition?.delegatesView && delegatedReceiver !== null) {
2619
+ const valueNames = new Map(ctx.valueNames)
2620
+ .set(target.value, '__gea_target')
2621
+ .set(key.value, '__gea_key_input')
2622
+ .set(descriptor.value, '__gea_descriptor_input');
2623
+ const deferredTexts = new Map(ctx.deferredTexts);
2624
+ const pendingPacks = new Map(ctx.pendingPacks);
2625
+ for (const operand of [target, key, descriptor]) {
2626
+ deferredTexts.delete(operand.value);
2627
+ pendingPacks.delete(operand.value);
2628
+ }
2629
+ const bound = { ...ctx, valueNames, deferredTexts, pendingPacks };
2630
+ return (`([&]() { const auto& __gea_target = ${operandText(ctx, target)}; const auto& __gea_key_input = ${operandText(ctx, key)}; ` +
2631
+ `const auto& __gea_descriptor_input = ${operandText(ctx, descriptor)}; ` +
2632
+ `${defineDescriptorLines(bound, operation, descriptor, '__gea_descriptor')} ` +
2633
+ `if (!${generatedDefineOwnText('__gea_target', propertyKeyOperandText(bound, key, '"Object.defineProperty" of a native view'), '__gea_descriptor')}) ` +
2634
+ 'gea::host::throwRuntimeError("TypeError", "Cannot define a native view property"); return __gea_target; })()');
2635
+ }
2457
2636
  if (operation.fixedDataDefinition !== undefined) {
2458
2637
  const view = objectViewOf(ctx, 'defineProperty', target, 'target');
2459
2638
  if (view.kind !== 'known')
@@ -2676,7 +2855,7 @@ const pairWalkFromEntriesText = (ctx, operation, source) => {
2676
2855
  if (halves === null)
2677
2856
  return refuse(`its entry "${representationKey(pair)}" is not a two-position [key, value] pair`);
2678
2857
  // ToPropertyKey of an absent key is its ToString: an entry whose key is
2679
- // `undefined` (the mongodb driver's optional index `name`) lands under
2858
+ // `undefined` (an optional field used as the key) lands under
2680
2859
  // "undefined", exactly as node stores it.
2681
2860
  const keyCarrier = halves.key;
2682
2861
  const keyText = keyCarrier.kind === 'string'
@@ -2695,7 +2874,7 @@ const pairWalkFromEntriesText = (ctx, operation, source) => {
2695
2874
  const store = `(*gea_object)[${keyText}] = ${value};`;
2696
2875
  const dictionaryType = cppTypeOf({ ...result, ownership: 'owned' });
2697
2876
  const walk = carrier.kind === 'array-object'
2698
- ? `if (gea_source) for (const auto& gea_slot : gea_source->slots()) { ` +
2877
+ ? `if (gea_source) for (const auto& gea_slot : gea_source->readSlots()) { ` +
2699
2878
  `if (!gea_slot.present) gea::host::throwRuntimeError("TypeError", "Iterator value undefined is not an entry object"); ` +
2700
2879
  `const auto& gea_pair = gea_slot.value; ${store} }`
2701
2880
  : `auto gea_cursor = gea_source; while (true) { auto gea_pair = gea_cursor.arrayNext(); if (gea_cursor.done()) break; ${store} }`;
@@ -2789,6 +2968,9 @@ const sameValueText = (leftCarrier, leftText, rightCarrier, rightText, depth = 0
2789
2968
  return `gea::sameNumberValue(static_cast<double>(${leftText}), static_cast<double>(${rightText}))`;
2790
2969
  if (leftType !== null)
2791
2970
  return `${leftText} == ${rightText}`;
2971
+ const callable = callableIdentityEqualityText('===', { representation: leftCarrier, text: leftText }, { representation: rightCarrier, text: rightText });
2972
+ if (callable !== null)
2973
+ return callable;
2792
2974
  if (representationKey(leftCarrier) === representationKey(rightCarrier) &&
2793
2975
  (leftCarrier.kind === 'array-buffer' ||
2794
2976
  leftCarrier.kind === 'shared-array-buffer' ||
@@ -2808,6 +2990,7 @@ const composite = (carrier, name, leaf) => {
2808
2990
  return `${arms.join(' ')} return false;`;
2809
2991
  };
2810
2992
  export const objectMemberText = (ctx, member, operation) => {
2993
+ ctx = { ...ctx, hostObjectWalkPlan: operation.hostObjectWalkPlan };
2811
2994
  if (member === 'keys' || member === 'getOwnPropertyNames')
2812
2995
  return keysText(ctx, member, operation);
2813
2996
  if (member === 'getOwnPropertySymbols')