123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- define(["esprima"], function (esprima) {
- // return esprima.parse("function a(){ [a] = () => 0; new.target; `test`; `hello,${name}`; }");
- return {
- "type": "Program",
- "body": [
- {
- "type": "FunctionDeclaration",
- "id": {
- "type": "Identifier",
- "name": "a"
- },
- "params": [],
- "defaults": [],
- "body": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "AssignmentExpression",
- "operator": "=",
- "left": {
- "type": "ArrayPattern",
- "elements": [
- {
- "type": "Identifier",
- "name": "a"
- }
- ]
- },
- "right": {
- "type": "ArrowFunctionExpression",
- "params": [],
- "defaults": [],
- "rest": null,
- "body": {
- "type": "Literal",
- "value": 0,
- "raw": "0"
- },
- "generator": false,
- "expression": false
- }
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "MetaProperty",
- "meta": {
- "type": "Identifier",
- "name": "new",
- },
- "property": {
- "type": "Identifier",
- "name": "target",
- },
- },
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "TemplateLiteral",
- "quasis": [
- {
- "type": "TemplateElement",
- "value": {
- "raw": "test",
- "cooked": "test"
- },
- "tail": true,
- }
- ],
- "expressions": [],
- },
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "TemplateLiteral",
- "quasis": [
- {
- "type": "TemplateElement",
- "value": {
- "raw": "hello,",
- "cooked": "hello,"
- },
- "tail": false,
- },
- {
- "type": "TemplateElement",
- "value": {
- "raw": "",
- "cooked": ""
- },
- "tail": true,
- }
- ],
- "expressions": [
- {
- "type": "Identifier",
- "name": "name",
- }
- ],
- },
- }
- ]
- },
- "rest": null,
- "generator": false,
- "expression": false
- }
- ]
- };
- });
|