chrome-devtools-frontend 1.0.1565595 → 1.0.1567721

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 (201) hide show
  1. package/docs/contributing/performance.md +24 -0
  2. package/front_end/Images/src/lock-person.svg +1 -0
  3. package/front_end/core/common/Base64.ts +21 -2
  4. package/front_end/core/common/ResourceType.ts +7 -0
  5. package/front_end/core/host/InspectorFrontendHostStub.ts +3 -0
  6. package/front_end/core/host/UserMetrics.ts +20 -0
  7. package/front_end/core/root/Runtime.ts +5 -0
  8. package/front_end/core/sdk/DOMModel.ts +32 -2
  9. package/front_end/core/sdk/NetworkManager.ts +16 -3
  10. package/front_end/core/sdk/ResourceTreeModel.ts +11 -6
  11. package/front_end/entrypoints/main/MainImpl.ts +1 -7
  12. package/front_end/generated/Deprecation.ts +0 -8
  13. package/front_end/generated/InspectorBackendCommands.ts +10 -1
  14. package/front_end/generated/SupportedCSSProperties.js +48 -62
  15. package/front_end/generated/protocol-mapping.d.ts +4 -0
  16. package/front_end/generated/protocol-proxy-api.d.ts +5 -0
  17. package/front_end/generated/protocol.ts +203 -0
  18. package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -1
  19. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +98 -105
  20. package/front_end/models/emulation/DeviceModeModel.ts +1 -1
  21. package/front_end/models/formatter/FormatterWorkerPool.ts +8 -6
  22. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -9
  23. package/front_end/models/persistence/PersistenceImpl.ts +8 -0
  24. package/front_end/models/text_utils/TextUtils.snapshot.txt +83 -0
  25. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -1
  26. package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +28 -4
  27. package/front_end/panels/ai_assistance/components/ChatView.ts +52 -169
  28. package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +27 -8
  29. package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +19 -4
  30. package/front_end/panels/application/ApplicationPanelSidebar.ts +29 -0
  31. package/front_end/panels/application/ApplicationPanelTreeElement.ts +12 -0
  32. package/front_end/panels/application/DeviceBoundSessionsModel.ts +169 -0
  33. package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +219 -0
  34. package/front_end/panels/application/DeviceBoundSessionsView.ts +1096 -0
  35. package/front_end/panels/application/ResourcesPanel.ts +19 -0
  36. package/front_end/panels/application/application.ts +6 -0
  37. package/front_end/panels/application/deviceBoundSessionsView.css +27 -0
  38. package/front_end/panels/common/AiCodeGenerationUpgradeDialog.ts +115 -0
  39. package/front_end/panels/common/aiCodeGenerationUpgradeDialog.css +79 -0
  40. package/front_end/panels/common/common.ts +1 -0
  41. package/front_end/panels/console/ConsoleInsightTeaser.ts +41 -8
  42. package/front_end/panels/console/ConsoleViewMessage.ts +20 -13
  43. package/front_end/panels/elements/ElementsTreeOutline.ts +13 -0
  44. package/front_end/panels/elements/MetricsSidebarPane.ts +3 -1
  45. package/front_end/panels/issues/AffectedSourcesView.ts +0 -1
  46. package/front_end/panels/issues/IssuesPane.ts +0 -4
  47. package/front_end/panels/network/RequestTimingView.ts +5 -20
  48. package/front_end/panels/network/networkTimingTable.css +5 -5
  49. package/front_end/panels/recorder/components/StepEditor.ts +15 -8
  50. package/front_end/panels/security/SecurityPanelSidebar.ts +0 -1
  51. package/front_end/panels/settings/AISettingsTab.ts +31 -2
  52. package/front_end/panels/sources/InplaceFormatterEditorAction.ts +8 -6
  53. package/front_end/panels/sources/UISourceCodeFrame.ts +9 -3
  54. package/front_end/panels/timeline/TimelinePanel.ts +12 -4
  55. package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +1 -1
  56. package/front_end/third_party/chromium/README.chromium +1 -1
  57. package/front_end/third_party/puppeteer/README.chromium +2 -2
  58. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +9 -2
  59. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
  60. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
  61. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +8 -0
  62. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  63. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +8 -0
  64. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  65. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +2 -1
  66. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
  67. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +2 -2
  68. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
  69. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  70. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +3 -1
  71. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
  72. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
  73. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
  75. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  76. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +3 -3
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.d.ts +1 -0
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js +1 -0
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +1 -0
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +33 -31
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.d.ts +2 -2
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.d.ts.map +1 -1
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js +1 -4
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js.map +1 -1
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +7 -1
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +11 -1
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Cookie.d.ts +2 -2
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
  99. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
  100. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  101. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  102. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  103. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +13 -4
  104. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +62 -42
  105. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +9 -2
  106. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
  107. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
  108. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +8 -0
  109. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  110. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +8 -0
  111. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  112. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +2 -1
  113. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
  114. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +2 -2
  115. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
  116. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +3 -1
  118. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +1 -1
  121. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
  122. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +3 -3
  124. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.d.ts +1 -0
  126. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
  127. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js +1 -0
  128. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js.map +1 -1
  129. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
  130. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +1 -0
  131. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
  132. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  133. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +33 -31
  134. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  135. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.d.ts +2 -2
  136. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.d.ts.map +1 -1
  137. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js +1 -4
  138. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js.map +1 -1
  139. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +7 -1
  140. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  141. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +11 -1
  142. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
  143. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Cookie.d.ts +2 -2
  144. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
  145. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
  146. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  147. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/types.d.ts +13 -4
  149. package/front_end/third_party/puppeteer/package/package.json +3 -3
  150. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +11 -3
  151. package/front_end/third_party/puppeteer/package/src/api/Page.ts +9 -0
  152. package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +3 -3
  153. package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +3 -1
  154. package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +1 -0
  155. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +3 -5
  156. package/front_end/third_party/puppeteer/package/src/bidi/core/UserContext.ts +2 -0
  157. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +1 -0
  158. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +43 -45
  159. package/front_end/third_party/puppeteer/package/src/cdp/WebWorker.ts +3 -11
  160. package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +12 -0
  161. package/front_end/third_party/puppeteer/package/src/common/Cookie.ts +2 -2
  162. package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
  163. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  164. package/front_end/third_party/source-map-scopes-codec/README.chromium +2 -5
  165. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +1 -1
  166. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +1 -1
  167. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +1 -1
  168. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +1 -1
  169. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +1 -1
  170. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +1 -1
  171. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +1 -1
  172. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +1 -1
  173. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +1 -1
  174. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +1 -1
  175. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts +130 -0
  176. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts.map +1 -0
  177. package/front_end/third_party/source-map-scopes-codec/package/deno.json +1 -1
  178. package/front_end/third_party/source-map-scopes-codec/package/package.json +1 -1
  179. package/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +1 -1
  180. package/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +1 -1
  181. package/front_end/third_party/source-map-scopes-codec/package/src/codec.js +4 -0
  182. package/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +1 -1
  183. package/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +4 -0
  184. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +30 -13
  185. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +1 -1
  186. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +35 -17
  187. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +1 -1
  188. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +1 -1
  189. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +1 -1
  190. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +2 -2
  191. package/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +1 -1
  192. package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js +7 -0
  193. package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js.map +1 -0
  194. package/front_end/third_party/source-map-scopes-codec/package/src/util.ts +1 -1
  195. package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +8 -1
  196. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +4 -0
  197. package/front_end/ui/visual_logging/KnownContextValues.ts +13 -0
  198. package/mcp/mcp.ts +1 -0
  199. package/package.json +1 -2
  200. package/front_end/third_party/source-map-scopes-codec/package/src/scopes-tsconfig.json +0 -8
  201. /package/front_end/third_party/source-map-scopes-codec/package/src/{scopes.d.ts → scopes.ts} +0 -0
