chrome-devtools-frontend 1.0.1548980 → 1.0.1549484
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/docs/contributing/settings-experiments-features.md +35 -0
- package/docs/styleguide/ux/patterns.md +27 -0
- package/eslint.config.mjs +1 -0
- package/front_end/Tests.js +2 -0
- package/front_end/core/host/InspectorFrontendHost.ts +26 -558
- package/front_end/core/host/InspectorFrontendHostAPI.ts +6 -3
- package/front_end/core/host/InspectorFrontendHostStub.ts +558 -0
- package/front_end/core/host/ResourceLoader.ts +9 -23
- package/front_end/core/host/UserMetrics.ts +4 -4
- package/front_end/core/root/DevToolsContext.ts +4 -0
- package/front_end/core/root/Runtime.ts +10 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +2 -2
- package/front_end/core/sdk/CSSModel.ts +24 -24
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +11 -11
- package/front_end/core/sdk/CSSQuery.ts +1 -1
- package/front_end/core/sdk/CSSRule.ts +2 -2
- package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +3 -0
- package/front_end/core/sdk/NetworkManager.ts +29 -31
- package/front_end/core/sdk/NetworkRequest.ts +4 -0
- package/front_end/core/sdk/OverlayModel.ts +2 -2
- package/front_end/core/sdk/PageResourceLoader.ts +63 -37
- package/front_end/core/sdk/SourceMap.ts +6 -0
- package/front_end/core/sdk/SourceMapCache.ts +21 -0
- package/front_end/core/sdk/SourceMapManager.ts +7 -6
- package/front_end/core/sdk/SourceMapScopesInfo.ts +6 -2
- package/front_end/core/sdk/TargetManager.ts +14 -2
- package/front_end/core/sdk/sdk-meta.ts +13 -0
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +1 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +13 -3
- package/front_end/foundation/Universe.ts +1 -1
- package/front_end/generated/Deprecation.ts +18 -4
- package/front_end/generated/InspectorBackendCommands.ts +33 -31
- package/front_end/generated/SupportedCSSProperties.js +41 -41
- package/front_end/generated/protocol-mapping.d.ts +12 -0
- package/front_end/generated/protocol-proxy-api.d.ts +11 -0
- package/front_end/generated/protocol.ts +70 -35
- package/front_end/models/ai_assistance/AiConversation.ts +5 -4
- package/front_end/models/ai_assistance/ChangeManager.ts +4 -4
- package/front_end/models/ai_assistance/ConversationHandler.ts +0 -15
- package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -6
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +135 -3
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +24 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +43 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +19 -0
- package/front_end/models/bindings/ResourceMapping.ts +73 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +50 -0
- package/front_end/models/issues_manager/GenericIssue.ts +17 -0
- package/front_end/models/issues_manager/descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +7 -3
- package/front_end/models/source_map_scopes/FunctionCodeResolver.snapshot.txt +98 -0
- package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +270 -0
- package/front_end/models/source_map_scopes/source_map_scopes.ts +2 -0
- package/front_end/models/workspace/UISourceCode.ts +51 -44
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +76 -34
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +23 -11
- package/front_end/panels/application/AppManifestView.ts +3 -2
- package/front_end/panels/application/FrameDetailsView.ts +5 -6
- package/front_end/panels/application/ServiceWorkersView.ts +2 -2
- package/front_end/panels/application/TrustTokensTreeElement.ts +2 -6
- package/front_end/panels/application/components/PermissionsPolicySection.ts +201 -157
- package/front_end/panels/application/components/ProtocolHandlersView.ts +117 -80
- package/front_end/panels/application/components/ServiceWorkerRouterView.ts +47 -41
- package/front_end/panels/application/components/StorageMetadataView.ts +31 -34
- package/front_end/panels/application/components/TrustTokensView.ts +76 -68
- package/front_end/panels/console/ConsoleView.ts +3 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +6 -4
- package/front_end/panels/console/console-meta.ts +0 -13
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +3 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +7 -7
- package/front_end/panels/elements/CSSRuleValidatorHelper.ts +2 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +16 -13
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -1
- package/front_end/panels/elements/LayoutPane.ts +12 -10
- package/front_end/panels/elements/StylePropertyTreeElement.ts +12 -12
- package/front_end/panels/elements/components/AdornerManager.ts +3 -3
- package/front_end/panels/elements/components/StylePropertyEditor.ts +6 -6
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +27 -49
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +15 -11
- package/front_end/panels/media/PlayerListView.ts +100 -73
- package/front_end/panels/media/playerListView.css +5 -0
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +3 -3
- package/front_end/panels/network/RequestConditionsDrawer.ts +5 -5
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +17 -0
- package/front_end/panels/network/resourceChunkView.css +4 -0
- package/front_end/panels/security/CookieControlsView.ts +1 -1
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
- package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +6 -6
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +1 -1
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +4 -2
- package/front_end/panels/sources/CSSPlugin.ts +1 -1
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +13 -5
- package/front_end/panels/sources/GoToLineQuickOpen.ts +4 -2
- package/front_end/panels/sources/NavigatorView.ts +2 -2
- package/front_end/panels/sources/OpenFileQuickOpen.ts +7 -8
- package/front_end/panels/sources/OutlineQuickOpen.ts +6 -3
- package/front_end/panels/sources/ProfilePlugin.ts +21 -12
- package/front_end/panels/sources/UISourceCodeFrame.ts +0 -1
- package/front_end/panels/sources/filteredUISourceCodeListProvider.css +41 -0
- package/front_end/panels/timeline/TimelinePanel.ts +17 -18
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +3 -3
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
- package/front_end/panels/timeline/docs/flame_chart_migration.md +11 -16
- package/front_end/panels/utils/utils.ts +17 -3
- package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -20
- package/front_end/panels/whats_new/resources/WNDT.md +8 -8
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/third_party/mitt/README.chromium +1 -0
- package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -0
- package/front_end/third_party/puppeteer/third_party/rxjs/README.chromium +1 -0
- package/front_end/ui/components/adorners/Adorner.ts +1 -1
- package/front_end/ui/components/annotations/AnnotationRepository.ts +98 -0
- package/front_end/ui/components/annotations/AnnotationType.ts +10 -0
- package/front_end/ui/components/annotations/annotations.ts +6 -0
- package/front_end/ui/components/buttons/Button.ts +1 -1
- package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
- package/front_end/ui/components/chrome_link/ChromeLink.ts +1 -1
- package/front_end/ui/components/dialogs/ButtonDialog.ts +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/dialogs/ShortcutDialog.ts +1 -0
- package/front_end/ui/components/diff_view/DiffView.ts +1 -1
- package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightElement.ts +1 -0
- package/front_end/ui/components/highlighting/MarkupHighlight.ts +162 -0
- package/front_end/ui/components/highlighting/highlighting.ts +7 -0
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
- package/front_end/ui/components/icon_button/Icon.ts +4 -2
- package/front_end/ui/components/icon_button/IconButton.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -1
- package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +1 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
- package/front_end/ui/components/list/List.ts +184 -0
- package/front_end/ui/components/list/list.css +90 -0
- package/front_end/ui/components/{cards/cards.ts → list/lists.ts} +3 -3
- package/front_end/ui/components/markdown_view/CodeBlock.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -1
- package/front_end/ui/components/menus/Menu.ts +1 -1
- package/front_end/ui/components/menus/SelectMenu.ts +1 -1
- package/front_end/ui/components/node_text/NodeText.ts +1 -1
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +1 -1
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/panel_introduction_steps/PanelIntroductionSteps.ts +1 -1
- package/front_end/ui/components/report_view/ReportView.ts +1 -1
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +1 -1
- package/front_end/ui/components/snackbars/Snackbar.ts +1 -1
- package/front_end/ui/components/spinners/Spinner.ts +1 -1
- package/front_end/ui/components/srgb_overlay/SrgbOverlay.ts +1 -1
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +1 -0
- package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
- package/front_end/ui/components/switch/SwitchImpl.ts +1 -1
- package/front_end/ui/components/text_editor/TextEditor.ts +1 -0
- package/front_end/ui/components/text_prompt/TextPrompt.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
- package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -1
- package/front_end/ui/kit/kit.ts +5 -0
- package/front_end/ui/legacy/TabbedPane.ts +98 -0
- package/front_end/ui/legacy/UIUtils.ts +0 -184
- package/front_end/ui/legacy/ViewManager.ts +23 -8
- package/front_end/ui/legacy/ViewRegistration.ts +21 -22
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +5 -4
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +73 -35
- package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +11 -2
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +12 -13
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +7 -16
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +5 -6
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +18 -65
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +2 -1
- package/front_end/ui/legacy/tabbedPane.css +10 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/inspector_overlay/README.md +3 -3
- package/mcp/HostBindings.ts +310 -0
- package/mcp/mcp.ts +17 -0
- package/mcp/tsconfig.json +6 -1
- package/package.json +26 -24
- /package/front_end/ui/{components → kit}/cards/Card.ts +0 -0
- /package/front_end/ui/{components → kit}/cards/card.css +0 -0
|
@@ -9,6 +9,8 @@ import * as Platform from '../../../core/platform/platform.js';
|
|
|
9
9
|
import * as Root from '../../../core/root/root.js';
|
|
10
10
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
11
11
|
import * as Tracing from '../../../services/tracing/tracing.js';
|
|
12
|
+
import * as Annotations from '../../../ui/components/annotations/annotations.js';
|
|
13
|
+
import * as SourceMapScopes from '../../source_map_scopes/source_map_scopes.js';
|
|
12
14
|
import * as Trace from '../../trace/trace.js';
|
|
13
15
|
import {
|
|
14
16
|
PerformanceInsightFormatter,
|
|
@@ -23,6 +25,7 @@ import {
|
|
|
23
25
|
type ContextResponse,
|
|
24
26
|
ConversationContext,
|
|
25
27
|
type ConversationSuggestions,
|
|
28
|
+
type FunctionCallHandlerResult,
|
|
26
29
|
type ParsedResponse,
|
|
27
30
|
type RequestOptions,
|
|
28
31
|
type ResponseData,
|
|
@@ -44,6 +47,7 @@ const UIStringsNotTranslated = {
|
|
|
44
47
|
mainThreadActivity: 'Investigating main thread activity…',
|
|
45
48
|
} as const;
|
|
46
49
|
const lockedString = i18n.i18n.lockedString;
|
|
50
|
+
const annotationsEnabled = Annotations.AnnotationRepository.annotationsEnabled();
|
|
47
51
|
|
|
48
52
|
/**
|
|
49
53
|
* WARNING: preamble defined in code is only used when userTier is
|
|
@@ -51,6 +55,16 @@ const lockedString = i18n.i18n.lockedString;
|
|
|
51
55
|
* chrome_preambles.gcl). Sync local changes with the server-side.
|
|
52
56
|
*/
|
|
53
57
|
|
|
58
|
+
const greenDevAdditionalFunction = `
|
|
59
|
+
- CRITICAL:You also have access to a function called addElementAnnotation, which should be used to highlight elements.`;
|
|
60
|
+
|
|
61
|
+
const greenDevAdditionalGuidelines = `
|
|
62
|
+
- CRITICAL: Each time an element with a nodeId is mentioned, you MUST ALSO call the function addElementAnnotation for that element.
|
|
63
|
+
- The addElementAnnotation function should be called as soon as you identify an element that needs to be highlighted.
|
|
64
|
+
- The addElementAnnotation function should always be called for the LCP element, if known.
|
|
65
|
+
- The annotationMessage should be descriptive and relevant to why the element is being highlighted.
|
|
66
|
+
`;
|
|
67
|
+
|
|
54
68
|
/**
|
|
55
69
|
* Preamble clocks in at ~1341 tokens.
|
|
56
70
|
* The prose is around 4.5 chars per token.
|
|
@@ -68,6 +82,8 @@ Don't mention anything about an insight without first getting more data about it
|
|
|
68
82
|
|
|
69
83
|
You have many functions available to learn more about the trace. Use these to confirm hypotheses, or to further explore the trace when diagnosing performance issues.
|
|
70
84
|
|
|
85
|
+
${annotationsEnabled ? greenDevAdditionalFunction : ''}
|
|
86
|
+
|
|
71
87
|
You will be given bounds representing a time range within the trace. Bounds include a min and a max time in microseconds. max is always bigger than min in a bounds.
|
|
72
88
|
|
|
73
89
|
The 3 main performance metrics are:
|
|
@@ -108,6 +124,8 @@ Note: if the user asks a specific question about the trace (such as "What is my
|
|
|
108
124
|
- Structure your response using markdown headings and bullet points for improved readability.
|
|
109
125
|
- Be direct and to the point. Avoid unnecessary introductory phrases or filler content. Focus on delivering actionable advice efficiently.
|
|
110
126
|
|
|
127
|
+
${annotationsEnabled ? greenDevAdditionalGuidelines : ''}
|
|
128
|
+
|
|
111
129
|
## Strict Constraints
|
|
112
130
|
|
|
113
131
|
Adhere to the following critical requirements:
|
|
@@ -135,6 +153,11 @@ When referring to a trace event that has a corresponding \`eventKey\`, annotate
|
|
|
135
153
|
When asking the user to make a choice between multiple options, output a list of choices at the end of your text response. The format is \`SUGGESTIONS: ["suggestion1", "suggestion2", "suggestion3"]\`. This MUST start on a newline, and be a single line.
|
|
136
154
|
`;
|
|
137
155
|
|
|
156
|
+
const greenDevAdditionalGuidelineFreshTrace = `
|
|
157
|
+
When referring to an element for which you know the nodeId, always call the function addElementAnnotation, specifying the id and an annotation reason.
|
|
158
|
+
- CRITICAL: Each time you add an annotating link you MUST ALSO call the function addElementAnnotation.
|
|
159
|
+
`;
|
|
160
|
+
|
|
138
161
|
const extraPreambleWhenFreshTrace = `Additional notes:
|
|
139
162
|
|
|
140
163
|
When referring to an element for which you know the nodeId, annotate your output using markdown link syntax:
|
|
@@ -142,7 +165,8 @@ When referring to an element for which you know the nodeId, annotate your output
|
|
|
142
165
|
- This link will reveal the element in the Elements panel
|
|
143
166
|
- Never mention node or nodeId when referring to the element, and especially not in the link text.
|
|
144
167
|
- When referring to the LCP, it's useful to also mention what the LCP element is via its nodeId. Use the markdown link syntax to do so.
|
|
145
|
-
|
|
168
|
+
|
|
169
|
+
${annotationsEnabled ? greenDevAdditionalGuidelineFreshTrace : ''}`;
|
|
146
170
|
|
|
147
171
|
enum ScorePriority {
|
|
148
172
|
REQUIRED = 3,
|
|
@@ -310,7 +334,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
310
334
|
return Host.AidaClient.ClientFeature.CHROME_PERFORMANCE_FULL_AGENT;
|
|
311
335
|
}
|
|
312
336
|
get userTier(): string|undefined {
|
|
313
|
-
return Root.Runtime.hostConfig.devToolsAiAssistancePerformanceAgent?.userTier;
|
|
337
|
+
return annotationsEnabled ? 'TESTERS' : Root.Runtime.hostConfig.devToolsAiAssistancePerformanceAgent?.userTier;
|
|
314
338
|
}
|
|
315
339
|
get options(): RequestOptions {
|
|
316
340
|
const temperature = Root.Runtime.hostConfig.devToolsAiAssistancePerformanceAgent?.temperature;
|
|
@@ -883,12 +907,107 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
883
907
|
|
|
884
908
|
});
|
|
885
909
|
|
|
910
|
+
if (annotationsEnabled) {
|
|
911
|
+
this.declareFunction<{
|
|
912
|
+
elementId: string,
|
|
913
|
+
annotationMessage: string,
|
|
914
|
+
}>('addElementAnnotation', {
|
|
915
|
+
description:
|
|
916
|
+
'Adds a visual annotation in the Elements panel, attached to a node with the specific UID provided. Use it to highlight nodes in the Elements panel and provide contextual suggestions to the user related to their queries.',
|
|
917
|
+
parameters: {
|
|
918
|
+
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
919
|
+
description: '',
|
|
920
|
+
nullable: false,
|
|
921
|
+
properties: {
|
|
922
|
+
elementId: {
|
|
923
|
+
type: Host.AidaClient.ParametersTypes.STRING,
|
|
924
|
+
description: 'The UID of the element to annotate.',
|
|
925
|
+
nullable: false,
|
|
926
|
+
},
|
|
927
|
+
annotationMessage: {
|
|
928
|
+
type: Host.AidaClient.ParametersTypes.STRING,
|
|
929
|
+
description: 'The message the annotation should show to the user.',
|
|
930
|
+
nullable: false,
|
|
931
|
+
},
|
|
932
|
+
},
|
|
933
|
+
},
|
|
934
|
+
handler: async params => {
|
|
935
|
+
return await this.addElementAnnotation(params.elementId, params.annotationMessage);
|
|
936
|
+
},
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
this.declareFunction<{scriptUrl: string, line: number, column: number}, {result: string}>('getFunctionCode', {
|
|
941
|
+
description: 'Returns the code for a function defined at the given location.',
|
|
942
|
+
parameters: {
|
|
943
|
+
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
944
|
+
description: '',
|
|
945
|
+
nullable: false,
|
|
946
|
+
properties: {
|
|
947
|
+
scriptUrl: {
|
|
948
|
+
type: Host.AidaClient.ParametersTypes.STRING,
|
|
949
|
+
description: 'The url of the function.',
|
|
950
|
+
nullable: false,
|
|
951
|
+
},
|
|
952
|
+
line: {
|
|
953
|
+
type: Host.AidaClient.ParametersTypes.INTEGER,
|
|
954
|
+
description: 'The line number where the function is defined.',
|
|
955
|
+
nullable: false,
|
|
956
|
+
},
|
|
957
|
+
column: {
|
|
958
|
+
type: Host.AidaClient.ParametersTypes.INTEGER,
|
|
959
|
+
description: 'The column number where the function is defined.',
|
|
960
|
+
nullable: false,
|
|
961
|
+
},
|
|
962
|
+
},
|
|
963
|
+
},
|
|
964
|
+
displayInfoFromArgs: args => {
|
|
965
|
+
return {
|
|
966
|
+
title: lockedString('Looking up function code…'),
|
|
967
|
+
action: `getFunctionCode('${args.scriptUrl}', ${args.line}, ${args.column})`
|
|
968
|
+
};
|
|
969
|
+
},
|
|
970
|
+
handler: async args => {
|
|
971
|
+
debugLog('Function call: getFunctionCode');
|
|
972
|
+
|
|
973
|
+
if (args.line === undefined) {
|
|
974
|
+
return {error: 'Missing arg: line'};
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
if (args.column === undefined) {
|
|
978
|
+
return {error: 'Missing arg: column'};
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
if (!this.#formatter) {
|
|
982
|
+
throw new Error('missing formatter');
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
986
|
+
if (!target) {
|
|
987
|
+
throw new Error('missing target');
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
const url = args.scriptUrl as Platform.DevToolsPath.UrlString;
|
|
991
|
+
const code = await SourceMapScopes.FunctionCodeResolver.getFunctionCodeFromLocation(
|
|
992
|
+
target, url, args.line, args.column, {contextLength: 200, contextLineLength: 5, appendProfileData: true});
|
|
993
|
+
if (!code) {
|
|
994
|
+
return {error: 'Could not find code'};
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
const result = this.#formatter.formatFunctionCode(code);
|
|
998
|
+
|
|
999
|
+
const key = `getFunctionCode('${args.scriptUrl}', ${args.line}, ${args.column})`;
|
|
1000
|
+
this.#cacheFunctionResult(focus, key, result);
|
|
1001
|
+
return {result: {result}};
|
|
1002
|
+
},
|
|
1003
|
+
});
|
|
1004
|
+
|
|
886
1005
|
const isFresh = Tracing.FreshRecording.Tracker.instance().recordingIsFresh(parsedTrace);
|
|
887
1006
|
const isTraceApp = Root.Runtime.Runtime.isTraceApp();
|
|
888
1007
|
|
|
889
1008
|
this.declareFunction<{url: string}, {content: string}>('getResourceContent', {
|
|
890
1009
|
description:
|
|
891
|
-
'Returns the content of the resource with the given url. Only use this for text resource types.
|
|
1010
|
+
'Returns the content of the resource with the given url. Only use this for text resource types. Prefer getFunctionCode when possible.',
|
|
892
1011
|
parameters: {
|
|
893
1012
|
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
894
1013
|
description: '',
|
|
@@ -972,4 +1091,17 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
972
1091
|
});
|
|
973
1092
|
}
|
|
974
1093
|
}
|
|
1094
|
+
|
|
1095
|
+
async addElementAnnotation(elementId: string, annotationMessage: string):
|
|
1096
|
+
Promise<FunctionCallHandlerResult<unknown>> {
|
|
1097
|
+
if (!Annotations.AnnotationRepository.annotationsEnabled()) {
|
|
1098
|
+
console.warn('Received agent request to add annotation with annotations disabled');
|
|
1099
|
+
return {error: 'Annotations are not currently enabled'};
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
// eslint-disable-next-line no-console
|
|
1103
|
+
console.log(`AI AGENT EVENT: Performance Agent adding annotation for element ${elementId}: '${annotationMessage}'`);
|
|
1104
|
+
Annotations.AnnotationRepository.instance().addElementsAnnotation(annotationMessage, elementId);
|
|
1105
|
+
return {result: {success: true}};
|
|
1106
|
+
}
|
|
975
1107
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as CrUXManager from '../../crux-manager/crux-manager.js';
|
|
6
|
+
import type * as SourceMapScopes from '../../source_map_scopes/source_map_scopes.js';
|
|
6
7
|
import * as Trace from '../../trace/trace.js';
|
|
7
8
|
import type {AICallTree} from '../performance/AICallTree.js';
|
|
8
9
|
import type {AgentFocus} from '../performance/AIContext.js';
|
|
@@ -813,4 +814,27 @@ The order of headers corresponds to an internal fixed list. If a header is not p
|
|
|
813
814
|
];
|
|
814
815
|
return parts.join(';');
|
|
815
816
|
}
|
|
817
|
+
|
|
818
|
+
formatFunctionCode(code: SourceMapScopes.FunctionCodeResolver.FunctionCode): string {
|
|
819
|
+
const {startLine, startColumn} = code.range;
|
|
820
|
+
const {
|
|
821
|
+
startLine: contextStartLine,
|
|
822
|
+
startColumn: contextStartColumn,
|
|
823
|
+
endLine: contextEndLine,
|
|
824
|
+
endColumn: contextEndColumn
|
|
825
|
+
} = code.rangeWithContext;
|
|
826
|
+
const name = code.functionBounds.name;
|
|
827
|
+
const url = code.functionBounds.uiSourceCode.url();
|
|
828
|
+
|
|
829
|
+
const parts = [];
|
|
830
|
+
parts.push(`${name} @ ${url}:${startLine}:${startColumn}. With added context, chunk is from ${contextStartLine}:${
|
|
831
|
+
contextStartColumn} to ${contextEndLine}:${contextEndColumn}`);
|
|
832
|
+
parts.push(
|
|
833
|
+
'\nThe following is a markdown block of JavaScript. <FUNCTION_START> and <FUNCTION_END> marks the exact function declaration, and everything outside that is provided for additional context. Comments at the end of each line indicate the runtime performance cost of that code. Do not show the user the function markers or the additional context.\n');
|
|
834
|
+
parts.push('```');
|
|
835
|
+
parts.push(code.codeWithContext);
|
|
836
|
+
parts.push('```');
|
|
837
|
+
|
|
838
|
+
return parts.join('\n');
|
|
839
|
+
}
|
|
816
840
|
}
|
|
@@ -270,6 +270,49 @@ export class CompilerScriptMapping implements DebuggerSourceMapping {
|
|
|
270
270
|
return ranges;
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
async functionBoundsAtRawLocation(rawLocation: SDK.DebuggerModel.Location):
|
|
274
|
+
Promise<Workspace.UISourceCode.UIFunctionBounds|null> {
|
|
275
|
+
const script = rawLocation.script();
|
|
276
|
+
if (!script) {
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const sourceMap = this.#sourceMapManager.sourceMapForClient(script);
|
|
281
|
+
if (!sourceMap) {
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const {lineNumber, columnNumber} = script.rawLocationToRelativeLocation(rawLocation);
|
|
286
|
+
const {url, scope} = sourceMap.findOriginalFunctionScope({line: lineNumber, column: columnNumber}) ?? {};
|
|
287
|
+
if (!scope || !url) {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const project = this.#sourceMapToProject.get(sourceMap);
|
|
292
|
+
if (!project) {
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
const uiSourceCode = project.uiSourceCodeForURL(url);
|
|
297
|
+
if (!uiSourceCode) {
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// If there's no original source content, callers can't get the source code for
|
|
302
|
+
// the given scope. Presently that's the only reason to get a function's bounds,
|
|
303
|
+
// so in that case return null and allow ResourceScriptMapping to fulfill this
|
|
304
|
+
// request.
|
|
305
|
+
const contentData = await uiSourceCode.requestContentData();
|
|
306
|
+
if ('error' in contentData) {
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
const name = scope.name ?? '';
|
|
311
|
+
const range =
|
|
312
|
+
new TextUtils.TextRange.TextRange(scope.start.line, scope.start.column, scope.end.line, scope.end.column);
|
|
313
|
+
return new Workspace.UISourceCode.UIFunctionBounds(uiSourceCode, range, name);
|
|
314
|
+
}
|
|
315
|
+
|
|
273
316
|
translateRawFramesStep(
|
|
274
317
|
rawFrames: StackTraceImpl.Trie.RawFrame[],
|
|
275
318
|
translatedFrames: Awaited<ReturnType<StackTraceImpl.StackTraceModel.TranslateRawFrames>>): boolean {
|
|
@@ -338,6 +338,13 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
|
|
|
338
338
|
return [];
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
+
async functionBoundsAtRawLocation(rawLocation: SDK.DebuggerModel.Location):
|
|
342
|
+
Promise<Workspace.UISourceCode.UIFunctionBounds|null> {
|
|
343
|
+
// TODO(crbug.com/463452667): first try pluginManager.
|
|
344
|
+
const modelData = this.#debuggerModelToData.get(rawLocation.debuggerModel);
|
|
345
|
+
return modelData ? await modelData.functionBoundsAtRawLocation(rawLocation) : null;
|
|
346
|
+
}
|
|
347
|
+
|
|
341
348
|
async normalizeUILocation(uiLocation: Workspace.UISourceCode.UILocation): Promise<Workspace.UISourceCode.UILocation> {
|
|
342
349
|
const rawLocations =
|
|
343
350
|
await this.uiLocationToRawLocations(uiLocation.uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber);
|
|
@@ -582,6 +589,18 @@ class ModelData {
|
|
|
582
589
|
return ranges;
|
|
583
590
|
}
|
|
584
591
|
|
|
592
|
+
async functionBoundsAtRawLocation(rawLocation: SDK.DebuggerModel.Location):
|
|
593
|
+
Promise<Workspace.UISourceCode.UIFunctionBounds|null> {
|
|
594
|
+
let scope: Workspace.UISourceCode.UIFunctionBounds|null = null;
|
|
595
|
+
// Check source maps.
|
|
596
|
+
scope = scope || await this.compilerMapping.functionBoundsAtRawLocation(rawLocation);
|
|
597
|
+
// Check debugger scripts.
|
|
598
|
+
scope = scope || await this.#resourceScriptMapping.functionBoundsAtRawLocation(rawLocation);
|
|
599
|
+
// Check inline scripts inside HTML resources.
|
|
600
|
+
scope = scope || await this.#resourceMapping.functionBoundsAtRawLocation(rawLocation);
|
|
601
|
+
return scope;
|
|
602
|
+
}
|
|
603
|
+
|
|
585
604
|
translateRawFramesStep(
|
|
586
605
|
rawFrames: StackTraceImpl.Trie.RawFrame[],
|
|
587
606
|
translatedFrames: Awaited<ReturnType<StackTraceImpl.StackTraceModel.TranslateRawFrames>>): void {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import type * as Platform from '../../core/platform/platform.js';
|
|
7
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
+
import * as Formatter from '../formatter/formatter.js';
|
|
8
9
|
import * as TextUtils from '../text_utils/text_utils.js';
|
|
9
10
|
import * as Workspace from '../workspace/workspace.js';
|
|
10
11
|
|
|
@@ -269,6 +270,78 @@ export class ResourceMapping implements SDK.TargetManager.SDKModelObserver<SDK.R
|
|
|
269
270
|
uiLocation.uiSourceCode.url(), uiLocation.lineNumber, uiLocation.columnNumber);
|
|
270
271
|
}
|
|
271
272
|
|
|
273
|
+
async functionBoundsAtRawLocation(rawLocation: SDK.DebuggerModel.Location):
|
|
274
|
+
Promise<Workspace.UISourceCode.UIFunctionBounds|null> {
|
|
275
|
+
const script = rawLocation.script();
|
|
276
|
+
if (!script) {
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
279
|
+
const info = this.infoForTarget(script.debuggerModel.target());
|
|
280
|
+
if (!info) {
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
const embedderName = script.embedderName();
|
|
284
|
+
if (!embedderName) {
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
const uiSourceCode = info.getProject().uiSourceCodeForURL(embedderName);
|
|
288
|
+
if (!uiSourceCode) {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
let {lineNumber, columnNumber} = rawLocation;
|
|
293
|
+
lineNumber -= script.lineOffset;
|
|
294
|
+
if (lineNumber === 0) {
|
|
295
|
+
columnNumber -= script.columnOffset;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
const scopeTreeAndText = script ? await SDK.ScopeTreeCache.scopeTreeForScript(script) : null;
|
|
299
|
+
if (!scopeTreeAndText) {
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Find the inner-most scope that maps to the given position.
|
|
304
|
+
|
|
305
|
+
const offset = scopeTreeAndText.text.offsetFromPosition(lineNumber, columnNumber);
|
|
306
|
+
|
|
307
|
+
const results = [];
|
|
308
|
+
(function walk(nodes: Formatter.FormatterWorkerPool.ScopeTreeNode[]) {
|
|
309
|
+
for (const node of nodes) {
|
|
310
|
+
if (!(offset >= node.start && offset < node.end)) {
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
results.push(node);
|
|
314
|
+
walk(node.children);
|
|
315
|
+
}
|
|
316
|
+
})([scopeTreeAndText.scopeTree]);
|
|
317
|
+
|
|
318
|
+
const result = results.findLast(
|
|
319
|
+
node => node.kind === Formatter.FormatterWorkerPool.ScopeKind.FUNCTION ||
|
|
320
|
+
node.kind === Formatter.FormatterWorkerPool.ScopeKind.ARROW_FUNCTION);
|
|
321
|
+
if (!result) {
|
|
322
|
+
return null;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Map back to positions.
|
|
326
|
+
const startPosition = scopeTreeAndText.text.positionFromOffset(result.start);
|
|
327
|
+
const endPosition = scopeTreeAndText.text.positionFromOffset(result.end);
|
|
328
|
+
|
|
329
|
+
startPosition.lineNumber += script.lineOffset;
|
|
330
|
+
if (startPosition.lineNumber === script.lineOffset) {
|
|
331
|
+
startPosition.columnNumber += script.columnOffset;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
endPosition.lineNumber += script.lineOffset;
|
|
335
|
+
if (endPosition.lineNumber === script.lineOffset) {
|
|
336
|
+
endPosition.columnNumber += script.columnOffset;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
const name = ''; // TODO(crbug.com/452333154): update ScopeVariableAnalysis to include function name.
|
|
340
|
+
const range = new TextUtils.TextRange.TextRange(
|
|
341
|
+
startPosition.lineNumber, startPosition.columnNumber, endPosition.lineNumber, endPosition.columnNumber);
|
|
342
|
+
return new Workspace.UISourceCode.UIFunctionBounds(uiSourceCode, range, name);
|
|
343
|
+
}
|
|
344
|
+
|
|
272
345
|
resetForTest(target: SDK.Target.Target): void {
|
|
273
346
|
const resourceTreeModel = target.model(SDK.ResourceTreeModel.ResourceTreeModel);
|
|
274
347
|
const info = resourceTreeModel ? this.#modelToInfo.get(resourceTreeModel) : null;
|
|
@@ -8,6 +8,7 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
8
8
|
import * as Root from '../../core/root/root.js';
|
|
9
9
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
10
10
|
import * as Protocol from '../../generated/protocol.js';
|
|
11
|
+
import * as Formatter from '../formatter/formatter.js';
|
|
11
12
|
import * as TextUtils from '../text_utils/text_utils.js';
|
|
12
13
|
import * as Workspace from '../workspace/workspace.js';
|
|
13
14
|
|
|
@@ -156,6 +157,55 @@ export class ResourceScriptMapping implements DebuggerSourceMapping {
|
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
159
|
|
|
160
|
+
async functionBoundsAtRawLocation(rawLocation: SDK.DebuggerModel.Location):
|
|
161
|
+
Promise<Workspace.UISourceCode.UIFunctionBounds|null> {
|
|
162
|
+
const script = rawLocation.script();
|
|
163
|
+
if (!script) {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const uiSourceCode = this.#scriptToUISourceCode.get(script);
|
|
168
|
+
if (!uiSourceCode) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const scopeTreeAndText = script ? await SDK.ScopeTreeCache.scopeTreeForScript(script) : null;
|
|
173
|
+
if (!scopeTreeAndText) {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Find the inner-most scope that maps to the given position.
|
|
178
|
+
|
|
179
|
+
const offset = scopeTreeAndText.text.offsetFromPosition(rawLocation.lineNumber, rawLocation.columnNumber);
|
|
180
|
+
|
|
181
|
+
const results = [];
|
|
182
|
+
(function walk(nodes: Formatter.FormatterWorkerPool.ScopeTreeNode[]) {
|
|
183
|
+
for (const node of nodes) {
|
|
184
|
+
if (!(offset >= node.start && offset < node.end)) {
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
results.push(node);
|
|
188
|
+
walk(node.children);
|
|
189
|
+
}
|
|
190
|
+
})([scopeTreeAndText.scopeTree]);
|
|
191
|
+
|
|
192
|
+
const result = results.findLast(
|
|
193
|
+
node => node.kind === Formatter.FormatterWorkerPool.ScopeKind.FUNCTION ||
|
|
194
|
+
node.kind === Formatter.FormatterWorkerPool.ScopeKind.ARROW_FUNCTION);
|
|
195
|
+
if (!result) {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Map back to positions.
|
|
200
|
+
const startPosition = scopeTreeAndText.text.positionFromOffset(result.start);
|
|
201
|
+
const endPosition = scopeTreeAndText.text.positionFromOffset(result.end);
|
|
202
|
+
|
|
203
|
+
const name = ''; // TODO(crbug.com/452333154): update ScopeVariableAnalysis to include function name.
|
|
204
|
+
const range = new TextUtils.TextRange.TextRange(
|
|
205
|
+
startPosition.lineNumber, startPosition.columnNumber, endPosition.lineNumber, endPosition.columnNumber);
|
|
206
|
+
return new Workspace.UISourceCode.UIFunctionBounds(uiSourceCode, range, name);
|
|
207
|
+
}
|
|
208
|
+
|
|
159
209
|
private addScript(script: SDK.Script.Script): void {
|
|
160
210
|
// Ignore live edit scripts here.
|
|
161
211
|
if (script.isLiveEdit() || script.isBreakpointCondition) {
|
|
@@ -38,6 +38,11 @@ const UIStrings = {
|
|
|
38
38
|
* @description title for CORB explainer.
|
|
39
39
|
*/
|
|
40
40
|
corbExplainerPageTitle: 'CORB explainer',
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @description title for history intervention documentation page.
|
|
44
|
+
*/
|
|
45
|
+
historyManipulationInterventionPageTitle: 'History manipulation intervention explainer'
|
|
41
46
|
} as const;
|
|
42
47
|
|
|
43
48
|
const str_ = i18n.i18n.registerUIStrings('models/issues_manager/GenericIssue.ts', UIStrings);
|
|
@@ -185,6 +190,14 @@ export const genericResponseWasBlockedbyORB = {
|
|
|
185
190
|
}],
|
|
186
191
|
};
|
|
187
192
|
|
|
193
|
+
export const genericNavigationEntryMarkedSkippable = {
|
|
194
|
+
file: 'genericNavigationEntryMarkedSkippable.md',
|
|
195
|
+
links: [{
|
|
196
|
+
link: 'https://chromium.googlesource.com/chromium/src/+/main/docs/history_manipulation_intervention.md',
|
|
197
|
+
linkTitle: i18nLazyString(UIStrings.historyManipulationInterventionPageTitle),
|
|
198
|
+
}],
|
|
199
|
+
};
|
|
200
|
+
|
|
188
201
|
const issueDescriptions = new Map<Protocol.Audits.GenericIssueErrorType, LazyMarkdownIssueDescription>([
|
|
189
202
|
[Protocol.Audits.GenericIssueErrorType.FormLabelForNameError, genericFormLabelForNameError],
|
|
190
203
|
[Protocol.Audits.GenericIssueErrorType.FormInputWithNoLabelError, genericFormInputWithNoLabelError],
|
|
@@ -221,6 +234,10 @@ const issueDescriptions = new Map<Protocol.Audits.GenericIssueErrorType, LazyMar
|
|
|
221
234
|
Protocol.Audits.GenericIssueErrorType.ResponseWasBlockedByORB,
|
|
222
235
|
genericResponseWasBlockedbyORB,
|
|
223
236
|
],
|
|
237
|
+
[
|
|
238
|
+
Protocol.Audits.GenericIssueErrorType.NavigationEntryMarkedSkippable,
|
|
239
|
+
genericNavigationEntryMarkedSkippable,
|
|
240
|
+
],
|
|
224
241
|
]);
|
|
225
242
|
|
|
226
243
|
const issueTypes = new Map<Protocol.Audits.GenericIssueErrorType, IssueKind>([
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Session History Item Has Been Marked Skippable
|
|
2
|
+
|
|
3
|
+
A session history item was added by this document without any interaction from the
|
|
4
|
+
user. As a result, this document's history items will be skipped if the user goes
|
|
5
|
+
back or forward via the browser's UI (e.g., back/forward buttons), to prevent pages
|
|
6
|
+
from trapping a user. If the user interacts with the page, the history items
|
|
7
|
+
will no longer be skipped.
|
|
@@ -6990,6 +6990,10 @@ export const NativeFunctions = [
|
|
|
6990
6990
|
name: "Highlight",
|
|
6991
6991
|
signatures: [["...initRanges"]]
|
|
6992
6992
|
},
|
|
6993
|
+
{
|
|
6994
|
+
name: "getElementTransform",
|
|
6995
|
+
signatures: [["element","draw_transform"]]
|
|
6996
|
+
},
|
|
6993
6997
|
{
|
|
6994
6998
|
name: "configureHighDynamicRange",
|
|
6995
6999
|
signatures: [["options"]]
|
|
@@ -8905,11 +8909,11 @@ export const NativeFunctions = [
|
|
|
8905
8909
|
},
|
|
8906
8910
|
{
|
|
8907
8911
|
name: "texElementImage2D",
|
|
8908
|
-
signatures: [["target","level","internalformat","format","type","element"]]
|
|
8912
|
+
signatures: [["target","level","internalformat","format","type","element"],["target","level","internalformat","width","height","format","type","element"]]
|
|
8909
8913
|
},
|
|
8910
8914
|
{
|
|
8911
8915
|
name: "texElement2D",
|
|
8912
|
-
signatures: [["target","level","internalformat","format","type","element"]]
|
|
8916
|
+
signatures: [["target","level","internalformat","format","type","element"],["target","level","internalformat","width","height","format","type","element"]]
|
|
8913
8917
|
},
|
|
8914
8918
|
{
|
|
8915
8919
|
name: "drawingBufferStorage",
|
|
@@ -9097,7 +9101,7 @@ export const NativeFunctions = [
|
|
|
9097
9101
|
},
|
|
9098
9102
|
{
|
|
9099
9103
|
name: "copyElementImageToTexture",
|
|
9100
|
-
signatures: [["source","destination"]]
|
|
9104
|
+
signatures: [["source","destination"],["source","width","height","destination"]]
|
|
9101
9105
|
},
|
|
9102
9106
|
{
|
|
9103
9107
|
name: "setIndexBuffer",
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Title: FunctionCodeResolver getFunctionCodeFromLocation [no source maps] lookup named function
|
|
2
|
+
Content:
|
|
3
|
+
se strict";
|
|
4
|
+
function fibonacci<FUNCTION_START>(e) { // 67 ms
|
|
5
|
+
return e <= 1 ? 1 : fibonacci(e - 1) + fibonacci(e - 2) // 2022 ms
|
|
6
|
+
} // 13 ms
|
|
7
|
+
<FUNCTION_END>const btn = document.querySele
|
|
8
|
+
=== end content
|
|
9
|
+
|
|
10
|
+
Title: FunctionCodeResolver getFunctionCodeFromLocation [no source maps] lookup anonymous function
|
|
11
|
+
Content:
|
|
12
|
+
btn.addEventListener("click", <FUNCTION_START>() => {
|
|
13
|
+
console.log(fibonacci(Number(params.get("x")))), // 5000 ms
|
|
14
|
+
btn.style.backgroundColor = "red" // 333 ms
|
|
15
|
+
}
|
|
16
|
+
<FUNCTION_END>);
|
|
17
|
+
const input = document.quer
|
|
18
|
+
=== end content
|
|
19
|
+
|
|
20
|
+
Title: FunctionCodeResolver getFunctionCodeFromLocation [source maps] lookup named function with generated location
|
|
21
|
+
Content:
|
|
22
|
+
function <FUNCTION_START>fibonacci(num) { // 67 ms
|
|
23
|
+
if (num <= 1) return 1; // 23 ms
|
|
24
|
+
|
|
25
|
+
return fibonacci(num - 1) + fibonacci(num - 2); // 1999 ms
|
|
26
|
+
} // 13 ms
|
|
27
|
+
|
|
28
|
+
<FUNCTION_END>const btn = document.querySele
|
|
29
|
+
=== end content
|
|
30
|
+
|
|
31
|
+
Title: FunctionCodeResolver getFunctionCodeFromLocation [source maps] lookup named function with original location
|
|
32
|
+
Content:
|
|
33
|
+
function <FUNCTION_START>fibonacci(num) { // 67 ms
|
|
34
|
+
if (num <= 1) return 1; // 23 ms
|
|
35
|
+
|
|
36
|
+
return fibonacci(num - 1) + fibonacci(num - 2); // 1999 ms
|
|
37
|
+
} // 13 ms
|
|
38
|
+
|
|
39
|
+
<FUNCTION_END>const btn = document.querySele
|
|
40
|
+
=== end content
|
|
41
|
+
|
|
42
|
+
Title: FunctionCodeResolver getFunctionCodeFromLocation [source maps, no source contents] lookup named function with generated location
|
|
43
|
+
Content:
|
|
44
|
+
se strict";
|
|
45
|
+
function fibonacci<FUNCTION_START>(e) { // 67 ms
|
|
46
|
+
return e <= 1 ? 1 : fibonacci(e - 1) + fibonacci(e - 2) // 2022 ms
|
|
47
|
+
} // 13 ms
|
|
48
|
+
<FUNCTION_END>const btn = document.querySele
|
|
49
|
+
=== end content
|
|
50
|
+
|
|
51
|
+
Title: FunctionCodeResolver getFunctionCodeFromLocation [source maps, no source contents] lookup named function with original location
|
|
52
|
+
Content:
|
|
53
|
+
se strict";
|
|
54
|
+
function fibonacci<FUNCTION_START>(e) { // 67 ms
|
|
55
|
+
return e <= 1 ? 1 : fibonacci(e - 1) + fibonacci(e - 2) // 2022 ms
|
|
56
|
+
} // 13 ms
|
|
57
|
+
<FUNCTION_END>const btn = document.querySele
|
|
58
|
+
=== end content
|
|
59
|
+
|
|
60
|
+
Title: FunctionCodeResolver getFunctionCodeFromLocation [source maps] lookup anonymous function with generated location
|
|
61
|
+
Content:
|
|
62
|
+
btn.addEventListener('click', <FUNCTION_START>() => {
|
|
63
|
+
console.log(fibonacci(Number(params.get('x')))); // 5000 ms
|
|
64
|
+
btn.style.backgroundColor = 'red'; // 333 ms
|
|
65
|
+
}<FUNCTION_END>);
|
|
66
|
+
|
|
67
|
+
const input = document.que
|
|
68
|
+
=== end content
|
|
69
|
+
|
|
70
|
+
Title: FunctionCodeResolver getFunctionCodeFromLocation [source maps] lookup anonymous function with original location
|
|
71
|
+
Content:
|
|
72
|
+
btn.addEventListener('click', <FUNCTION_START>() => {
|
|
73
|
+
console.log(fibonacci(Number(params.get('x')))); // 5000 ms
|
|
74
|
+
btn.style.backgroundColor = 'red'; // 333 ms
|
|
75
|
+
}<FUNCTION_END>);
|
|
76
|
+
|
|
77
|
+
const input = document.que
|
|
78
|
+
=== end content
|
|
79
|
+
|
|
80
|
+
Title: FunctionCodeResolver getFunctionCodeFromLocation [source maps, no source contents] lookup anonymous function with generated location
|
|
81
|
+
Content:
|
|
82
|
+
btn.addEventListener("click", <FUNCTION_START>() => {
|
|
83
|
+
console.log(fibonacci(Number(params.get("x")))), // 5000 ms
|
|
84
|
+
btn.style.backgroundColor = "red" // 333 ms
|
|
85
|
+
}
|
|
86
|
+
<FUNCTION_END>);
|
|
87
|
+
const input = document.quer
|
|
88
|
+
=== end content
|
|
89
|
+
|
|
90
|
+
Title: FunctionCodeResolver getFunctionCodeFromLocation [source maps, no source contents] lookup anonymous function with original location
|
|
91
|
+
Content:
|
|
92
|
+
btn.addEventListener("click", <FUNCTION_START>() => {
|
|
93
|
+
console.log(fibonacci(Number(params.get("x")))), // 5000 ms
|
|
94
|
+
btn.style.backgroundColor = "red" // 333 ms
|
|
95
|
+
}
|
|
96
|
+
<FUNCTION_END>);
|
|
97
|
+
const input = document.quer
|
|
98
|
+
=== end content
|