chrome-devtools-frontend 1.0.1626840 → 1.0.1629211
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.
- package/front_end/core/common/VersionController.ts +33 -1
- package/front_end/core/host/UserMetrics.ts +0 -3
- package/front_end/core/root/ExperimentNames.ts +0 -4
- package/front_end/core/sdk/CSSContainerQuery.ts +3 -1
- package/front_end/core/sdk/CSSModel.ts +23 -0
- package/front_end/core/sdk/DOMModel.ts +0 -5
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +2 -1
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +2 -4
- package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +3 -2
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +13 -0
- package/front_end/entrypoints/formatter_worker/Substitute.ts +1 -1
- package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +0 -2
- package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -2
- package/front_end/entrypoints/main/MainImpl.ts +0 -10
- package/front_end/generated/InspectorBackendCommands.ts +3 -3
- package/front_end/generated/protocol.ts +6 -0
- package/front_end/models/emulation/DeviceModeModel.ts +4 -0
- package/front_end/models/issues_manager/GenericIssue.ts +18 -1
- package/front_end/models/issues_manager/descriptions/genericBackUINavigationWouldSkipAd.md +4 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
- package/front_end/panels/common/common.ts +1 -1
- package/front_end/panels/common/freDialog.css +1 -0
- package/front_end/panels/console/ConsoleView.ts +2 -2
- package/front_end/panels/elements/StylePropertiesSection.ts +6 -2
- package/front_end/panels/elements/StylesSidebarPane.ts +9 -8
- package/front_end/panels/elements/elements-meta.ts +0 -25
- package/front_end/panels/elements/elements.ts +0 -3
- package/front_end/panels/emulation/DeviceModeToolbar.ts +346 -265
- package/front_end/panels/emulation/DeviceModeView.ts +2 -2
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +9 -4
- package/front_end/panels/profiler/ProfilesPanel.ts +7 -1
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +7 -6
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +29 -18
- package/front_end/panels/sources/sources-meta.ts +7 -0
- package/front_end/panels/timeline/TimelineController.ts +1 -2
- package/front_end/panels/timeline/TimelinePanel.ts +1 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +2 -10
- package/front_end/panels/timeline/timeline-meta.ts +26 -0
- package/front_end/third_party/acorn/README.chromium +1 -1
- package/front_end/third_party/acorn/acorn.ts +1 -1
- package/front_end/third_party/acorn/package/CHANGELOG.md +128 -0
- package/front_end/third_party/acorn/package/README.md +42 -19
- package/front_end/third_party/acorn/package/dist/acorn.d.mts +883 -26
- package/front_end/third_party/acorn/package/dist/acorn.d.ts +859 -268
- package/front_end/third_party/acorn/package/dist/acorn.js +420 -115
- package/front_end/third_party/acorn/package/dist/acorn.mjs +420 -115
- package/front_end/third_party/acorn/package/dist/bin.js +1 -1
- package/front_end/third_party/acorn/package/package.json +3 -3
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js +7 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +15 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/JSHandle.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts +2 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.js +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/IsolatedWorld.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/IsolatedWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +9 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +6 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ScreenRecorder.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +23 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +171 -149
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js +7 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +15 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/JSHandle.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts +2 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.js +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/IsolatedWorld.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/IsolatedWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +8 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js +8 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +6 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ScreenRecorder.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +23 -2
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +6 -7
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +4 -3
- package/front_end/third_party/puppeteer/package/src/api/Frame.ts +21 -1
- package/front_end/third_party/puppeteer/package/src/api/JSHandle.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +9 -4
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +2 -1
- package/front_end/third_party/puppeteer/package/src/cdp/ExecutionContext.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +9 -5
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/cdp/IsolatedWorld.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +19 -3
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +10 -1
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +7 -3
- package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/legacy/TabbedPane.ts +142 -16
- package/front_end/ui/legacy/TextPrompt.docs.ts +51 -0
- package/front_end/ui/legacy/TextPrompt.ts +55 -6
- package/front_end/ui/legacy/Toolbar.ts +2 -1
- package/front_end/ui/legacy/View.ts +2 -1
- package/front_end/ui/legacy/ViewManager.ts +11 -5
- package/front_end/ui/legacy/textPrompt.css +4 -0
- package/mcp/mcp.ts +1 -0
- package/package.json +1 -1
- package/front_end/panels/elements/NodeStackTraceWidget.ts +0 -76
- package/front_end/panels/elements/nodeStackTraceWidget.css +0 -11
|
@@ -124,7 +124,7 @@ export class DeviceModeView extends UI.Widget.VBox {
|
|
|
124
124
|
|
|
125
125
|
private createUI(): void {
|
|
126
126
|
this.toolbar = new DeviceModeToolbar(this.model, this.showMediaInspectorSetting, this.showRulersSetting);
|
|
127
|
-
this.
|
|
127
|
+
this.toolbar.show(this.contentElement);
|
|
128
128
|
this.contentClip = this.contentElement.createChild('div', 'device-mode-content-clip vbox');
|
|
129
129
|
this.responsivePresetsContainer = this.contentClip.createChild('div', 'device-mode-presets-container');
|
|
130
130
|
this.responsivePresetsContainer.setAttribute('jslog', `${VisualLogging.responsivePresets()}`);
|
|
@@ -358,7 +358,7 @@ export class DeviceModeView extends UI.Widget.VBox {
|
|
|
358
358
|
this.cachedScale = this.model.scale();
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
-
this.toolbar.
|
|
361
|
+
this.toolbar.requestUpdate();
|
|
362
362
|
this.loadImage(this.screenImage, this.model.screenImage());
|
|
363
363
|
this.loadImage(this.outlineImage, this.model.outlineImage());
|
|
364
364
|
this.mediaInspector.setAxisTransform(this.model.scale());
|
|
@@ -269,11 +269,13 @@ export class HeapSnapshotGridNode extends
|
|
|
269
269
|
const value = this.data[columnId];
|
|
270
270
|
const percentColumn = columnId + '-percent';
|
|
271
271
|
const percent = this.data[percentColumn];
|
|
272
|
+
const tooltipColumn = `${columnId}-tooltip`;
|
|
273
|
+
const tooltip = this.data[tooltipColumn];
|
|
272
274
|
if (percent) {
|
|
273
275
|
render(
|
|
274
276
|
html`
|
|
275
277
|
<div class="profile-multiple-values">
|
|
276
|
-
<span aria-hidden="true">${value}</span>
|
|
278
|
+
<span aria-hidden="true" title=${Directives.ifDefined(tooltip)}>${value}</span>
|
|
277
279
|
<span class="percent-column" aria-hidden="true">${percent}</span>
|
|
278
280
|
</div>`,
|
|
279
281
|
cell);
|
|
@@ -283,7 +285,7 @@ export class HeapSnapshotGridNode extends
|
|
|
283
285
|
render(
|
|
284
286
|
html`
|
|
285
287
|
<div>
|
|
286
|
-
<span>${value}</span>
|
|
288
|
+
<span title=${Directives.ifDefined(tooltip)}>${value}</span>
|
|
287
289
|
</div>`,
|
|
288
290
|
cell);
|
|
289
291
|
}
|
|
@@ -560,6 +562,8 @@ export abstract class HeapSnapshotGenericObjectNode extends HeapSnapshotGridNode
|
|
|
560
562
|
retainedSize: i18n.ByteUtilities.formatBytesToKb(this.retainedSize),
|
|
561
563
|
'shallowSize-percent': this.toPercentString(shallowSizePercent),
|
|
562
564
|
'retainedSize-percent': this.toPercentString(retainedSizePercent),
|
|
565
|
+
'shallowSize-tooltip': i18n.ByteUtilities.bytesToString(this.shallowSize),
|
|
566
|
+
'retainedSize-tooltip': i18n.ByteUtilities.bytesToString(this.retainedSize),
|
|
563
567
|
};
|
|
564
568
|
}
|
|
565
569
|
|
|
@@ -580,8 +584,7 @@ export abstract class HeapSnapshotGenericObjectNode extends HeapSnapshotGridNode
|
|
|
580
584
|
}
|
|
581
585
|
|
|
582
586
|
override createCell(columnId: string): HTMLElement {
|
|
583
|
-
|
|
584
|
-
return cell;
|
|
587
|
+
return columnId !== 'object' ? this.createValueCell(columnId) : this.createObjectCell();
|
|
585
588
|
}
|
|
586
589
|
|
|
587
590
|
createObjectCell(): HTMLElement {
|
|
@@ -1132,6 +1135,8 @@ export class HeapSnapshotConstructorNode extends HeapSnapshotGridNode {
|
|
|
1132
1135
|
retainedSize: i18n.ByteUtilities.formatBytesToKb(this.retainedSize),
|
|
1133
1136
|
'shallowSize-percent': this.toPercentString(shallowSizePercent),
|
|
1134
1137
|
'retainedSize-percent': this.toPercentString(retainedSizePercent),
|
|
1138
|
+
'shallowSize-tooltip': i18n.ByteUtilities.bytesToString(this.shallowSize),
|
|
1139
|
+
'retainedSize-tooltip': i18n.ByteUtilities.bytesToString(this.retainedSize),
|
|
1135
1140
|
};
|
|
1136
1141
|
}
|
|
1137
1142
|
|
|
@@ -37,6 +37,7 @@ import {createIcon} from '../../ui/kit/kit.js';
|
|
|
37
37
|
// eslint-disable-next-line @devtools/es-modules-import
|
|
38
38
|
import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
|
|
39
39
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
40
|
+
import {render} from '../../ui/lit/lit.js';
|
|
40
41
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
41
42
|
|
|
42
43
|
import {
|
|
@@ -473,7 +474,12 @@ export class ProfilesPanel extends UI.Panel.PanelWithSidebar implements DataDisp
|
|
|
473
474
|
this.profileViewToolbar.removeToolbarItems();
|
|
474
475
|
|
|
475
476
|
void (view as unknown as UI.View.View).toolbarItems().then(items => {
|
|
476
|
-
|
|
477
|
+
if (Array.isArray(items)) {
|
|
478
|
+
items.map(item => this.profileViewToolbar.appendToolbarItem(item));
|
|
479
|
+
} else {
|
|
480
|
+
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
481
|
+
render(items, this.profileViewToolbar);
|
|
482
|
+
}
|
|
477
483
|
});
|
|
478
484
|
|
|
479
485
|
return view;
|
|
@@ -23,7 +23,7 @@ export class AiCodeCompletionPlugin extends Plugin {
|
|
|
23
23
|
#aiCodeCompletionDisclaimer?: PanelCommon.AiCodeCompletionDisclaimer;
|
|
24
24
|
#aiCodeCompletionDisclaimerContainer = document.createElement('div');
|
|
25
25
|
#aiCodeCompletionDisclaimerToolbarItem = new UI.Toolbar.ToolbarItem(this.#aiCodeCompletionDisclaimerContainer);
|
|
26
|
-
#aiCodeCompletionCitationsToolbar?: PanelCommon.AiCodeCompletionSummaryToolbar;
|
|
26
|
+
#aiCodeCompletionCitationsToolbar?: PanelCommon.AiCodeCompletionSummaryToolbar.AiCodeCompletionSummaryToolbar;
|
|
27
27
|
#aiCodeCompletionCitationsToolbarContainer = document.createElement('div');
|
|
28
28
|
#aiCodeCompletionCitationsToolbarAttached = false;
|
|
29
29
|
aiCodeCompletionConfig: TextEditor.AiCodeCompletionProvider.AiCodeCompletionConfig;
|
|
@@ -113,11 +113,12 @@ export class AiCodeCompletionPlugin extends Plugin {
|
|
|
113
113
|
if (this.#aiCodeCompletionCitationsToolbar) {
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
this.#aiCodeCompletionCitationsToolbar =
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
this.#aiCodeCompletionCitationsToolbar =
|
|
117
|
+
new PanelCommon.AiCodeCompletionSummaryToolbar.AiCodeCompletionSummaryToolbar({
|
|
118
|
+
citationsTooltipId: CITATIONS_TOOLTIP_ID,
|
|
119
|
+
hasTopBorder: true,
|
|
120
|
+
panel: AiCodeCompletion.AiCodeCompletion.ContextFlavor.SOURCES
|
|
121
|
+
});
|
|
121
122
|
this.#aiCodeCompletionCitationsToolbar.show(this.#aiCodeCompletionCitationsToolbarContainer, undefined, true);
|
|
122
123
|
}
|
|
123
124
|
|
|
@@ -49,7 +49,7 @@ import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
|
|
|
49
49
|
import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
|
|
50
50
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
51
51
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
52
|
-
import {Directives, html, render} from '../../ui/lit/lit.js';
|
|
52
|
+
import {Directives, html, render, type TemplateResult} from '../../ui/lit/lit.js';
|
|
53
53
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
54
54
|
|
|
55
55
|
import {UISourceCodeFrame} from './UISourceCodeFrame.js';
|
|
@@ -179,8 +179,6 @@ export class WatchExpressionsSidebarPane extends UI.Widget.VBox implements UI.Ac
|
|
|
179
179
|
UI.Toolbar.ItemsProvider {
|
|
180
180
|
#watchExpressions: WatchExpression[];
|
|
181
181
|
#watchExpressionsSetting: Common.Settings.Setting<string[]>;
|
|
182
|
-
private readonly addButton: UI.Toolbar.ToolbarButton;
|
|
183
|
-
private readonly refreshButton: UI.Toolbar.ToolbarButton;
|
|
184
182
|
private readonly linkifier: Components.Linkifier.Linkifier;
|
|
185
183
|
#view: View;
|
|
186
184
|
#expandControllers = new Map<string, ObjectUI.ObjectPropertiesSection.ObjectTreeExpansionTracker>();
|
|
@@ -192,17 +190,6 @@ export class WatchExpressionsSidebarPane extends UI.Widget.VBox implements UI.Ac
|
|
|
192
190
|
this.#watchExpressionsSetting =
|
|
193
191
|
Common.Settings.Settings.instance().createLocalSetting<string[]>('watch-expressions', []);
|
|
194
192
|
|
|
195
|
-
this.addButton = new UI.Toolbar.ToolbarButton(
|
|
196
|
-
i18nString(UIStrings.addWatchExpression), 'plus', undefined, 'add-watch-expression');
|
|
197
|
-
this.addButton.setSize(Buttons.Button.Size.SMALL);
|
|
198
|
-
this.addButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, _event => {
|
|
199
|
-
void this.addButtonClicked();
|
|
200
|
-
});
|
|
201
|
-
this.refreshButton = new UI.Toolbar.ToolbarButton(
|
|
202
|
-
i18nString(UIStrings.refreshWatchExpressions), 'refresh', undefined, 'refresh-watch-expressions');
|
|
203
|
-
this.refreshButton.setSize(Buttons.Button.Size.SMALL);
|
|
204
|
-
this.refreshButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, this.#refreshExpressions, this);
|
|
205
|
-
|
|
206
193
|
UI.Context.Context.instance().addFlavorChangeListener(
|
|
207
194
|
SDK.RuntimeModel.ExecutionContext, this.#refreshExpressions, this);
|
|
208
195
|
UI.Context.Context.instance().addFlavorChangeListener(
|
|
@@ -223,8 +210,27 @@ export class WatchExpressionsSidebarPane extends UI.Widget.VBox implements UI.Ac
|
|
|
223
210
|
return this.#watchExpressions;
|
|
224
211
|
}
|
|
225
212
|
|
|
226
|
-
toolbarItems():
|
|
227
|
-
|
|
213
|
+
toolbarItems(): TemplateResult {
|
|
214
|
+
// clang-format off
|
|
215
|
+
return html`
|
|
216
|
+
<devtools-button .data=${{
|
|
217
|
+
variant: Buttons.Button.Variant.TOOLBAR,
|
|
218
|
+
iconName: 'plus',
|
|
219
|
+
size: Buttons.Button.Size.SMALL,
|
|
220
|
+
title: i18nString(UIStrings.addWatchExpression),
|
|
221
|
+
jslogContext: 'add-watch-expression',
|
|
222
|
+
} as Buttons.Button.ButtonData}
|
|
223
|
+
@click=${(e: Event) => this.addButtonClicked(e)}></devtools-button>
|
|
224
|
+
<devtools-button .data=${{
|
|
225
|
+
variant: Buttons.Button.Variant.TOOLBAR,
|
|
226
|
+
iconName: 'refresh',
|
|
227
|
+
size: Buttons.Button.Size.SMALL,
|
|
228
|
+
title: i18nString(UIStrings.refreshWatchExpressions),
|
|
229
|
+
jslogContext: 'refresh-watch-expressions',
|
|
230
|
+
} as Buttons.Button.ButtonData}
|
|
231
|
+
@click=${(e: Event) => this.refreshButtonClicked(e)}></devtools-button>
|
|
232
|
+
`;
|
|
233
|
+
// clang-format on
|
|
228
234
|
}
|
|
229
235
|
|
|
230
236
|
private saveExpressions(): void {
|
|
@@ -239,7 +245,8 @@ export class WatchExpressionsSidebarPane extends UI.Widget.VBox implements UI.Ac
|
|
|
239
245
|
this.#watchExpressionsSetting.set(toSave);
|
|
240
246
|
}
|
|
241
247
|
|
|
242
|
-
private async addButtonClicked(): Promise<void> {
|
|
248
|
+
private async addButtonClicked(event?: Event): Promise<void> {
|
|
249
|
+
event?.consume(true);
|
|
243
250
|
await UI.ViewManager.ViewManager.instance().showView('sources.watch');
|
|
244
251
|
const watchExpression = this.createWatchExpression(null);
|
|
245
252
|
this.requestUpdate();
|
|
@@ -250,6 +257,11 @@ export class WatchExpressionsSidebarPane extends UI.Widget.VBox implements UI.Ac
|
|
|
250
257
|
watchExpression.startEditing();
|
|
251
258
|
}
|
|
252
259
|
|
|
260
|
+
private refreshButtonClicked(event: Event): void {
|
|
261
|
+
event.consume(true);
|
|
262
|
+
this.#refreshExpressions();
|
|
263
|
+
}
|
|
264
|
+
|
|
253
265
|
#refreshExpressions(): void {
|
|
254
266
|
this.linkifier.reset();
|
|
255
267
|
for (const expression of this.#watchExpressions) {
|
|
@@ -407,7 +419,6 @@ export class WatchExpression extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
407
419
|
get result(): SDK.RemoteObject.RemoteObject|null {
|
|
408
420
|
return this.#result ?? null;
|
|
409
421
|
}
|
|
410
|
-
|
|
411
422
|
get updateComplete(): Promise<void> {
|
|
412
423
|
return this.#updateComplete;
|
|
413
424
|
}
|
|
@@ -1076,6 +1076,13 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
1076
1076
|
UI.ActionRegistration.KeybindSet.VS_CODE,
|
|
1077
1077
|
],
|
|
1078
1078
|
},
|
|
1079
|
+
{
|
|
1080
|
+
shortcut: 'Alt+g',
|
|
1081
|
+
keybindSets: [
|
|
1082
|
+
UI.ActionRegistration.KeybindSet.DEVTOOLS_DEFAULT,
|
|
1083
|
+
UI.ActionRegistration.KeybindSet.VS_CODE,
|
|
1084
|
+
],
|
|
1085
|
+
},
|
|
1079
1086
|
],
|
|
1080
1087
|
});
|
|
1081
1088
|
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
7
|
import type * as Platform from '../../core/platform/platform.js';
|
|
8
|
-
import * as Root from '../../core/root/root.js';
|
|
9
8
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
10
9
|
import type * as Protocol from '../../generated/protocol.js';
|
|
11
10
|
import * as CrUXManager from '../../models/crux-manager/crux-manager.js';
|
|
@@ -254,7 +253,7 @@ export class TimelineController implements Tracing.TracingManager.TracingManager
|
|
|
254
253
|
if (options.enableJSSampling) {
|
|
255
254
|
categoriesArray.push(disabledByDefault('v8.cpu_profiler'));
|
|
256
255
|
}
|
|
257
|
-
if (
|
|
256
|
+
if (Common.Settings.Settings.instance().moduleSetting('timeline-invalidation-tracking').get() as boolean) {
|
|
258
257
|
categoriesArray.push(disabledByDefault('devtools.timeline.invalidationTracking'));
|
|
259
258
|
}
|
|
260
259
|
if (options.capturePictures) {
|
|
@@ -740,7 +740,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
|
740
740
|
#instantiateNewModel(): Trace.TraceModel.Model {
|
|
741
741
|
const config = Trace.Types.Configuration.defaults();
|
|
742
742
|
config.showAllEvents = Common.Settings.Settings.instance().moduleSetting('timeline-show-all-events').get();
|
|
743
|
-
config.debugMode =
|
|
743
|
+
config.debugMode = Common.Settings.Settings.instance().moduleSetting('timeline-debug-mode').get() as boolean;
|
|
744
744
|
|
|
745
745
|
const traceEngineModel = Trace.TraceModel.Model.createWithAllHandlers(config);
|
|
746
746
|
|
|
@@ -497,16 +497,8 @@ type TimeRangeCategoryStats = Record<string, number>;
|
|
|
497
497
|
const {SamplesIntegrator} = Trace.Helpers.SamplesIntegrator;
|
|
498
498
|
|
|
499
499
|
export class TimelineUIUtils {
|
|
500
|
-
/**
|
|
501
|
-
* use getGetDebugModeEnabled() to query this variable.
|
|
502
|
-
*/
|
|
503
|
-
static debugModeEnabled: boolean|undefined = undefined;
|
|
504
500
|
static getGetDebugModeEnabled(): boolean {
|
|
505
|
-
|
|
506
|
-
TimelineUIUtils.debugModeEnabled =
|
|
507
|
-
Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.TIMELINE_DEBUG_MODE);
|
|
508
|
-
}
|
|
509
|
-
return TimelineUIUtils.debugModeEnabled;
|
|
501
|
+
return Common.Settings.Settings.instance().moduleSetting('timeline-debug-mode').get() as boolean;
|
|
510
502
|
}
|
|
511
503
|
static frameDisplayName(frame: Protocol.Runtime.CallFrame): string {
|
|
512
504
|
const maybeResolvedData = SourceMapsResolver.SourceMapsResolver.resolvedCodeLocationForCallFrame(frame);
|
|
@@ -1527,7 +1519,7 @@ export class TimelineUIUtils {
|
|
|
1527
1519
|
await TimelineUIUtils.generateCauses(event, contentHelper, parsedTrace);
|
|
1528
1520
|
}
|
|
1529
1521
|
|
|
1530
|
-
if (
|
|
1522
|
+
if (TimelineUIUtils.getGetDebugModeEnabled()) {
|
|
1531
1523
|
TimelineUIUtils.renderEventJson(event, contentHelper);
|
|
1532
1524
|
}
|
|
1533
1525
|
|
|
@@ -66,6 +66,14 @@ const UIStrings = {
|
|
|
66
66
|
* @description Title of a setting under the Performance category in Settings
|
|
67
67
|
*/
|
|
68
68
|
timelineShowAllEvents: 'Show all events',
|
|
69
|
+
/**
|
|
70
|
+
* @description Title of a setting under the Performance category in Settings
|
|
71
|
+
*/
|
|
72
|
+
timelineDebugMode: 'Timeline debug mode (trace event details, etc.)',
|
|
73
|
+
/**
|
|
74
|
+
* @description Title of a setting under the Performance category in Settings
|
|
75
|
+
*/
|
|
76
|
+
timelineInvalidationTracking: 'Invalidation tracking',
|
|
69
77
|
} as const;
|
|
70
78
|
const str_ = i18n.i18n.registerUIStrings('panels/timeline/timeline-meta.ts', UIStrings);
|
|
71
79
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
@@ -327,6 +335,24 @@ Common.Settings.registerSettingExtension({
|
|
|
327
335
|
defaultValue: false,
|
|
328
336
|
});
|
|
329
337
|
|
|
338
|
+
Common.Settings.registerSettingExtension({
|
|
339
|
+
category: Common.Settings.SettingCategory.PERFORMANCE,
|
|
340
|
+
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
341
|
+
title: i18nLazyString(UIStrings.timelineDebugMode),
|
|
342
|
+
settingName: 'timeline-debug-mode',
|
|
343
|
+
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
344
|
+
defaultValue: false,
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
Common.Settings.registerSettingExtension({
|
|
348
|
+
category: Common.Settings.SettingCategory.PERFORMANCE,
|
|
349
|
+
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
350
|
+
title: i18nLazyString(UIStrings.timelineInvalidationTracking),
|
|
351
|
+
settingName: 'timeline-invalidation-tracking',
|
|
352
|
+
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
353
|
+
defaultValue: false,
|
|
354
|
+
});
|
|
355
|
+
|
|
330
356
|
// IMPORTANT: if you are updating this, you should also update the setting in
|
|
331
357
|
// js_timeline-meta.
|
|
332
358
|
Common.Settings.registerSettingExtension({
|
|
@@ -7,7 +7,7 @@ import * as acorn from './package/dist/acorn.mjs';
|
|
|
7
7
|
import type * as ESTree from './estree-legacy.js';
|
|
8
8
|
export {ESTree};
|
|
9
9
|
|
|
10
|
-
export { type Comment, defaultOptions, getLineInfo,
|
|
10
|
+
export { type Comment, defaultOptions, getLineInfo, Node, SourceLocation, Token, tokTypes} from './package/dist/acorn.mjs';
|
|
11
11
|
|
|
12
12
|
export const Parser = acorn.Parser;
|
|
13
13
|
export const tokenizer = acorn.Parser.tokenizer.bind(acorn.Parser);
|
|
@@ -1,3 +1,131 @@
|
|
|
1
|
+
## 8.16.0 (2026-02-19)
|
|
2
|
+
|
|
3
|
+
### New features
|
|
4
|
+
|
|
5
|
+
The `sourceType` option can now be set to `"commonjs"` to have the parser treat the top level scope as a function scope.
|
|
6
|
+
|
|
7
|
+
Add support for Unicode 17.
|
|
8
|
+
|
|
9
|
+
### Bug fixes
|
|
10
|
+
|
|
11
|
+
Don't recognize `await using` as contextual keywords when followed directly by a backslash.
|
|
12
|
+
|
|
13
|
+
Fix an issue where the parser would allow `return` statements in `static` blocks when `allowReturnOutsideFunction` was enabled.
|
|
14
|
+
|
|
15
|
+
Properly reject `using` declarations that appear directly in `switch` or `for` head scopes.
|
|
16
|
+
|
|
17
|
+
Fix some corner case issues in the recognition of `using` syntax.
|
|
18
|
+
|
|
19
|
+
## 8.15.0 (2025-06-08)
|
|
20
|
+
|
|
21
|
+
### New features
|
|
22
|
+
|
|
23
|
+
Support `using` and `await using` syntax.
|
|
24
|
+
|
|
25
|
+
The `AnyNode` type is now defined in such a way that plugins can extend it.
|
|
26
|
+
|
|
27
|
+
### Bug fixes
|
|
28
|
+
|
|
29
|
+
Fix an issue where the `bigint` property of literal nodes for non-decimal bigints had the wrong format.
|
|
30
|
+
|
|
31
|
+
The `acorn` CLI tool no longer crashes when emitting a tree that contains a bigint.
|
|
32
|
+
|
|
33
|
+
## 8.14.1 (2025-03-05)
|
|
34
|
+
|
|
35
|
+
### Bug fixes
|
|
36
|
+
|
|
37
|
+
Fix an issue where `await` expressions in class field initializers were inappropriately allowed.
|
|
38
|
+
|
|
39
|
+
Properly allow await inside an async arrow function inside a class field initializer.
|
|
40
|
+
|
|
41
|
+
Mention the source file name in syntax error messages when given.
|
|
42
|
+
|
|
43
|
+
Properly add an empty `attributes` property to every form of `ExportNamedDeclaration`.
|
|
44
|
+
|
|
45
|
+
## 8.14.0 (2024-10-27)
|
|
46
|
+
|
|
47
|
+
### New features
|
|
48
|
+
|
|
49
|
+
Support ES2025 import attributes.
|
|
50
|
+
|
|
51
|
+
Support ES2025 RegExp modifiers.
|
|
52
|
+
|
|
53
|
+
### Bug fixes
|
|
54
|
+
|
|
55
|
+
Support some missing Unicode properties.
|
|
56
|
+
|
|
57
|
+
## 8.13.0 (2024-10-16)
|
|
58
|
+
|
|
59
|
+
### New features
|
|
60
|
+
|
|
61
|
+
Upgrade to Unicode 16.0.
|
|
62
|
+
|
|
63
|
+
## 8.12.1 (2024-07-03)
|
|
64
|
+
|
|
65
|
+
### Bug fixes
|
|
66
|
+
|
|
67
|
+
Fix a regression that caused Acorn to no longer run on Node versions <8.10.
|
|
68
|
+
|
|
69
|
+
## 8.12.0 (2024-06-14)
|
|
70
|
+
|
|
71
|
+
### New features
|
|
72
|
+
|
|
73
|
+
Support ES2025 duplicate capture group names in regular expressions.
|
|
74
|
+
|
|
75
|
+
### Bug fixes
|
|
76
|
+
|
|
77
|
+
Include `VariableDeclarator` in the `AnyNode` type so that walker objects can refer to it without getting a type error.
|
|
78
|
+
|
|
79
|
+
Properly raise a parse error for invalid `for`/`of` statements using `async` as binding name.
|
|
80
|
+
|
|
81
|
+
Properly recognize \"use strict\" when preceded by a string with an escaped newline.
|
|
82
|
+
|
|
83
|
+
Mark the `Parser` constructor as protected, not private, so plugins can extend it without type errors.
|
|
84
|
+
|
|
85
|
+
Fix a bug where some invalid `delete` expressions were let through when the operand was parenthesized and `preserveParens` was enabled.
|
|
86
|
+
|
|
87
|
+
Properly normalize line endings in raw strings of invalid template tokens.
|
|
88
|
+
|
|
89
|
+
Properly track line numbers for escaped newlines in strings.
|
|
90
|
+
|
|
91
|
+
Fix a bug that broke line number accounting after a template literal with invalid escape sequences.
|
|
92
|
+
|
|
93
|
+
## 8.11.3 (2023-12-29)
|
|
94
|
+
|
|
95
|
+
### Bug fixes
|
|
96
|
+
|
|
97
|
+
Add `Function` and `Class` to the `AggregateType` type, so that they can be used in walkers without raising a type error.
|
|
98
|
+
|
|
99
|
+
Make sure `onToken` get an `import` keyword token when parsing `import.meta`.
|
|
100
|
+
|
|
101
|
+
Fix a bug where `.loc.start` could be undefined for `new.target` `meta` nodes.
|
|
102
|
+
|
|
103
|
+
## 8.11.2 (2023-10-27)
|
|
104
|
+
|
|
105
|
+
### Bug fixes
|
|
106
|
+
|
|
107
|
+
Fix a bug that caused regular expressions after colon tokens to not be properly tokenized in some circumstances.
|
|
108
|
+
|
|
109
|
+
## 8.11.1 (2023-10-26)
|
|
110
|
+
|
|
111
|
+
### Bug fixes
|
|
112
|
+
|
|
113
|
+
Fix a regression where `onToken` would receive 'name' tokens for 'new' keyword tokens.
|
|
114
|
+
|
|
115
|
+
## 8.11.0 (2023-10-26)
|
|
116
|
+
|
|
117
|
+
### Bug fixes
|
|
118
|
+
|
|
119
|
+
Fix an issue where tokenizing (without parsing) an object literal with a property named `class` or `function` could, in some circumstance, put the tokenizer into an invalid state.
|
|
120
|
+
|
|
121
|
+
Fix an issue where a slash after a call to a propery named the same as some keywords would be tokenized as a regular expression.
|
|
122
|
+
|
|
123
|
+
### New features
|
|
124
|
+
|
|
125
|
+
Upgrade to Unicode 15.1.
|
|
126
|
+
|
|
127
|
+
Use a set of new, much more precise, TypeScript types.
|
|
128
|
+
|
|
1
129
|
## 8.10.0 (2023-07-05)
|
|
2
130
|
|
|
3
131
|
### New features
|
|
@@ -9,9 +9,7 @@ Acorn is open source software released under an
|
|
|
9
9
|
|
|
10
10
|
You are welcome to
|
|
11
11
|
[report bugs](https://github.com/acornjs/acorn/issues) or create pull
|
|
12
|
-
requests on [github](https://github.com/acornjs/acorn).
|
|
13
|
-
and discussion, please use the
|
|
14
|
-
[Tern discussion forum](https://discuss.ternjs.net).
|
|
12
|
+
requests on [github](https://github.com/acornjs/acorn).
|
|
15
13
|
|
|
16
14
|
## Installation
|
|
17
15
|
|
|
@@ -28,6 +26,24 @@ git clone https://github.com/acornjs/acorn.git
|
|
|
28
26
|
cd acorn
|
|
29
27
|
npm install
|
|
30
28
|
```
|
|
29
|
+
## Importing acorn
|
|
30
|
+
|
|
31
|
+
ESM as well as CommonJS is supported for all 3: `acorn`, `acorn-walk` and `acorn-loose`.
|
|
32
|
+
|
|
33
|
+
ESM example for `acorn`:
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
import * as acorn from "acorn"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
CommonJS example for `acorn`:
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
let acorn = require("acorn")
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
ESM is preferred, as it allows better editor auto-completions by offering TypeScript support.
|
|
46
|
+
For this reason, following examples will use ESM imports.
|
|
31
47
|
|
|
32
48
|
## Interface
|
|
33
49
|
|
|
@@ -38,8 +54,8 @@ syntax tree object as specified by the [ESTree
|
|
|
38
54
|
spec](https://github.com/estree/estree).
|
|
39
55
|
|
|
40
56
|
```javascript
|
|
41
|
-
|
|
42
|
-
console.log(acorn.parse("1 + 1", {ecmaVersion: 2020}))
|
|
57
|
+
import * as acorn from "acorn"
|
|
58
|
+
console.log(acorn.parse("1 + 1", {ecmaVersion: 2020}))
|
|
43
59
|
```
|
|
44
60
|
|
|
45
61
|
When encountering a syntax error, the parser will raise a
|
|
@@ -52,23 +68,23 @@ Options are provided by in a second argument, which should be an
|
|
|
52
68
|
object containing any of these fields (only `ecmaVersion` is
|
|
53
69
|
required):
|
|
54
70
|
|
|
55
|
-
- **ecmaVersion**: Indicates the ECMAScript version to parse.
|
|
56
|
-
either
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
features.
|
|
71
|
+
- **ecmaVersion**: Indicates the ECMAScript version to parse. Can be a
|
|
72
|
+
number, either in year (`2022`) or plain version number (`6`) form,
|
|
73
|
+
or `"latest"` (the latest the library supports). This influences
|
|
74
|
+
support for strict mode, the set of reserved words, and support for
|
|
75
|
+
new syntax features.
|
|
61
76
|
|
|
62
77
|
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
|
|
63
78
|
implemented by Acorn. Other proposed new features must be
|
|
64
79
|
implemented through plugins.
|
|
65
80
|
|
|
66
81
|
- **sourceType**: Indicate the mode the code should be parsed in. Can be
|
|
67
|
-
either `"script"` or `"
|
|
82
|
+
either `"script"`, `"module"` or `"commonjs"`. This influences global strict mode
|
|
68
83
|
and parsing of `import` and `export` declarations.
|
|
69
84
|
|
|
70
85
|
**NOTE**: If set to `"module"`, then static `import` / `export` syntax
|
|
71
|
-
will be valid, even if `ecmaVersion` is less than 6.
|
|
86
|
+
will be valid, even if `ecmaVersion` is less than 6. If set to `"commonjs"`,
|
|
87
|
+
it is the same as `"script"` except that the top-level scope behaves like a function.
|
|
72
88
|
|
|
73
89
|
- **onInsertedSemicolon**: If given a callback, that callback will be
|
|
74
90
|
called whenever a missing semicolon is inserted by the parser. The
|
|
@@ -100,7 +116,7 @@ required):
|
|
|
100
116
|
for `ecmaVersion` 2022 and later, `false` for lower versions.
|
|
101
117
|
Setting this option to `true` allows to have top-level `await`
|
|
102
118
|
expressions. They are still not allowed in non-`async` functions,
|
|
103
|
-
though.
|
|
119
|
+
though. Setting this option to `true` is not allowed when `sourceType: "commonjs"`.
|
|
104
120
|
|
|
105
121
|
- **allowSuperOutsideMethod**: By default, `super` outside a method
|
|
106
122
|
raises an error. Set this to `true` to accept such code.
|
|
@@ -204,6 +220,13 @@ option is enabled). When the token's type is `tokTypes.eof`, you
|
|
|
204
220
|
should stop calling the method, since it will keep returning that same
|
|
205
221
|
token forever.
|
|
206
222
|
|
|
223
|
+
Note that tokenizing JavaScript without parsing it is, in modern
|
|
224
|
+
versions of the language, not really possible due to the way syntax is
|
|
225
|
+
overloaded in ways that can only be disambiguated by the parse
|
|
226
|
+
context. This package applies a bunch of heuristics to try and do a
|
|
227
|
+
reasonable job, but you are advised to use `parse` with the `onToken`
|
|
228
|
+
option instead of this.
|
|
229
|
+
|
|
207
230
|
In ES6 environment, returned result can be used as any other
|
|
208
231
|
protocol-compliant iterable:
|
|
209
232
|
|
|
@@ -213,7 +236,7 @@ for (let token of acorn.tokenizer(str)) {
|
|
|
213
236
|
}
|
|
214
237
|
|
|
215
238
|
// transform code to array of tokens:
|
|
216
|
-
var tokens = [...acorn.tokenizer(str)]
|
|
239
|
+
var tokens = [...acorn.tokenizer(str)]
|
|
217
240
|
```
|
|
218
241
|
|
|
219
242
|
**tokTypes** holds an object mapping names to the token type objects
|
|
@@ -234,10 +257,10 @@ on the extended version of the class. To extend a parser with plugins,
|
|
|
234
257
|
you can use its static `extend` method.
|
|
235
258
|
|
|
236
259
|
```javascript
|
|
237
|
-
var acorn = require("acorn")
|
|
238
|
-
var jsx = require("acorn-jsx")
|
|
239
|
-
var JSXParser = acorn.Parser.extend(jsx())
|
|
240
|
-
JSXParser.parse("foo(<bar/>)", {ecmaVersion: 2020})
|
|
260
|
+
var acorn = require("acorn")
|
|
261
|
+
var jsx = require("acorn-jsx")
|
|
262
|
+
var JSXParser = acorn.Parser.extend(jsx())
|
|
263
|
+
JSXParser.parse("foo(<bar/>)", {ecmaVersion: 2020})
|
|
241
264
|
```
|
|
242
265
|
|
|
243
266
|
The `extend` method takes any number of plugin values, and returns a
|