@@ -151,6 +151,7 @@ export class CdpPage extends Page {
151
151
  assert(this.#tabTargetClient, 'Tab target session is not defined.');
152
152
  this.#tabTarget = (this.#tabTargetClient as CdpCDPSession).target();
153
153
  assert(this.#tabTarget, 'Tab target is not defined.');
154
+ this._tabId = this.#tabTarget._getTargetInfo().targetId;
154
155
  this.#primaryTarget = target;
155
156
  this.#targetManager = target._targetManager();
156
157
  this.#keyboard = new CdpKeyboard(client);
@@ -345,7 +346,7 @@ export class CdpPage extends Page {
345
346
  session.target().url(),
346
347
  session.target()._targetId,
347
348
  session.target().type(),
348
- this.#addConsoleMessage.bind(this),
349
+ this.#onConsoleAPI.bind(this),
349
350
  this.#handleException.bind(this),
350
351
  this.#frameManager.networkManager,
351
352
  );
@@ -519,6 +520,7 @@ export class CdpPage extends Page {
519
520
  [{url, lineNumber}],
520
521
  undefined,
521
522
  stackTrace,
523
+ this.#primaryTarget._targetId,
522
524
  ),
523
525
  );
524
526
  }
@@ -842,46 +844,9 @@ export class CdpPage extends Page {
842
844
  const values = event.args.map(arg => {
843
845
  return world.createCdpHandle(arg);
844
846
  });
845
- this.#addConsoleMessage(
846
- convertConsoleMessageLevel(event.type),
847
- values,
848
- event.stackTrace,
849
- );
850
- }
851
-
852
- async #onBindingCalled(
853
- world: IsolatedWorld,
854
- event: Protocol.Runtime.BindingCalledEvent,
855
- ): Promise<void> {
856
- let payload: BindingPayload;
857
- try {
858
- payload = JSON.parse(event.payload);
859
- } catch {
860
- // The binding was either called by something in the page or it was
861
- // called before our wrapper was initialized.
862
- return;
863
- }
864
- const {type, name, seq, args, isTrivial} = payload;
865
- if (type !== 'exposedFun') {
866
- return;
867
- }
868
-
869
- const context = world.context;
870
- if (!context) {
871
- return;
872
- }
873
-
874
- const binding = this.#bindings.get(name);
875
- await binding?.run(context, seq, args, isTrivial);
876
- }
877
847
 
