chrome-devtools-frontend 1.0.944903 → 1.0.945329
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/host/InspectorFrontendHostAPI.ts +5 -5
- package/front_end/core/host/UserMetrics.ts +3 -1
- package/front_end/core/i18n/i18nImpl.ts +7 -4
- package/front_end/core/i18n/locales/en-US.json +0 -45
- package/front_end/core/i18n/locales/en-XL.json +0 -45
- package/front_end/entrypoints/main/MainImpl.ts +6 -0
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +6 -10
- package/front_end/models/timeline_model/TimelineJSProfile.ts +16 -3
- package/front_end/models/timeline_model/TimelineModel.ts +1 -0
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +20 -6
- package/front_end/panels/application/BackForwardCacheStrings.ts +15 -75
- package/front_end/panels/changes/ChangesView.ts +8 -7
- package/front_end/panels/elements/StyleEditorWidget.ts +2 -13
- package/front_end/panels/elements/StylePropertyTreeElement.ts +4 -7
- package/front_end/panels/emulation/DeviceModeView.ts +3 -0
- package/front_end/panels/help/ReleaseNoteText.ts +3 -1
- package/front_end/panels/timeline/TimelineController.ts +3 -0
- package/front_end/third_party/acorn/README.chromium +2 -2
- package/front_end/third_party/acorn/acorn.ts +1 -1
- package/front_end/third_party/acorn/package/CHANGELOG.md +31 -1
- package/front_end/third_party/acorn/package/README.md +1 -1
- package/front_end/third_party/acorn/package/dist/acorn.d.ts +3 -0
- package/front_end/third_party/acorn/package/dist/acorn.js +772 -708
- package/front_end/third_party/acorn/package/dist/acorn.mjs +767 -703
- package/front_end/third_party/acorn/package/dist/bin.js +47 -21
- package/front_end/third_party/acorn/package/package.json +1 -1
- package/front_end/third_party/acorn-loose/README.chromium +2 -2
- package/front_end/third_party/acorn-loose/package/CHANGELOG.md +12 -0
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.js +27 -7
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.mjs +28 -8
- package/front_end/third_party/acorn-loose/package/package.json +2 -2
- package/front_end/third_party/i18n/i18n-impl.ts +1 -1
- package/front_end/ui/legacy/InspectorView.ts +1 -1
- package/inspector_overlay/main.ts +3 -0
- package/package.json +1 -1
|
@@ -4,21 +4,44 @@ var path = require('path');
|
|
|
4
4
|
var fs = require('fs');
|
|
5
5
|
var acorn = require('./acorn.js');
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn);
|
|
26
|
+
|
|
27
|
+
var inputFilePaths = [], forceFileName = false, fileMode = false, silent = false, compact = false, tokenize = false;
|
|
8
28
|
var options = {};
|
|
9
29
|
|
|
10
30
|
function help(status) {
|
|
11
31
|
var print = (status === 0) ? console.log : console.error;
|
|
12
32
|
print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|...|--ecma2015|--ecma2016|--ecma2017|--ecma2018|...]");
|
|
13
|
-
print(" [--tokenize] [--locations] [---allow-hash-bang] [--allow-await-outside-function] [--compact] [--silent] [--module] [--help] [--] [infile]");
|
|
33
|
+
print(" [--tokenize] [--locations] [---allow-hash-bang] [--allow-await-outside-function] [--compact] [--silent] [--module] [--help] [--] [<infile>...]");
|
|
14
34
|
process.exit(status);
|
|
15
35
|
}
|
|
16
36
|
|
|
17
37
|
for (var i = 2; i < process.argv.length; ++i) {
|
|
18
38
|
var arg = process.argv[i];
|
|
19
|
-
if (
|
|
20
|
-
else if (arg === "--"
|
|
21
|
-
|
|
39
|
+
if (arg[0] !== "-" || arg === "-") { inputFilePaths.push(arg); }
|
|
40
|
+
else if (arg === "--") {
|
|
41
|
+
inputFilePaths.push.apply(inputFilePaths, process.argv.slice(i + 1));
|
|
42
|
+
forceFileName = true;
|
|
43
|
+
break
|
|
44
|
+
} else if (arg === "--locations") { options.locations = true; }
|
|
22
45
|
else if (arg === "--allow-hash-bang") { options.allowHashBang = true; }
|
|
23
46
|
else if (arg === "--allow-await-outside-function") { options.allowAwaitOutsideFunction = true; }
|
|
24
47
|
else if (arg === "--silent") { silent = true; }
|
|
@@ -35,31 +58,34 @@ for (var i = 2; i < process.argv.length; ++i) {
|
|
|
35
58
|
}
|
|
36
59
|
}
|
|
37
60
|
|
|
38
|
-
function run(
|
|
39
|
-
var result;
|
|
61
|
+
function run(codeList) {
|
|
62
|
+
var result = [], fileIdx = 0;
|
|
40
63
|
try {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
64
|
+
codeList.forEach(function (code, idx) {
|
|
65
|
+
fileIdx = idx;
|
|
66
|
+
if (!tokenize) {
|
|
67
|
+
result = acorn__namespace.parse(code, options);
|
|
68
|
+
options.program = result;
|
|
69
|
+
} else {
|
|
70
|
+
var tokenizer = acorn__namespace.tokenizer(code, options), token;
|
|
71
|
+
do {
|
|
72
|
+
token = tokenizer.getToken();
|
|
73
|
+
result.push(token);
|
|
74
|
+
} while (token.type !== acorn__namespace.tokTypes.eof)
|
|
75
|
+
}
|
|
76
|
+
});
|
|
51
77
|
} catch (e) {
|
|
52
|
-
console.error(
|
|
78
|
+
console.error(fileMode ? e.message.replace(/\(\d+:\d+\)$/, function (m) { return m.slice(0, 1) + inputFilePaths[fileIdx] + " " + m.slice(1); }) : e.message);
|
|
53
79
|
process.exit(1);
|
|
54
80
|
}
|
|
55
81
|
if (!silent) { console.log(JSON.stringify(result, null, compact ? null : 2)); }
|
|
56
82
|
}
|
|
57
83
|
|
|
58
|
-
if (
|
|
59
|
-
run(fs.readFileSync(
|
|
84
|
+
if (fileMode = inputFilePaths.length && (forceFileName || !inputFilePaths.includes("-") || inputFilePaths.length !== 1)) {
|
|
85
|
+
run(inputFilePaths.map(function (path) { return fs.readFileSync(path, "utf8"); }));
|
|
60
86
|
} else {
|
|
61
87
|
var code = "";
|
|
62
88
|
process.stdin.resume();
|
|
63
89
|
process.stdin.on("data", function (chunk) { return code += chunk; });
|
|
64
|
-
process.stdin.on("end", function () { return run(code); });
|
|
90
|
+
process.stdin.on("end", function () { return run([code]); });
|
|
65
91
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Name: An error-tolerant JavaScript parser written in JavaScript.
|
|
2
2
|
Short Name: acorn-loose
|
|
3
3
|
URL: https://github.com/acornjs/acorn
|
|
4
|
-
Version: 8.1
|
|
4
|
+
Version: 8.2.1
|
|
5
5
|
License: MIT
|
|
6
6
|
License File: LICENSE
|
|
7
7
|
Security Critical: no
|
|
@@ -14,7 +14,7 @@ This parser will parse any text into an ESTree syntax tree that is a reasonable
|
|
|
14
14
|
It will, to recover from missing brackets, treat whitespace as significant, which has the downside that it might mis-parse a valid but weirdly indented file. It is recommended to always try a parse with the regular acorn parser first, and only fall back to this parser when that one finds syntax errors.
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
wget -qO- https://registry.npmjs.org/acorn-loose/-/acorn-loose-8.1.
|
|
17
|
+
wget -qO- https://registry.npmjs.org/acorn-loose/-/acorn-loose-8.2.1.tgz | tar xzf -
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Local Modifications:
|
|
@@ -597,16 +597,21 @@
|
|
|
597
597
|
var isGenerator = false;
|
|
598
598
|
var isAsync = false;
|
|
599
599
|
var kind = "method";
|
|
600
|
+
var isStatic = false;
|
|
600
601
|
|
|
601
|
-
// Parse modifiers
|
|
602
|
-
node.static = false;
|
|
603
602
|
if (this.eatContextual("static")) {
|
|
603
|
+
// Parse static init block
|
|
604
|
+
if (ecmaVersion >= 13 && this.eat(acorn.tokTypes.braceL)) {
|
|
605
|
+
this.parseClassStaticBlock(node);
|
|
606
|
+
return node
|
|
607
|
+
}
|
|
604
608
|
if (this.isClassElementNameStart() || this.toks.type === acorn.tokTypes.star) {
|
|
605
|
-
|
|
609
|
+
isStatic = true;
|
|
606
610
|
} else {
|
|
607
611
|
keyName = "static";
|
|
608
612
|
}
|
|
609
613
|
}
|
|
614
|
+
node.static = isStatic;
|
|
610
615
|
if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) {
|
|
611
616
|
if ((this.isClassElementNameStart() || this.toks.type === acorn.tokTypes.star) && !this.canInsertSemicolon()) {
|
|
612
617
|
isAsync = true;
|
|
@@ -686,6 +691,18 @@
|
|
|
686
691
|
return node
|
|
687
692
|
};
|
|
688
693
|
|
|
694
|
+
lp$1.parseClassStaticBlock = function(node) {
|
|
695
|
+
var blockIndent = this.curIndent, line = this.curLineStart;
|
|
696
|
+
node.body = [];
|
|
697
|
+
this.pushCx();
|
|
698
|
+
while (!this.closes(acorn.tokTypes.braceR, blockIndent, line, true))
|
|
699
|
+
{ node.body.push(this.parseStatement()); }
|
|
700
|
+
this.popCx();
|
|
701
|
+
this.eat(acorn.tokTypes.braceR);
|
|
702
|
+
|
|
703
|
+
return this.finishNode(node, "StaticBlock")
|
|
704
|
+
};
|
|
705
|
+
|
|
689
706
|
lp$1.isClassElementNameStart = function() {
|
|
690
707
|
return this.toks.isClassElementNameStart()
|
|
691
708
|
};
|
|
@@ -952,8 +969,8 @@
|
|
|
952
969
|
lp$2.parseMaybeUnary = function(sawUnary) {
|
|
953
970
|
var start = this.storeCurrentPos(), expr;
|
|
954
971
|
if (this.options.ecmaVersion >= 8 && this.toks.isContextual("await") &&
|
|
955
|
-
|
|
956
|
-
|
|
972
|
+
(this.inAsync || (this.toks.inModule && this.options.ecmaVersion >= 13) ||
|
|
973
|
+
(!this.inFunction && this.options.allowAwaitOutsideFunction))) {
|
|
957
974
|
expr = this.parseAwait();
|
|
958
975
|
sawUnary = true;
|
|
959
976
|
} else if (this.tok.type.prefix) {
|
|
@@ -1084,8 +1101,10 @@
|
|
|
1084
1101
|
var id = this.parseIdent();
|
|
1085
1102
|
var isAsync = false;
|
|
1086
1103
|
if (id.name === "async" && !this.canInsertSemicolon()) {
|
|
1087
|
-
if (this.eat(acorn.tokTypes._function))
|
|
1088
|
-
|
|
1104
|
+
if (this.eat(acorn.tokTypes._function)) {
|
|
1105
|
+
this.toks.overrideContext(acorn.tokContexts.f_expr);
|
|
1106
|
+
return this.parseFunction(this.startNodeAt(start), false, true)
|
|
1107
|
+
}
|
|
1089
1108
|
if (this.tok.type === acorn.tokTypes.name) {
|
|
1090
1109
|
id = this.parseIdent();
|
|
1091
1110
|
isAsync = true;
|
|
@@ -1142,6 +1161,7 @@
|
|
|
1142
1161
|
return this.finishNode(node, "ArrayExpression")
|
|
1143
1162
|
|
|
1144
1163
|
case acorn.tokTypes.braceL:
|
|
1164
|
+
this.toks.overrideContext(acorn.tokContexts.b_expr);
|
|
1145
1165
|
return this.parseObj()
|
|
1146
1166
|
|
|
1147
1167
|
case acorn.tokTypes._class:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tokTypes, SourceLocation, Node, lineBreak, isNewLine, Parser, Token, getLineInfo, lineBreakG, defaultOptions } from '../../../acorn/acorn.js';
|
|
1
|
+
import { tokTypes, SourceLocation, Node, lineBreak, isNewLine, Parser, Token, getLineInfo, lineBreakG, tokContexts, defaultOptions } from '../../../acorn/acorn.js';
|
|
2
2
|
|
|
3
3
|
var dummyValue = "✖";
|
|
4
4
|
|
|
@@ -593,16 +593,21 @@ lp$1.parseClassElement = function() {
|
|
|
593
593
|
var isGenerator = false;
|
|
594
594
|
var isAsync = false;
|
|
595
595
|
var kind = "method";
|
|
596
|
+
var isStatic = false;
|
|
596
597
|
|
|
597
|
-
// Parse modifiers
|
|
598
|
-
node.static = false;
|
|
599
598
|
if (this.eatContextual("static")) {
|
|
599
|
+
// Parse static init block
|
|
600
|
+
if (ecmaVersion >= 13 && this.eat(tokTypes.braceL)) {
|
|
601
|
+
this.parseClassStaticBlock(node);
|
|
602
|
+
return node
|
|
603
|
+
}
|
|
600
604
|
if (this.isClassElementNameStart() || this.toks.type === tokTypes.star) {
|
|
601
|
-
|
|
605
|
+
isStatic = true;
|
|
602
606
|
} else {
|
|
603
607
|
keyName = "static";
|
|
604
608
|
}
|
|
605
609
|
}
|
|
610
|
+
node.static = isStatic;
|
|
606
611
|
if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) {
|
|
607
612
|
if ((this.isClassElementNameStart() || this.toks.type === tokTypes.star) && !this.canInsertSemicolon()) {
|
|
608
613
|
isAsync = true;
|
|
@@ -682,6 +687,18 @@ lp$1.parseClassElement = function() {
|
|
|
682
687
|
return node
|
|
683
688
|
};
|
|
684
689
|
|
|
690
|
+
lp$1.parseClassStaticBlock = function(node) {
|
|
691
|
+
var blockIndent = this.curIndent, line = this.curLineStart;
|
|
692
|
+
node.body = [];
|
|
693
|
+
this.pushCx();
|
|
694
|
+
while (!this.closes(tokTypes.braceR, blockIndent, line, true))
|
|
695
|
+
{ node.body.push(this.parseStatement()); }
|
|
696
|
+
this.popCx();
|
|
697
|
+
this.eat(tokTypes.braceR);
|
|
698
|
+
|
|
699
|
+
return this.finishNode(node, "StaticBlock")
|
|
700
|
+
};
|
|
701
|
+
|
|
685
702
|
lp$1.isClassElementNameStart = function() {
|
|
686
703
|
return this.toks.isClassElementNameStart()
|
|
687
704
|
};
|
|
@@ -948,8 +965,8 @@ lp$2.parseExprOp = function(left, start, minPrec, noIn, indent, line) {
|
|
|
948
965
|
lp$2.parseMaybeUnary = function(sawUnary) {
|
|
949
966
|
var start = this.storeCurrentPos(), expr;
|
|
950
967
|
if (this.options.ecmaVersion >= 8 && this.toks.isContextual("await") &&
|
|
951
|
-
|
|
952
|
-
|
|
968
|
+
(this.inAsync || (this.toks.inModule && this.options.ecmaVersion >= 13) ||
|
|
969
|
+
(!this.inFunction && this.options.allowAwaitOutsideFunction))) {
|
|
953
970
|
expr = this.parseAwait();
|
|
954
971
|
sawUnary = true;
|
|
955
972
|
} else if (this.tok.type.prefix) {
|
|
@@ -1080,8 +1097,10 @@ lp$2.parseExprAtom = function() {
|
|
|
1080
1097
|
var id = this.parseIdent();
|
|
1081
1098
|
var isAsync = false;
|
|
1082
1099
|
if (id.name === "async" && !this.canInsertSemicolon()) {
|
|
1083
|
-
if (this.eat(tokTypes._function))
|
|
1084
|
-
|
|
1100
|
+
if (this.eat(tokTypes._function)) {
|
|
1101
|
+
this.toks.overrideContext(tokContexts.f_expr);
|
|
1102
|
+
return this.parseFunction(this.startNodeAt(start), false, true)
|
|
1103
|
+
}
|
|
1085
1104
|
if (this.tok.type === tokTypes.name) {
|
|
1086
1105
|
id = this.parseIdent();
|
|
1087
1106
|
isAsync = true;
|
|
@@ -1138,6 +1157,7 @@ lp$2.parseExprAtom = function() {
|
|
|
1138
1157
|
return this.finishNode(node, "ArrayExpression")
|
|
1139
1158
|
|
|
1140
1159
|
case tokTypes.braceL:
|
|
1160
|
+
this.toks.overrideContext(tokContexts.b_expr);
|
|
1141
1161
|
return this.parseObj()
|
|
1142
1162
|
|
|
1143
1163
|
case tokTypes._class:
|
|
@@ -35,7 +35,7 @@ export class I18n {
|
|
|
35
35
|
* - the default locale if no match is found
|
|
36
36
|
*/
|
|
37
37
|
lookupClosestSupportedLocale(locale: Intl.UnicodeBCP47LocaleIdentifier): Intl.UnicodeBCP47LocaleIdentifier {
|
|
38
|
-
// @ts-
|
|
38
|
+
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/29129
|
|
39
39
|
const canonicalLocale: string = Intl.getCanonicalLocales(locale)[0];
|
|
40
40
|
|
|
41
41
|
const localeParts = canonicalLocale.split('-');
|
|
@@ -471,7 +471,7 @@ function createLocaleInfobar(): Infobar {
|
|
|
471
471
|
// @ts-ignore TODO(crbug.com/1163928) Wait for Intl support.
|
|
472
472
|
const locale = new Intl.Locale(closestSupportedLocale);
|
|
473
473
|
const closestSupportedLanguageInCurrentLocale =
|
|
474
|
-
new Intl.DisplayNames([devtoolsLocale.locale], {type: 'language'}).of(locale.language);
|
|
474
|
+
new Intl.DisplayNames([devtoolsLocale.locale], {type: 'language'}).of(locale.language || 'en');
|
|
475
475
|
|
|
476
476
|
const languageSetting = Common.Settings.Settings.instance().moduleSetting<string>('language');
|
|
477
477
|
return new Infobar(
|
|
@@ -77,6 +77,7 @@ let platformName: PlatformName;
|
|
|
77
77
|
type MessageLookup = {
|
|
78
78
|
'setOverlay': keyof Overlays,
|
|
79
79
|
'setPlatform': PlatformName,
|
|
80
|
+
drawingFinished: '',
|
|
80
81
|
};
|
|
81
82
|
|
|
82
83
|
const dispatch = <K extends keyof MessageLookup>(message: [a: K, b: MessageLookup[K]]) => {
|
|
@@ -95,6 +96,8 @@ const dispatch = <K extends keyof MessageLookup>(message: [a: K, b: MessageLooku
|
|
|
95
96
|
}
|
|
96
97
|
} else if (functionName === 'setPlatform') {
|
|
97
98
|
platformName = message[1];
|
|
99
|
+
} else if (functionName === 'drawingFinished') {
|
|
100
|
+
// TODO The logic needs to be added here once the backend starts sending this event.
|
|
98
101
|
} else {
|
|
99
102
|
currentOverlay.dispatch(message);
|
|
100
103
|
}
|
package/package.json
CHANGED