Files
Huáng JùnliàngandGitHub 2d557f5b3e Materialize explicitResourceManagement parser plugin (#17346)
* feat: materialize explicitResourceManagement plugin

* remove explicitResourceManagement from parser option schema

* remove no plugin tests

* move parser tests to es2026

* remove explicitResourceManagement parser option usage

* add missing options.json

* remove explicitResourceManagement from prettier Babel parser config

* fix rebase error

* add failed typescript test
2025-06-29 22:34:30 +02:00

232 lines
10 KiB
JSON

{
"type": "File",
"start":0,"end":198,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":8,"column":1,"index":198}},
"errors": [
"SyntaxError: Lexical declaration cannot appear in a single-statement context. (2:12)",
"SyntaxError: Lexical declaration cannot appear in a single-statement context. (3:12)",
"SyntaxError: Lexical declaration cannot appear in a single-statement context. (4:5)",
"SyntaxError: Lexical declaration cannot appear in a single-statement context. (5:9)",
"SyntaxError: Lexical declaration cannot appear in a single-statement context. (6:11)",
"SyntaxError: Lexical declaration cannot appear in a single-statement context. (7:9)"
],
"program": {
"type": "Program",
"start":0,"end":198,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":8,"column":1,"index":198}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "BlockStatement",
"start":0,"end":198,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":8,"column":1,"index":198}},
"body": [
{
"type": "WhileStatement",
"start":4,"end":34,"loc":{"start":{"line":2,"column":2,"index":4},"end":{"line":2,"column":32,"index":34}},
"test": {
"type": "NumericLiteral",
"start":11,"end":12,"loc":{"start":{"line":2,"column":9,"index":11},"end":{"line":2,"column":10,"index":12}},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"body": {
"type": "VariableDeclaration",
"start":14,"end":34,"loc":{"start":{"line":2,"column":12,"index":14},"end":{"line":2,"column":32,"index":34}},
"declarations": [
{
"type": "VariableDeclarator",
"start":26,"end":33,"loc":{"start":{"line":2,"column":24,"index":26},"end":{"line":2,"column":31,"index":33}},
"id": {
"type": "Identifier",
"start":26,"end":27,"loc":{"start":{"line":2,"column":24,"index":26},"end":{"line":2,"column":25,"index":27},"identifierName":"a"},
"name": "a"
},
"init": {
"type": "Identifier",
"start":30,"end":33,"loc":{"start":{"line":2,"column":28,"index":30},"end":{"line":2,"column":31,"index":33},"identifierName":"foo"},
"name": "foo"
}
}
],
"kind": "await using"
}
},
{
"type": "ForStatement",
"start":37,"end":67,"loc":{"start":{"line":3,"column":2,"index":37},"end":{"line":3,"column":32,"index":67}},
"init": null,
"test": {
"type": "NumericLiteral",
"start":43,"end":44,"loc":{"start":{"line":3,"column":8,"index":43},"end":{"line":3,"column":9,"index":44}},
"extra": {
"rawValue": 0,
"raw": "0"
},
"value": 0
},
"update": null,
"body": {
"type": "VariableDeclaration",
"start":47,"end":67,"loc":{"start":{"line":3,"column":12,"index":47},"end":{"line":3,"column":32,"index":67}},
"declarations": [
{
"type": "VariableDeclarator",
"start":59,"end":66,"loc":{"start":{"line":3,"column":24,"index":59},"end":{"line":3,"column":31,"index":66}},
"id": {
"type": "Identifier",
"start":59,"end":60,"loc":{"start":{"line":3,"column":24,"index":59},"end":{"line":3,"column":25,"index":60},"identifierName":"b"},
"name": "b"
},
"init": {
"type": "Identifier",
"start":63,"end":66,"loc":{"start":{"line":3,"column":28,"index":63},"end":{"line":3,"column":31,"index":66},"identifierName":"foo"},
"name": "foo"
}
}
],
"kind": "await using"
}
},
{
"type": "DoWhileStatement",
"start":70,"end":104,"loc":{"start":{"line":4,"column":2,"index":70},"end":{"line":4,"column":36,"index":104}},
"body": {
"type": "VariableDeclaration",
"start":73,"end":93,"loc":{"start":{"line":4,"column":5,"index":73},"end":{"line":4,"column":25,"index":93}},
"declarations": [
{
"type": "VariableDeclarator",
"start":85,"end":92,"loc":{"start":{"line":4,"column":17,"index":85},"end":{"line":4,"column":24,"index":92}},
"id": {
"type": "Identifier",
"start":85,"end":86,"loc":{"start":{"line":4,"column":17,"index":85},"end":{"line":4,"column":18,"index":86},"identifierName":"c"},
"name": "c"
},
"init": {
"type": "Identifier",
"start":89,"end":92,"loc":{"start":{"line":4,"column":21,"index":89},"end":{"line":4,"column":24,"index":92},"identifierName":"foo"},
"name": "foo"
}
}
],
"kind": "await using"
},
"test": {
"type": "NumericLiteral",
"start":101,"end":102,"loc":{"start":{"line":4,"column":33,"index":101},"end":{"line":4,"column":34,"index":102}},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
}
},
{
"type": "IfStatement",
"start":107,"end":134,"loc":{"start":{"line":5,"column":2,"index":107},"end":{"line":5,"column":29,"index":134}},
"test": {
"type": "NumericLiteral",
"start":111,"end":112,"loc":{"start":{"line":5,"column":6,"index":111},"end":{"line":5,"column":7,"index":112}},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"consequent": {
"type": "VariableDeclaration",
"start":114,"end":134,"loc":{"start":{"line":5,"column":9,"index":114},"end":{"line":5,"column":29,"index":134}},
"declarations": [
{
"type": "VariableDeclarator",
"start":126,"end":133,"loc":{"start":{"line":5,"column":21,"index":126},"end":{"line":5,"column":28,"index":133}},
"id": {
"type": "Identifier",
"start":126,"end":127,"loc":{"start":{"line":5,"column":21,"index":126},"end":{"line":5,"column":22,"index":127},"identifierName":"d"},
"name": "d"
},
"init": {
"type": "Identifier",
"start":130,"end":133,"loc":{"start":{"line":5,"column":25,"index":130},"end":{"line":5,"column":28,"index":133},"identifierName":"foo"},
"name": "foo"
}
}
],
"kind": "await using"
},
"alternate": null
},
{
"type": "WithStatement",
"start":137,"end":166,"loc":{"start":{"line":6,"column":2,"index":137},"end":{"line":6,"column":31,"index":166}},
"object": {
"type": "NumericLiteral",
"start":143,"end":144,"loc":{"start":{"line":6,"column":8,"index":143},"end":{"line":6,"column":9,"index":144}},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"body": {
"type": "VariableDeclaration",
"start":146,"end":166,"loc":{"start":{"line":6,"column":11,"index":146},"end":{"line":6,"column":31,"index":166}},
"declarations": [
{
"type": "VariableDeclarator",
"start":158,"end":165,"loc":{"start":{"line":6,"column":23,"index":158},"end":{"line":6,"column":30,"index":165}},
"id": {
"type": "Identifier",
"start":158,"end":159,"loc":{"start":{"line":6,"column":23,"index":158},"end":{"line":6,"column":24,"index":159},"identifierName":"e"},
"name": "e"
},
"init": {
"type": "Identifier",
"start":162,"end":165,"loc":{"start":{"line":6,"column":27,"index":162},"end":{"line":6,"column":30,"index":165},"identifierName":"foo"},
"name": "foo"
}
}
],
"kind": "await using"
}
},
{
"type": "LabeledStatement",
"start":169,"end":196,"loc":{"start":{"line":7,"column":2,"index":169},"end":{"line":7,"column":29,"index":196}},
"body": {
"type": "VariableDeclaration",
"start":176,"end":196,"loc":{"start":{"line":7,"column":9,"index":176},"end":{"line":7,"column":29,"index":196}},
"declarations": [
{
"type": "VariableDeclarator",
"start":188,"end":195,"loc":{"start":{"line":7,"column":21,"index":188},"end":{"line":7,"column":28,"index":195}},
"id": {
"type": "Identifier",
"start":188,"end":189,"loc":{"start":{"line":7,"column":21,"index":188},"end":{"line":7,"column":22,"index":189},"identifierName":"f"},
"name": "f"
},
"init": {
"type": "Identifier",
"start":192,"end":195,"loc":{"start":{"line":7,"column":25,"index":192},"end":{"line":7,"column":28,"index":195},"identifierName":"foo"},
"name": "foo"
}
}
],
"kind": "await using"
},
"label": {
"type": "Identifier",
"start":169,"end":174,"loc":{"start":{"line":7,"column":2,"index":169},"end":{"line":7,"column":7,"index":174},"identifierName":"label"},
"name": "label"
}
}
],
"directives": []
}
],
"directives": []
}
}