878
- #addConsoleMessage(
879
- eventType: string,
880
- args: JSHandle[],
881
- stackTrace?: Protocol.Runtime.StackTrace,
882
- ): void {
883
848
  if (!this.listenerCount(PageEvent.Console)) {
884
- args.forEach(arg => {
849
+ values.forEach(arg => {
885
850
  return arg.dispose();
886
851
  });
887
852
  return;
@@ -889,7 +854,7 @@ export class CdpPage extends Page {
889
854
  const textTokens = [];
890
855
  // eslint-disable-next-line max-len -- The comment is long.
891
856
  // eslint-disable-next-line @puppeteer/use-using -- These are not owned by this function.
892
- for (const arg of args) {
857
+ for (const arg of values) {
893
858
  const remoteObject = arg.remoteObject();
894
859
  if (remoteObject.objectId) {
895
860
  textTokens.push(arg.toString());
@@ -898,8 +863,8 @@ export class CdpPage extends Page {
898
863
  }
899
864
  }
900
865
  const stackTraceLocations = [];
901
- if (stackTrace) {
902
- for (const callFrame of stackTrace.callFrames) {
866
+ if (event.stackTrace) {
867
+ for (const callFrame of event.stackTrace.callFrames) {
903
868
  stackTraceLocations.push({
904
869
  url: callFrame.url,
905
870
  lineNumber: callFrame.lineNumber,
@@ -907,17 +872,50 @@ export class CdpPage extends Page {
907
872
  });
908
873
  }
909
874
  }
875
+
876
+ let targetId;
877
+ if (world.environment.client instanceof CdpCDPSession) {
878
+ targetId = world.environment.client.target()._targetId;
879
+ }
880
+
910
881
  const message = new ConsoleMessage(
911
- convertConsoleMessageLevel(eventType),
882
+ convertConsoleMessageLevel(event.type),
912
883
  textTokens.join(' '),
913
- args,
884
+ values,
914
885
  stackTraceLocations,
915
886
  undefined,
916
- stackTrace,
887
+ event.stackTrace,
888
+ targetId,
917
889
  );
918
890
  this.emit(PageEvent.Console, message);
919
891
  }
920
892
 
893
+ async #onBindingCalled(
894
+ world: IsolatedWorld,
895
+ event: Protocol.Runtime.BindingCalledEvent,
896
+ ): Promise<void> {
897
+ let payload: BindingPayload;
898
+ try {
899
+ payload = JSON.parse(event.payload);
900
+ } catch {
901
+ // The binding was either called by something in the page or it was
902
+ // called before our wrapper was initialized.
903
+ return;
904
+ }
905
+ const {type, name, seq, args, isTrivial} = payload;
906
+ if (type !== 'exposedFun') {
907
+ return;
908
+ }
909
+
910
+ const context = world.context;
911
+ if (!context) {
912
+ return;
913
+ }
914
+
915
+ const binding = this.#bindings.get(name);
916
+ await binding?.run(context, seq, args, isTrivial);
917
+ }
918
+
921
919
  #onDialog(event: Protocol.Page.JavascriptDialogOpeningEvent): void {
922
920
  const type = validateDialogType(event.type);
923
921
  const dialog = new CdpDialog(
@@ -14,16 +14,14 @@ import {debugError} from '../common/util.js';
14
14
 
15
15
  import {ExecutionContext} from './ExecutionContext.js';
16
16
  import {IsolatedWorld} from './IsolatedWorld.js';
17
- import {CdpJSHandle} from './JSHandle.js';
18
17
  import type {NetworkManager} from './NetworkManager.js';
19
18
 
20
19
  /**
21
20
  * @internal
22
21
  */
23
22
  export type ConsoleAPICalledCallback = (
24
- eventType: string,
25
- handles: CdpJSHandle[],
26
- trace?: Protocol.Runtime.StackTrace,
23
+ world: IsolatedWorld,
24
+ event: Protocol.Runtime.ConsoleAPICalledEvent,
27
25
  ) => void;
28
26
 
29
27
  /**
@@ -64,13 +62,7 @@ export class CdpWebWorker extends WebWorker {
64
62
  });
65
63
  this.#world.emitter.on('consoleapicalled', async event => {
66
64
  try {
67
- return consoleAPICalled(
68
- event.type,
69
- event.args.map((object: Protocol.Runtime.RemoteObject) => {
70
- return new CdpJSHandle(this.#world, object);
71
- }),
72
- event.stackTrace,
73
- );
65
+ return consoleAPICalled(this.#world, event);
74
66
  } catch (err) {
75
67
  debugError(err);
76
68
  }
@@ -65,6 +65,7 @@ export class ConsoleMessage {
65
65
  #stackTraceLocations: ConsoleMessageLocation[];
66
66
  #frame?: Frame;
67
67
  #rawStackTrace?: Protocol.Runtime.StackTrace;
68
+ #targetId?: string;
68
69
 
69
70
  /**
70
71
  * @internal
@@ -76,6 +77,7 @@ export class ConsoleMessage {
76
77
  stackTraceLocations: ConsoleMessageLocation[],
77
78
  frame?: Frame,
78
79
  rawStackTrace?: Protocol.Runtime.StackTrace,
80
+ targetId?: string,
79
81
  ) {
80
82
  this.#type = type;
81
83
  this.#text = text;
@@ -83,6 +85,7 @@ export class ConsoleMessage {
83
85
  this.#stackTraceLocations = stackTraceLocations;
84
86
  this.#frame = frame;
85
87
  this.#rawStackTrace = rawStackTrace;
88
+ this.#targetId = targetId;
86
89
  }
87
90
 
88
91
  /**
@@ -131,4 +134,13 @@ export class ConsoleMessage {
131
134
  _rawStackTrace(): Protocol.Runtime.StackTrace | undefined {
132
135
  return this.#rawStackTrace;
133
136
  }
137
+
138
+ /**
139
+ * The targetId from which this console message originated.
140
+ *
141
+ * @internal
142
+ */
143
+ _targetId(): string | undefined {
144
+ return this.#targetId;
145
+ }
134
146
  }
@@ -133,7 +133,7 @@ export interface CookieParam {
133
133
  */
134
134
  priority?: CookiePriority;
135
135
  /**
136
- * True if cookie is SameParty. Supported only in Chrome.
136
+ * @deprecated Always ignored.
137
137
  */
138
138
  sameParty?: boolean;
139
139
  /**
@@ -193,7 +193,7 @@ export interface CookieData {
193
193
  */
194
194
  priority?: CookiePriority;
195
195
  /**
196
- * True if cookie is SameParty. Supported only in Chrome.
196
+ * @deprecated Always set to false. Supported only in Chrome.
197
197
  */
198
198
  sameParty?: boolean;
199
199
  /**
@@ -8,7 +8,7 @@
8
8
  * @internal
9
9
  */
10
10
  export const PUPPETEER_REVISIONS = Object.freeze({
11
- chrome: '143.0.7499.169',
12
- 'chrome-headless-shell': '143.0.7499.169',
11
+ chrome: '143.0.7499.192',
12
+ 'chrome-headless-shell': '143.0.7499.192',
13
13
  firefox: 'stable_146.0.1',
14
14
  });
@@ -6,5 +6,5 @@
6
6
 
7
7
  // If moved update release-please config
8
8
  // x-release-please-start-version
9
- export const packageVersion = '24.34.0';
9
+ export const packageVersion = '24.35.0';
10
10
  // x-release-please-end
@@ -1,8 +1,8 @@
1
1
  Name: source-map-scopes-codec
2
2
  Short Name: source-map-scopes-codec
3
3
  URL: https://github.com/ChromeDevTools/source-map-scopes-codec
4
- Version: 0.3.1
5
- Revision: a171786509be39fab374b8c8b85063b172065fb1
4
+ Version: 0.6.1
5
+ Revision: d37113f9300493afbffea7b960afd8ba2e9d816a
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE
8
8
  Security Critical: no
@@ -26,6 +26,3 @@ then (use the URL shown by the above command)
26
26
  rm -rf package
27
27
  wget -qO- https://npm.jsr.io/\~/11/@jsr/chrome-devtools__source-map-scopes-codec/0.3.1.tgz | tar xzf -
28
28
  ```
29
-
30
- Modifications:
31
- Added a BUILD.gn file to package/src as esbuild would place output files otherwise in the wrong location.
@@ -1,4 +1,4 @@
1
- import type { Binding, GeneratedRange, OriginalPosition, OriginalScope, ScopeInfo } from "../../../src/scopes.js";
1
+ import type { Binding, GeneratedRange, OriginalPosition, OriginalScope, ScopeInfo } from "../scopes.js";
2
2
  /**
3
3
  * Small utility class to build scope and range trees.
4
4
  *
@@ -1 +1 @@
1
- {"version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Ac,cAAc;EAI1C,UAAU,aAAa,OAAO,aAAa,GAAG,OAAO;EAIrD,UAAU,gBAAgB,KAAK,QAAQ,GAAG,OAAO;EAIjD,UAAU,mBAAmB,KAAK,QAAQ,GAAG;AAG/C;AAEA;;;;;CAKC,GACD,YAAY,WAAW,OAAO"}
@@ -1,4 +1,4 @@
1
- import type { Binding, OriginalPosition, OriginalScope, ScopeInfo } from "../../../src/scopes.js";
1
+ import type { Binding, OriginalPosition, OriginalScope, ScopeInfo } from "../scopes.js";
2
2
  import { ScopeInfoBuilder, type ScopeKey } from "./builder.js";
3
3
  /**
4
4
  * Similar to `ScopeInfoBuilder`, but with checks that scopes/ranges are well
@@ -1 +1 @@
1
- {"version":3,"file":"safe_builder.d.ts","sources":["../../../src/builder/safe_builder.ts"],"names":[],"mappings":"AAIA,cACE,OAAO,EACP,gBAAgB,EAChB,aAAa,EAEb,SAAS,iCACa;AAExB,SAAS,gBAAgB,EAAE,KAAK,QAAQ,uBAAuB;AAE/D;;;CAGC,GACD,OAAO,cAAM,6BAA6B;EACxC,SAAS,gBAAgB,IAAI;EAQ7B,SAAS,WACP,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd;IACE,OAAO,MAAM;IACb,OAAO,MAAM;IACb,eAAe,OAAO;IACtB,YAAY,MAAM;IAClB,MAAM;GACP,GACA,IAAI;EA2BP,SAAS,aAAa,MAAM,MAAM,GAAG,IAAI;EAQzC,SAAS,aAAa,MAAM,MAAM,GAAG,IAAI;EAQzC,SAAS,mBAAmB,cAAc,OAAO,GAAG,IAAI;EAQxD,SAAS,kBAAkB,WAAW,MAAM,EAAE,GAAG,IAAI;EAQrD,SAAS,SAAS,MAAM,MAAM,EAAE,QAAQ,MAAM,GAAG,IAAI;EAkBrD,SAAS,WACP,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd;IACE,QAAQ;IACR,WAAW;IACX,eAAe,OAAO;IACtB,WAAW,OAAO;IAClB,SAAS;IACT,WAAW;GACZ,GACA,IAAI;EA6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UAAU,QAAQ,GAAG,IAAI;EAc7D,SAAS,mBAAmB,cAAc,OAAO,GAAG,IAAI;EAQxD,SAAS,eAAe,UAAU,OAAO,GAAG,IAAI;EAQhD,SAAS,eAAe,QAAQ,SAAS,GAAG,IAAI;EAmBhD,SAAS,iBAAiB,UAAU,gBAAgB,GAAG,IAAI;EAQ3D,SAAS,SAAS,MAAM,MAAM,EAAE,QAAQ,MAAM,GAAG,IAAI;EAmBrD,SAAS,SAAS;AAkFpB"}
@@ -1,4 +1,4 @@
1
- import type { Position, ScopeInfo, SourceMap } from "../../../src/scopes.js";
1
+ import type { Position, ScopeInfo, SourceMap } from "../scopes.js";
2
2
  /**
3
3
  * The mode decides how well-formed the encoded scopes have to be, to be accepted by the decoder.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"decode.d.ts","sources":["../../../src/decode/decode.ts"],"names":[],"mappings":"AAWA,cAIE,QAAQ,EACR,SAAS,EACT,SAAS,iCAGa;AAGxB;;;;;;;;;;;;;CAaC,GACD,0BAAkB;EAChB,SAAS;EACT,MAAM;;AAGR,iBAAiB;EACf,MAAM;EAEN;;;;;GAKC,GACD,iBAAiB;;AAQnB,OAAO,iBAAS,OACd,WAAW,SAAS,EACpB,UAAS,QAAQ,cAAuC,GACvD"}
1
+ {"version":3,"file":"decode.d.ts","sources":["../../../src/decode/decode.ts"],"names":[],"mappings":"AAWA,cAIE,QAAQ,EACR,SAAS,EACT,SAAS,uBAGW;AAGtB;;;;;;;;;;;;;CAaC,GACD,0BAAkB;EAChB,SAAS;EACT,MAAM;;AAGR,iBAAiB;EACf,MAAM;EAEN;;;;;GAKC,GACD,iBAAiB;;AAQnB,OAAO,iBAAS,OACd,WAAW,SAAS,EACpB,UAAS,QAAQ,cAAuC,GACvD"}
@@ -1,4 +1,4 @@
1
- import type { ScopeInfo, SourceMapJson } from "../../../src/scopes.js";
1
+ import type { ScopeInfo, SourceMapJson } from "../scopes.js";
2
2
  /**
3
3
  * Encodes the `ScopeInfo` into a source map JSON object.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"encode.d.ts","sources":["../../../src/encode/encode.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,EAAE,aAAa,iCAAyB;AAG/D;;;;;CAKC,GACD,OAAO,iBAAS,OACd,YAAY,SAAS,EACrB,iBAAiB,aAAa,GAC7B"}
1
+ {"version":3,"file":"encode.d.ts","sources":["../../../src/encode/encode.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,EAAE,aAAa,uBAAuB;AAG7D;;;;;CAKC,GACD,OAAO,iBAAS,OACd,YAAY,SAAS,EACrB,iBAAiB,aAAa,GAC7B"}
@@ -1,4 +1,4 @@
1
- export type { Binding, GeneratedRange, OriginalPosition, OriginalScope, Position, ScopeInfo, SourceMapJson, SubRangeBinding } from "../../src/scopes.js";
1
+ export type { Binding, GeneratedRange, OriginalPosition, OriginalScope, Position, ScopeInfo, SourceMapJson, SubRangeBinding } from "./scopes.js";
2
2
  export { encode } from "./encode/encode.js";
3
3
  export { decode, DecodeMode } from "./decode/decode.js";
4
4
  export { ScopeInfoBuilder } from "./builder/builder.js";
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sources":["../../src/mod.ts"],"names":[],"mappings":"AAIA,cACE,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,SAAS,EACT,aAAa,EACb,eAAe,8BACM;AAEvB,SAAS,MAAM,6BAA6B;AAC5C,SAAS,MAAM,EAAE,UAAU,6BAA6B;AAExD,SAAS,gBAAgB,+BAA+B;AACxD,SAAS,oBAAoB,oCAAoC"}
1
+ {"version":3,"file":"mod.d.ts","sources":["../../src/mod.ts"],"names":[],"mappings":"AAIA,cACE,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,SAAS,EACT,aAAa,EACb,eAAe,sBACI;AAErB,SAAS,MAAM,6BAA6B;AAC5C,SAAS,MAAM,EAAE,UAAU,6BAA6B;AAExD,SAAS,gBAAgB,+BAA+B;AACxD,SAAS,oBAAoB,oCAAoC"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * The decoded scopes information found in a source map.
3
+ */ export interface ScopeInfo {
4
+ /**
5
+ * The length of {@linkcode scopes} must match the length of "sources" in the source map JSON. Each entry describes the scope tree of the corresponding source file.
6
+ */ scopes: (OriginalScope | null)[];
7
+ /**
8
+ * The range tree of the generated bundle. Multiple top-level ranges are allowed but must not overlap source position wise.
9
+ */ ranges: GeneratedRange[];
10
+ }
11
+ /**
12
+ * A scope in the authored source.
13
+ */ export interface OriginalScope {
14
+ /** The beginning of this scope (inclusive). */ start: Position;
15
+ /** The end of this scope (exclusive) */ end: Position;
16
+ /**
17
+ * The name of this scope. For function scopes this is the function name.
18
+ *
19
+ * Constructors may put the class name here.
20
+ */ name?: string;
21
+ /**
22
+ * JavaScript-like languages are encouraged to use 'Global', 'Class', 'Function' and 'Block'.
23
+ *
24
+ * The "kind" is only used in debuggers as a label for scope UI views, but does not have any
25
+ * semantic significance.
26
+ */ kind?: string;
27
+ /**
28
+ * Whether this scope is something that can be called and results in stack frame (e.g. functions, methods, etc.).
29
+ */ isStackFrame: boolean;
30
+ /**
31
+ * All variable names that this scope declares.
32
+ */ variables: string[];
33
+ /**
34
+ * The child scopes. When manually building scopes, {@linkcode children} must be sorted, not
35
+ * overlap each other and be contained within [start, end).
36
+ */ children: OriginalScope[];
37
+ /** The parent scope or `undefined` for top-level scopes. */ parent?: OriginalScope;
38
+ }
39
+ /**
40
+ * A range (can be a scope) in the generated JavaScript/WASM.
41
+ *
42
+ * The name "range" was chosen deliberately as a GeneratedRange does not necessarily
43
+ * correspond to a lexical JavaScript scope. E.g. inlining, or concatenating multiple
44
+ * bundles can result in generated ranges that are not lexical scopes.
45
+ */ export interface GeneratedRange {
46
+ /** The beginning of this range (inclusive) */ start: Position;
47
+ /** The end of this range (exclusive) */ end: Position;
48
+ /**
49
+ * The corresponding scope in the authored source.
50
+ */ originalScope?: OriginalScope;
51
+ /**
52
+ * Whether this generated range is an actual JavaScript/WASM function in the generated code.
53
+ */ isStackFrame: boolean;
54
+ /**
55
+ * Whether calls to this generated range should be hidden from stack traces even if
56
+ * this range has an `originalScope`.
57
+ */ isHidden: boolean;
58
+ /**
59
+ * If this `GeneratedRange` is the result of inlining `originalScope`, then `callSite`
60
+ * refers to where `originalScope` was called in the original ("authored") code.
61
+ *
62
+ * If this field is present than `originalScope` is present as well and `isStackFrame` is `false`.
63
+ */ callSite?: OriginalPosition;
64
+ /**
65
+ * Expressions that compute the values of the variables of this OriginalScope. The length
66
+ * of `values` matches the length of `originalScope.variables`.
67
+ */ values: Binding[];
68
+ /**
69
+ * The child ranges. When manually building ranges, {@linkcode children} must be sorted,
70
+ * not overlap each other and be contained within [start, end).
71
+ */ children: GeneratedRange[];
72
+ /** The parent range or `undefined` for top-level ranges. */ parent?: GeneratedRange;
73
+ }
74
+ /**
75
+ * For each variable, this can either be:
76
+ *
77
+ * 1) A single expression (valid for a full `GeneratedRange`).
78
+ *
79
+ * 2) `null` if this variable is unavailable in the whole range. This can
80
+ * happen e.g. when the variable was optimized out and can't be recomputed.
81
+ *
82
+ * 3) A list of `SubRangeBinding`s. Used when computing the value requires different
83
+ * expressions throughout the `GeneratedRange` or if the variable is unavailable in
84
+ * parts of the `GeneratedRange`.
85
+ *
86
+ * Note: The decoder produces `SubRangeBindings` where the "from" of the first `SubRangeBinding`
87
+ * and the "to" of the last `SubRangeBinding` are equal to the `GeneratedRange`s "start" and "end"
88
+ * position respectively.
89
+ */ export type Binding = string | null | SubRangeBinding[];
90
+ export interface SubRangeBinding {
91
+ value?: string;
92
+ from: Position;
93
+ to: Position;
94
+ }
95
+ /**
96
+ * A position with 0-based line and column numbers.
97
+ *
98
+ * A {@linkcode Position} object by itself does not imply a position in original source
99
+ * or generated code. It is used in both and normally it is clear from context.
100
+ */ export interface Position {
101
+ line: number;
102
+ column: number;
103
+ }
104
+ /**
105
+ * A position with 0-based line and column numbers in a specific original source file.
106
+ */ export interface OriginalPosition extends Position {
107
+ /** The 0-based index into "sources" in the source map. Or into {@linkcode ScopeInfo.scopes}. */ sourceIndex: number;
108
+ }
109
+ /**
110
+ * A standard source map, or index source map as per https://tc39.es/ecma426.
111
+ */ export type SourceMap = SourceMapJson | IndexSourceMapJson;
112
+ /**
113
+ * A standard index source map json object as per https://tc39.es/ecma426.
114
+ */ export interface IndexSourceMapJson {
115
+ version: 3;
116
+ sections: Array<{
117
+ offset: Position;
118
+ map: SourceMapJson;
119
+ }>;
120
+ }
121
+ /**
122
+ * A standard source map json object as per https://tc39.es/ecma426.
123
+ */ export interface SourceMapJson {
124
+ version: 3;
125
+ sources: (string | null)[];
126
+ mappings: string;
127
+ names?: string[];
128
+ scopes?: string;
129
+ }
130
+ //# sourceMappingURL=scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopes.d.ts","sources":["../../src/scopes.ts"],"names":[],"mappings":"AAIA;;CAEC,GACD,iBAAiB;EACf;;GAEC,GACD,SAAS,gBAAgB,IAAI;EAE7B;;GAEC,GACD,QAAQ;;AAGV;;CAEC,GACD,iBAAiB;EACf,6CAA6C,GAC7C,OAAO;EAEP,sCAAsC,GACtC,KAAK;EAEL;;;;GAIC,GACD,OAAO,MAAM;EAEb;;;;;GAKC,GACD,OAAO,MAAM;EAEb;;GAEC,GACD,cAAc,OAAO;EAErB;;GAEC,GACD,WAAW,MAAM;EAEjB;;;GAGC,GACD,UAAU;EAEV,0DAA0D,GAC1D,SAAS;;AAGX;;;;;;CAMC,GACD,iBAAiB;EACf,4CAA4C,GAC5C,OAAO;EAEP,sCAAsC,GACtC,KAAK;EAEL;;GAEC,GACD,gBAAgB;EAEhB;;GAEC,GACD,cAAc,OAAO;EAErB;;;GAGC,GACD,UAAU,OAAO;EAEjB;;;;;GAKC,GACD,WAAW;EAEX;;;GAGC,GACD,QAAQ;EAER;;;GAGC,GACD,UAAU;EAEV,0DAA0D,GAC1D,SAAS;;AAGX;;;;;;;;;;;;;;;CAeC,GACD,YAAY,UAAU,MAAM,GAAG,IAAI,GAAG;AAEtC,iBAAiB;EACf,QAAQ,MAAM;EACd,MAAM;EACN,IAAI;;AAGN;;;;;CAKC,GACD,iBAAiB;EACf,MAAM,MAAM;EACZ,QAAQ,MAAM;;AAGhB;;CAEC,GACD,iBAAiB,yBAAyB;EACxC,8FAA8F,GAC9F,aAAa,MAAM;;AAGrB;;CAEC,GACD,YAAY,YAAY,gBAAgB;AAExC;;CAEC,GACD,iBAAiB;EACf,SAAS;EACT,UAAU;IAAQ,QAAQ;IAAU,KAAK;;;AAG3C;;CAEC,GACD,iBAAiB;EACf,SAAS;EACT,UAAU,MAAM,GAAG,IAAI;EACvB,UAAU,MAAM;EAChB,QAAQ,MAAM;EACd,SAAS,MAAM"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrome-devtools/source-map-scopes-codec",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "exports": "./src/mod.ts",
5
5
  "license": "BSD-3-Clause",
6
6
  "fmt": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsr/chrome-devtools__source-map-scopes-codec",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "homepage": "https://jsr.io/@chrome-devtools/source-map-scopes-codec",
5
5
  "type": "module",
6
6
  "dependencies": {},
@@ -8,7 +8,7 @@ import type {
8
8
  OriginalPosition,
9
9
  OriginalScope,
10
10
  ScopeInfo,
11
- } from "../scopes.d.ts";
11
+ } from "../scopes.ts";
12
12
 
13
13
  /**
14
14
  * Small utility class to build scope and range trees.
@@ -8,7 +8,7 @@ import type {
8
8
  OriginalScope,
9
9
  Position,
10
10
  ScopeInfo,
11
- } from "../scopes.d.ts";
11
+ } from "../scopes.ts";
12
12
  import { comparePositions } from "../util.js";
13
13
  import { ScopeInfoBuilder, type ScopeKey } from "./builder.js";
14
14
 
@@ -2,6 +2,7 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
  export var Tag = /*#__PURE__*/ function(Tag) {
5
+ Tag[Tag["EMPTY"] = 0] = "EMPTY";
5
6
  Tag[Tag["ORIGINAL_SCOPE_START"] = 1] = "ORIGINAL_SCOPE_START";
6
7
  Tag[Tag["ORIGINAL_SCOPE_END"] = 2] = "ORIGINAL_SCOPE_END";
7
8
  Tag[Tag["ORIGINAL_SCOPE_VARIABLES"] = 3] = "ORIGINAL_SCOPE_VARIABLES";
@@ -10,9 +11,11 @@ export var Tag = /*#__PURE__*/ function(Tag) {
10
11
  Tag[Tag["GENERATED_RANGE_BINDINGS"] = 6] = "GENERATED_RANGE_BINDINGS";
11
12
  Tag[Tag["GENERATED_RANGE_SUBRANGE_BINDING"] = 7] = "GENERATED_RANGE_SUBRANGE_BINDING";
12
13
  Tag[Tag["GENERATED_RANGE_CALL_SITE"] = 8] = "GENERATED_RANGE_CALL_SITE";
14
+ Tag[Tag["VENDOR_EXTENSION"] = 99] = "VENDOR_EXTENSION";
13
15
  return Tag;
14
16
  }({});
15
17
  export var EncodedTag = /*#__PURE__*/ function(EncodedTag) {
18
+ EncodedTag["EMPTY"] = "A";
16
19
  EncodedTag["ORIGINAL_SCOPE_START"] = "B";
17
20
  EncodedTag["ORIGINAL_SCOPE_END"] = "C";
18
21
  EncodedTag["ORIGINAL_SCOPE_VARIABLES"] = "D";
@@ -21,6 +24,7 @@ export var EncodedTag = /*#__PURE__*/ function(EncodedTag) {
21
24
  EncodedTag["GENERATED_RANGE_BINDINGS"] = "G";
22
25
  EncodedTag["GENERATED_RANGE_SUBRANGE_BINDING"] = "H";
23
26
  EncodedTag["GENERATED_RANGE_CALL_SITE"] = "I";
27
+ EncodedTag["VENDOR_EXTENSION"] = "/";
24
28
  return EncodedTag;
25
29
  }({});
26
30
  export var OriginalScopeFlags = /*#__PURE__*/ function(OriginalScopeFlags) {
@@ -1 +1 @@
1
- {"version":3,"file":"codec.js","sources":["./codec.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,IAAA,AAAW,6BAAA;;;;;;;;;SAAA;MASjB;AAED,OAAO,IAAA,AAAW,oCAAA;;;;;;;;;SAAA;MASjB;AAED,OAAO,IAAA,AAAW,4CAAA;;;;SAAA;MAIjB;AAED,OAAO,IAAA,AAAW,6CAAA;;;;;SAAA;MAKjB"}
1
+ {"version":3,"file":"codec.js","sources":["./codec.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,IAAA,AAAW,6BAAA;;;;;;;;;;;SAAA;MAWjB;AAED,OAAO,IAAA,AAAW,oCAAA;;;;;;;;;;;SAAA;MAWjB;AAED,OAAO,IAAA,AAAW,4CAAA;;;;SAAA;MAIjB;AAED,OAAO,IAAA,AAAW,6CAAA;;;;;SAAA;MAKjB"}
@@ -3,6 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  export const enum Tag {
6
+ EMPTY = 0x0,
6
7
  ORIGINAL_SCOPE_START = 0x1,
7
8
  ORIGINAL_SCOPE_END = 0x2,
8
9
  ORIGINAL_SCOPE_VARIABLES = 0x3,
@@ -11,9 +12,11 @@ export const enum Tag {
11
12
  GENERATED_RANGE_BINDINGS = 0x6,
12
13
  GENERATED_RANGE_SUBRANGE_BINDING = 0x7,
13
14
  GENERATED_RANGE_CALL_SITE = 0x8,
15
+ VENDOR_EXTENSION = 0x63,
14
16
  }
15
17
 
16
18
  export const enum EncodedTag {
19
+ EMPTY = "A", // 0x0
17
20
  ORIGINAL_SCOPE_START = "B", // 0x1
18
21
  ORIGINAL_SCOPE_END = "C", // 0x2
19
22
  ORIGINAL_SCOPE_VARIABLES = "D", // 0x3
@@ -22,6 +25,7 @@ export const enum EncodedTag {
22
25
  GENERATED_RANGE_BINDINGS = "G", // 0x6
23
26
  GENERATED_RANGE_SUBRANGE_BINDING = "H", // 0x7
24
27
  GENERATED_RANGE_CALL_SITE = "I", // 0x8
28
+ VENDOR_EXTENSION = "/", // 0x63
25
29
  }
26
30
 
27
31
  export const enum OriginalScopeFlags {