chrome-devtools-frontend 1.0.1006768 → 1.0.1007307
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/config/gni/devtools_grd_files.gni +2 -0
- package/config/gni/devtools_image_files.gni +2 -0
- package/front_end/Images/src/ic_sources_authored.svg +5 -0
- package/front_end/Images/src/ic_sources_deployed.svg +5 -0
- package/front_end/core/i18n/locales/en-US.json +25 -1
- package/front_end/core/i18n/locales/en-XL.json +25 -1
- package/front_end/core/sdk/DebuggerModel.ts +12 -3
- package/front_end/core/sdk/NetworkManager.ts +6 -2
- package/front_end/devtools_compatibility.js +1 -0
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +1 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +12 -10
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +4 -0
- package/front_end/models/formatter/FormatterWorkerPool.ts +6 -0
- package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +13 -20
- package/front_end/models/javascript_metadata/NativeFunctions.js +1237 -3962
- package/front_end/models/source_map_scopes/NamesResolver.ts +206 -73
- package/front_end/models/workspace/UISourceCode.ts +7 -0
- package/front_end/panels/application/components/BackForwardCacheView.ts +16 -0
- package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -5
- package/front_end/panels/lighthouse/LighthouseStartViewFR.ts +70 -49
- package/front_end/panels/network/components/RequestHeadersView.css +31 -3
- package/front_end/panels/network/components/RequestHeadersView.ts +126 -3
- package/front_end/panels/sources/NavigatorView.ts +141 -40
- package/front_end/panels/sources/SourcesPanel.ts +8 -0
- package/front_end/panels/sources/TabbedEditorContainer.ts +2 -2
- package/front_end/panels/sources/sources-meta.ts +6 -0
- package/front_end/ui/components/text_editor/javascript.ts +12 -14
- package/front_end/ui/legacy/Treeoutline.ts +5 -2
- package/package.json +1 -1
- package/scripts/hosted_mode/server.js +14 -1
- package/scripts/javascript_natives/helpers.js +26 -7
- package/scripts/javascript_natives/index.js +4 -3
- package/scripts/javascript_natives/tests.js +2 -2
@@ -10,9 +10,12 @@ import {fileURLToPath} from 'url';
|
|
10
10
|
|
11
11
|
/** @type {Map<string, Map<string, string[][]>>} */
|
12
12
|
const methods = new Map();
|
13
|
+
/** @type {Map<string, string[]>} */
|
14
|
+
const includes = new Map();
|
13
15
|
|
14
16
|
export function clearState() {
|
15
17
|
methods.clear();
|
18
|
+
includes.clear();
|
16
19
|
}
|
17
20
|
|
18
21
|
export function parseTSFunction(func, node) {
|
@@ -47,9 +50,22 @@ export function walkRoot(thing) {
|
|
47
50
|
case 'namespace':
|
48
51
|
walkMembers(thing);
|
49
52
|
break;
|
53
|
+
case 'includes':
|
54
|
+
walkIncludes(thing);
|
55
|
+
break;
|
50
56
|
}
|
51
57
|
}
|
52
58
|
|
59
|
+
/**
|
60
|
+
* @param {WebIDL2.IncludesType} thing
|
61
|
+
* */
|
62
|
+
function walkIncludes(thing) {
|
63
|
+
if (includes.has(thing.includes)) {
|
64
|
+
includes.get(thing.includes).push(thing.target);
|
65
|
+
} else {
|
66
|
+
includes.set(thing.includes, [thing.target]);
|
67
|
+
}
|
68
|
+
}
|
53
69
|
/**
|
54
70
|
* @param {WebIDL2.InterfaceType} thing
|
55
71
|
* */
|
@@ -84,9 +100,7 @@ function walkMembers(thing) {
|
|
84
100
|
* @param {WebIDL2.OperationMemberType} member
|
85
101
|
* */
|
86
102
|
function handleOperation(member) {
|
87
|
-
storeMethod(
|
88
|
-
member.special === 'static' ? (parent.name + 'Constructor') : member.parent.name, member.name,
|
89
|
-
member.arguments.map(argName));
|
103
|
+
storeMethod(member.parent.name, member.name, member.arguments.map(argName));
|
90
104
|
}
|
91
105
|
|
92
106
|
/**
|
@@ -177,13 +191,18 @@ export function postProcess(dryRun = false) {
|
|
177
191
|
// All parents had the same signature so we emit an entry without receiver.
|
178
192
|
functions.push({name, signatures: method.get('*')});
|
179
193
|
} else {
|
194
|
+
const receiversMap = new Map();
|
180
195
|
for (const [parent, signatures] of method) {
|
181
|
-
|
182
|
-
|
183
|
-
|
196
|
+
const receivers = receiversMap.get(JSON.stringify(signatures)) || new Set();
|
197
|
+
if (includes.has(parent)) {
|
198
|
+
includes.get(parent).forEach(receiver => receivers.add(receiver));
|
184
199
|
} else {
|
185
|
-
|
200
|
+
receivers.add(parent);
|
186
201
|
}
|
202
|
+
receiversMap.set(JSON.stringify(signatures), receivers);
|
203
|
+
}
|
204
|
+
for (const [signatures, receivers] of receiversMap) {
|
205
|
+
functions.push({name, signatures: JSON.parse(signatures), receivers: Array.from(receivers)});
|
187
206
|
}
|
188
207
|
}
|
189
208
|
}
|
@@ -14,9 +14,11 @@ if (process.argv.length !== 4) {
|
|
14
14
|
}
|
15
15
|
|
16
16
|
const chromiumSource = process.argv[2];
|
17
|
-
const
|
17
|
+
const REL_TS_LIB_PATH = '/node_modules/typescript/lib/';
|
18
|
+
const typescriptSources =
|
19
|
+
fs.readdirSync(process.argv[3] + REL_TS_LIB_PATH).map(name => process.argv[3] + REL_TS_LIB_PATH + name);
|
18
20
|
|
19
|
-
const program = ts.createProgram(
|
21
|
+
const program = ts.createProgram({rootNames: typescriptSources, options: {noResolve: true, types: []}});
|
20
22
|
|
21
23
|
for (const file of program.getSourceFiles()) {
|
22
24
|
ts.forEachChild(file, node => {
|
@@ -30,7 +32,6 @@ for (const file of program.getSourceFiles()) {
|
|
30
32
|
if (node.kind === ts.SyntaxKind.FunctionDeclaration) {
|
31
33
|
parseTSFunction(node, {name: {text: 'Window'}});
|
32
34
|
}
|
33
|
-
|
34
35
|
});
|
35
36
|
}
|
36
37
|
|
@@ -182,12 +182,12 @@ namespace console {
|
|
182
182
|
{
|
183
183
|
name: "diffSig",
|
184
184
|
signatures: [["oneSig"]],
|
185
|
-
|
185
|
+
receivers: ["Array"]
|
186
186
|
},
|
187
187
|
{
|
188
188
|
name: "diffSig",
|
189
189
|
signatures: [["twoSig"]],
|
190
|
-
|
190
|
+
receivers: ["ReadonlyArray"]
|
191
191
|
}
|
192
192
|
];`;
|
193
193
|
assert.equal(output, expected);
|