swc/crates/swc_ecma_parser/tests/js/explicit-resource-management/valid-using-as-identifier-computed-member/input.js.json
Donny/강동윤 041b491466
feat(es/parser): Implement explicit resource management (#7322)
**Description:**

 - Add `UsingDecl`.
 - Add `UsingDecl` to `Decl`.
 - Rename `VarDeclOrPat` to `ForHead`.
 - Add `UsingDecl` to `ForHead`.
 - Implement parser for using declarations.

**Related issue:**

 - #7316.
2023-05-10 04:16:44 +00:00

137 lines
2.7 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 38,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 1,
"end": 15,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1,
"end": 14,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 1,
"end": 10,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1,
"end": 6,
"ctxt": 0
},
"value": "using",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 7,
"end": 10,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 8,
"end": 9,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "ForOfStatement",
"span": {
"start": 16,
"end": 38,
"ctxt": 0
},
"await": false,
"left": {
"type": "MemberExpression",
"span": {
"start": 21,
"end": 30,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 21,
"end": 26,
"ctxt": 0
},
"value": "using",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 27,
"end": 30,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 28,
"end": 29,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 34,
"end": 36,
"ctxt": 0
},
"elements": []
},
"body": {
"type": "EmptyStatement",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
}
}
}
],
"interpreter": null
}