{ "type": "Program", "statements": [ { "type": "ClassDeclaration", "definition": { "id": { "type": "Identifier", "name": "C", "decorators": [], "loc": { "start": { "line": 23, "column": 7 }, "end": { "line": 23, "column": 8 } } }, "superClass": null, "implements": [], "body": [ { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "constructor", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "kind": "constructor", "static": false, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "constructor", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "generator": false, "async": false, "expression": false, "params": [], "body": { "type": "BlockStatement", "statements": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 23, "column": 11 }, "end": { "line": 23, "column": 11 } } } ], "loc": { "start": { "line": 23, "column": 9 }, "end": { "line": 23, "column": 11 } } }, "loc": { "start": { "line": 23, "column": 1 }, "end": { "line": 23, "column": 11 } } }, { "type": "ClassDeclaration", "definition": { "id": { "type": "Identifier", "name": "ETSGLOBAL", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "superClass": null, "implements": [], "body": [ { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "_$init$_", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "kind": "method", "accessibility": "public", "static": true, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "_$init$_", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "generator": false, "async": false, "expression": false, "params": [], "body": { "type": "BlockStatement", "statements": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "foo", "decorators": [], "loc": { "start": { "line": 16, "column": 10 }, "end": { "line": 16, "column": 13 } } }, "kind": "method", "accessibility": "public", "static": true, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "foo", "decorators": [], "loc": { "start": { "line": 16, "column": 10 }, "end": { "line": 16, "column": 13 } } }, "generator": false, "async": false, "expression": false, "params": [ { "type": "ETSParameterExpression", "name": { "type": "Identifier", "name": "data", "typeAnnotation": { "type": "ETSUnionType", "types": [ { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "C", "decorators": [], "loc": { "start": { "line": 17, "column": 11 }, "end": { "line": 17, "column": 12 } } }, "loc": { "start": { "line": 17, "column": 11 }, "end": { "line": 17, "column": 14 } } }, "loc": { "start": { "line": 17, "column": 11 }, "end": { "line": 17, "column": 14 } } }, { "type": "ETSUndefinedType", "loc": { "start": { "line": 17, "column": 15 }, "end": { "line": 17, "column": 24 } } } ], "loc": { "start": { "line": 17, "column": 11 }, "end": { "line": 17, "column": 24 } } }, "decorators": [], "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 24 } } }, "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 24 } } }, { "type": "ETSParameterExpression", "name": { "type": "Identifier", "name": "exec", "typeAnnotation": { "type": "ETSFunctionType", "params": [ { "type": "ETSParameterExpression", "name": { "type": "Identifier", "name": "pointer", "typeAnnotation": { "type": "ETSUnionType", "types": [ { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "C", "decorators": [], "loc": { "start": { "line": 18, "column": 21 }, "end": { "line": 18, "column": 22 } } }, "loc": { "start": { "line": 18, "column": 21 }, "end": { "line": 18, "column": 24 } } }, "loc": { "start": { "line": 18, "column": 21 }, "end": { "line": 18, "column": 24 } } }, { "type": "ETSUndefinedType", "loc": { "start": { "line": 18, "column": 25 }, "end": { "line": 18, "column": 34 } } } ], "loc": { "start": { "line": 18, "column": 21 }, "end": { "line": 18, "column": 34 } } }, "decorators": [], "loc": { "start": { "line": 18, "column": 12 }, "end": { "line": 18, "column": 34 } } }, "loc": { "start": { "line": 18, "column": 12 }, "end": { "line": 18, "column": 34 } } } ], "returnType": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "R", "decorators": [], "loc": { "start": { "line": 18, "column": 39 }, "end": { "line": 18, "column": 40 } } }, "loc": { "start": { "line": 18, "column": 39 }, "end": { "line": 19, "column": 2 } } }, "loc": { "start": { "line": 18, "column": 39 }, "end": { "line": 19, "column": 2 } } }, "loc": { "start": { "line": 18, "column": 11 }, "end": { "line": 19, "column": 2 } } }, "decorators": [], "loc": { "start": { "line": 18, "column": 5 }, "end": { "line": 19, "column": 2 } } }, "loc": { "start": { "line": 18, "column": 5 }, "end": { "line": 19, "column": 2 } } } ], "returnType": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "R", "decorators": [], "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 5 } } }, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 7 } } }, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 7 } } }, "typeParameters": { "type": "TSTypeParameterDeclaration", "params": [ { "type": "TSTypeParameter", "name": { "type": "Identifier", "name": "C", "decorators": [], "loc": { "start": { "line": 16, "column": 14 }, "end": { "line": 16, "column": 15 } } }, "constraint": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "Uint8Array", "decorators": [], "loc": { "start": { "line": 16, "column": 24 }, "end": { "line": 16, "column": 34 } } }, "loc": { "start": { "line": 16, "column": 24 }, "end": { "line": 16, "column": 35 } } }, "loc": { "start": { "line": 16, "column": 24 }, "end": { "line": 16, "column": 35 } } }, "loc": { "start": { "line": 16, "column": 14 }, "end": { "line": 16, "column": 35 } } }, { "type": "TSTypeParameter", "name": { "type": "Identifier", "name": "R", "decorators": [], "loc": { "start": { "line": 16, "column": 36 }, "end": { "line": 16, "column": 37 } } }, "loc": { "start": { "line": 16, "column": 36 }, "end": { "line": 16, "column": 38 } } } ], "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 16, "column": 38 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "exec", "decorators": [], "loc": { "start": { "line": 20, "column": 12 }, "end": { "line": 20, "column": 16 } } }, "arguments": [ { "type": "LogicalExpression", "operator": "??", "left": { "type": "Identifier", "name": "data", "decorators": [], "loc": { "start": { "line": 20, "column": 17 }, "end": { "line": 20, "column": 21 } } }, "right": { "type": "UndefinedLiteral", "value": undefined, "loc": { "start": { "line": 20, "column": 25 }, "end": { "line": 20, "column": 34 } } }, "loc": { "start": { "line": 20, "column": 17 }, "end": { "line": 20, "column": 34 } } } ], "optional": false, "loc": { "start": { "line": 20, "column": 12 }, "end": { "line": 20, "column": 35 } } }, "loc": { "start": { "line": 20, "column": 5 }, "end": { "line": 20, "column": 36 } } } ], "loc": { "start": { "line": 19, "column": 6 }, "end": { "line": 21, "column": 2 } } }, "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 21, "column": 2 } } }, "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 21, "column": 2 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 16, "column": 1 }, "end": { "line": 21, "column": 2 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "bar", "decorators": [], "loc": { "start": { "line": 24, "column": 10 }, "end": { "line": 24, "column": 13 } } }, "kind": "method", "accessibility": "public", "static": true, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "bar", "decorators": [], "loc": { "start": { "line": 24, "column": 10 }, "end": { "line": 24, "column": 13 } } }, "generator": false, "async": false, "expression": false, "params": [ { "type": "ETSParameterExpression", "name": { "type": "Identifier", "name": "data", "typeAnnotation": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "T", "decorators": [], "loc": { "start": { "line": 24, "column": 35 }, "end": { "line": 24, "column": 36 } } }, "loc": { "start": { "line": 24, "column": 35 }, "end": { "line": 24, "column": 37 } } }, "loc": { "start": { "line": 24, "column": 35 }, "end": { "line": 24, "column": 37 } } }, "decorators": [], "loc": { "start": { "line": 24, "column": 29 }, "end": { "line": 24, "column": 37 } } }, "loc": { "start": { "line": 24, "column": 29 }, "end": { "line": 24, "column": 37 } } } ], "returnType": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, "column": 39 }, "end": { "line": 24, "column": 43 } } }, "typeParameters": { "type": "TSTypeParameterDeclaration", "params": [ { "type": "TSTypeParameter", "name": { "type": "Identifier", "name": "T", "decorators": [], "loc": { "start": { "line": 24, "column": 14 }, "end": { "line": 24, "column": 15 } } }, "constraint": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "Int", "decorators": [], "loc": { "start": { "line": 24, "column": 24 }, "end": { "line": 24, "column": 27 } } }, "loc": { "start": { "line": 24, "column": 24 }, "end": { "line": 24, "column": 28 } } }, "loc": { "start": { "line": 24, "column": 24 }, "end": { "line": 24, "column": 28 } } }, "loc": { "start": { "line": 24, "column": 14 }, "end": { "line": 24, "column": 28 } } } ], "loc": { "start": { "line": 24, "column": 13 }, "end": { "line": 24, "column": 28 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "c_class", "typeAnnotation": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "C", "decorators": [], "loc": { "start": { "line": 25, "column": 18 }, "end": { "line": 25, "column": 19 } } }, "loc": { "start": { "line": 25, "column": 18 }, "end": { "line": 25, "column": 21 } } }, "loc": { "start": { "line": 25, "column": 18 }, "end": { "line": 25, "column": 21 } } }, "decorators": [], "loc": { "start": { "line": 25, "column": 9 }, "end": { "line": 25, "column": 16 } } }, "init": { "type": "ETSNewClassInstanceExpression", "typeReference": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "C", "decorators": [], "loc": { "start": { "line": 25, "column": 26 }, "end": { "line": 25, "column": 27 } } }, "loc": { "start": { "line": 25, "column": 26 }, "end": { "line": 25, "column": 28 } } }, "loc": { "start": { "line": 25, "column": 26 }, "end": { "line": 25, "column": 28 } } }, "arguments": [], "loc": { "start": { "line": 25, "column": 22 }, "end": { "line": 25, "column": 30 } } }, "loc": { "start": { "line": 25, "column": 9 }, "end": { "line": 25, "column": 30 } } } ], "kind": "let", "loc": { "start": { "line": 25, "column": 5 }, "end": { "line": 25, "column": 30 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "myvar", "typeAnnotation": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "Object", "decorators": [], "loc": { "start": { "line": 26, "column": 16 }, "end": { "line": 26, "column": 22 } } }, "loc": { "start": { "line": 26, "column": 16 }, "end": { "line": 26, "column": 24 } } }, "loc": { "start": { "line": 26, "column": 16 }, "end": { "line": 26, "column": 24 } } }, "decorators": [], "loc": { "start": { "line": 26, "column": 9 }, "end": { "line": 26, "column": 14 } } }, "init": { "type": "LogicalExpression", "operator": "??", "left": { "type": "Identifier", "name": "data", "decorators": [], "loc": { "start": { "line": 26, "column": 25 }, "end": { "line": 26, "column": 29 } } }, "right": { "type": "Identifier", "name": "c_class", "decorators": [], "loc": { "start": { "line": 26, "column": 33 }, "end": { "line": 26, "column": 40 } } }, "loc": { "start": { "line": 26, "column": 25 }, "end": { "line": 26, "column": 40 } } }, "loc": { "start": { "line": 26, "column": 9 }, "end": { "line": 26, "column": 40 } } } ], "kind": "let", "loc": { "start": { "line": 26, "column": 5 }, "end": { "line": 26, "column": 41 } } } ], "loc": { "start": { "line": 24, "column": 44 }, "end": { "line": 27, "column": 2 } } }, "loc": { "start": { "line": 24, "column": 13 }, "end": { "line": 27, "column": 2 } } }, "loc": { "start": { "line": 24, "column": 13 }, "end": { "line": 27, "column": 2 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 24, "column": 1 }, "end": { "line": 27, "column": 2 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "baz", "decorators": [], "loc": { "start": { "line": 29, "column": 10 }, "end": { "line": 29, "column": 13 } } }, "kind": "method", "accessibility": "public", "static": true, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "baz", "decorators": [], "loc": { "start": { "line": 29, "column": 10 }, "end": { "line": 29, "column": 13 } } }, "generator": false, "async": false, "expression": false, "params": [ { "type": "ETSParameterExpression", "name": { "type": "Identifier", "name": "a0", "typeAnnotation": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "T", "decorators": [], "loc": { "start": { "line": 29, "column": 33 }, "end": { "line": 29, "column": 34 } } }, "loc": { "start": { "line": 29, "column": 33 }, "end": { "line": 29, "column": 35 } } }, "loc": { "start": { "line": 29, "column": 33 }, "end": { "line": 29, "column": 35 } } }, "decorators": [], "loc": { "start": { "line": 29, "column": 29 }, "end": { "line": 29, "column": 35 } } }, "loc": { "start": { "line": 29, "column": 29 }, "end": { "line": 29, "column": 35 } } } ], "returnType": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "Integral", "decorators": [], "loc": { "start": { "line": 29, "column": 37 }, "end": { "line": 29, "column": 45 } } }, "loc": { "start": { "line": 29, "column": 37 }, "end": { "line": 29, "column": 47 } } }, "loc": { "start": { "line": 29, "column": 37 }, "end": { "line": 29, "column": 47 } } }, "typeParameters": { "type": "TSTypeParameterDeclaration", "params": [ { "type": "TSTypeParameter", "name": { "type": "Identifier", "name": "T", "decorators": [], "loc": { "start": { "line": 29, "column": 14 }, "end": { "line": 29, "column": 15 } } }, "constraint": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "Int", "decorators": [], "loc": { "start": { "line": 29, "column": 24 }, "end": { "line": 29, "column": 27 } } }, "loc": { "start": { "line": 29, "column": 24 }, "end": { "line": 29, "column": 28 } } }, "loc": { "start": { "line": 29, "column": 24 }, "end": { "line": 29, "column": 28 } } }, "loc": { "start": { "line": 29, "column": 14 }, "end": { "line": 29, "column": 28 } } } ], "loc": { "start": { "line": 29, "column": 13 }, "end": { "line": 29, "column": 28 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "myval", "typeAnnotation": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "Short", "decorators": [], "loc": { "start": { "line": 30, "column": 16 }, "end": { "line": 30, "column": 21 } } }, "loc": { "start": { "line": 30, "column": 16 }, "end": { "line": 30, "column": 23 } } }, "loc": { "start": { "line": 30, "column": 16 }, "end": { "line": 30, "column": 23 } } }, "decorators": [], "loc": { "start": { "line": 30, "column": 9 }, "end": { "line": 30, "column": 14 } } }, "init": { "type": "NumberLiteral", "value": 2, "loc": { "start": { "line": 30, "column": 24 }, "end": { "line": 30, "column": 25 } } }, "loc": { "start": { "line": 30, "column": 9 }, "end": { "line": 30, "column": 25 } } } ], "kind": "let", "loc": { "start": { "line": 30, "column": 5 }, "end": { "line": 30, "column": 26 } } }, { "type": "ReturnStatement", "argument": { "type": "LogicalExpression", "operator": "??", "left": { "type": "Identifier", "name": "a0", "decorators": [], "loc": { "start": { "line": 31, "column": 12 }, "end": { "line": 31, "column": 14 } } }, "right": { "type": "Identifier", "name": "myval", "decorators": [], "loc": { "start": { "line": 31, "column": 18 }, "end": { "line": 31, "column": 23 } } }, "loc": { "start": { "line": 31, "column": 12 }, "end": { "line": 31, "column": 23 } } }, "loc": { "start": { "line": 31, "column": 5 }, "end": { "line": 31, "column": 24 } } } ], "loc": { "start": { "line": 29, "column": 46 }, "end": { "line": 32, "column": 2 } } }, "loc": { "start": { "line": 29, "column": 13 }, "end": { "line": 32, "column": 2 } } }, "loc": { "start": { "line": 29, "column": 13 }, "end": { "line": 32, "column": 2 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 29, "column": 1 }, "end": { "line": 32, "column": 2 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 33, "column": 1 } } }