/// import Syntax = spiderMonkeyParserAPI.Syntax; var literal:Syntax.Literal = { loc: { source: null, start: { line: 1, column: 10 }, end: { line: 1, column: 12 } }, type: "Literal", value: 42 }; // generated by http://esprima.org/demo/parse.html?code=%22use%20strict%22%3B%0A%0Afunction%20Test%20()%20%7B%0A%7D%0A%0ATest.prototype.hello%20%3D%20function(word)%20%7B%0A%09word%20%3D%20word%20%7C%7C%20%22TypeScript%22%3B%0A%09return%20word%3B%0A%7D%3B%0A var program:Syntax.Program = { "type": "Program", "body": [ { "type": "ExpressionStatement", "expression": { "type": "Literal", "value": "use strict", "raw": "\"use strict\"" } }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "Test" }, "params": [], "defaults": [], "body": { "type": "BlockStatement", "body": [] }, "rest": null, "generator": false, "expression": false }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Test" }, "property": { "type": "Identifier", "name": "prototype" } }, "property": { "type": "Identifier", "name": "hello" } }, "right": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "word" } ], "defaults": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "word" }, "right": { "type": "LogicalExpression", "operator": "||", "left": { "type": "Identifier", "name": "word" }, "right": { "type": "Literal", "value": "TypeScript", "raw": "\"TypeScript\"" } } } }, { "type": "ReturnStatement", "argument": { "type": "Identifier", "name": "word" } } ] }, "rest": null, "generator": false, "expression": false } } } ] };