mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 19:09:18 +08:00
refactor test code
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
/// <reference path="./mozilla-spidermonkey-parser-api.d.ts" />
|
||||
|
||||
var literal:spiderMonkeyParserAPI.Syntax.Literal = {
|
||||
import Syntax = spiderMonkeyParserAPI.Syntax;
|
||||
|
||||
var literal:Syntax.Literal = {
|
||||
loc: {
|
||||
source: null,
|
||||
start: {
|
||||
@@ -17,26 +19,26 @@ var literal:spiderMonkeyParserAPI.Syntax.Literal = {
|
||||
};
|
||||
|
||||
// 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:spiderMonkeyParserAPI.Syntax.Program = {
|
||||
var program:Syntax.Program = {
|
||||
"type": "Program",
|
||||
"body": [
|
||||
<spiderMonkeyParserAPI.Syntax.Expression>{
|
||||
<Syntax.Expression>{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": <spiderMonkeyParserAPI.Syntax.Literal>{
|
||||
"expression": <Syntax.Literal>{
|
||||
"type": "Literal",
|
||||
"value": "use strict",
|
||||
"raw": "\"use strict\""
|
||||
}
|
||||
},
|
||||
<spiderMonkeyParserAPI.Syntax.FunctionDeclaration>{
|
||||
<Syntax.FunctionDeclaration>{
|
||||
"type": "FunctionDeclaration",
|
||||
"id": <spiderMonkeyParserAPI.Syntax.Identifier>{
|
||||
"id": <Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "Test"
|
||||
},
|
||||
"params": [],
|
||||
"defaults": [],
|
||||
"body": <spiderMonkeyParserAPI.Syntax.BlockStatement>{
|
||||
"body": <Syntax.BlockStatement>{
|
||||
"type": "BlockStatement",
|
||||
"body": []
|
||||
},
|
||||
@@ -44,61 +46,61 @@ var program:spiderMonkeyParserAPI.Syntax.Program = {
|
||||
"generator": false,
|
||||
"expression": false
|
||||
},
|
||||
<spiderMonkeyParserAPI.Syntax.Expression>{
|
||||
<Syntax.Expression>{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": <spiderMonkeyParserAPI.Syntax.AssignmentExpression>{
|
||||
"expression": <Syntax.AssignmentExpression>{
|
||||
"type": "AssignmentExpression",
|
||||
"operator": "=",
|
||||
"left": <spiderMonkeyParserAPI.Syntax.MemberExpression>{
|
||||
"left": <Syntax.MemberExpression>{
|
||||
"type": "MemberExpression",
|
||||
"computed": false,
|
||||
"object": <spiderMonkeyParserAPI.Syntax.MemberExpression>{
|
||||
"object": <Syntax.MemberExpression>{
|
||||
"type": "MemberExpression",
|
||||
"computed": false,
|
||||
"object": <spiderMonkeyParserAPI.Syntax.Identifier>{
|
||||
"object": <Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "Test"
|
||||
},
|
||||
"property": <spiderMonkeyParserAPI.Syntax.Identifier>{
|
||||
"property": <Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "prototype"
|
||||
}
|
||||
},
|
||||
"property": <spiderMonkeyParserAPI.Syntax.Identifier>{
|
||||
"property": <Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "hello"
|
||||
}
|
||||
},
|
||||
"right": <spiderMonkeyParserAPI.Syntax.FunctionExpression>{
|
||||
"right": <Syntax.FunctionExpression>{
|
||||
"type": "FunctionExpression",
|
||||
"id": null,
|
||||
"params": [
|
||||
<spiderMonkeyParserAPI.Syntax.Identifier>{
|
||||
<Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "word"
|
||||
}
|
||||
],
|
||||
"defaults": [],
|
||||
"body": <spiderMonkeyParserAPI.Syntax.BlockStatement>{
|
||||
"body": <Syntax.BlockStatement>{
|
||||
"type": "BlockStatement",
|
||||
"body": [
|
||||
<spiderMonkeyParserAPI.Syntax.Expression>{
|
||||
<Syntax.Expression>{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": <spiderMonkeyParserAPI.Syntax.AssignmentExpression>{
|
||||
"expression": <Syntax.AssignmentExpression>{
|
||||
"type": "AssignmentExpression",
|
||||
"operator": "=",
|
||||
"left": <spiderMonkeyParserAPI.Syntax.Identifier>{
|
||||
"left": <Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "word"
|
||||
},
|
||||
"right": <spiderMonkeyParserAPI.Syntax.LogicalExpression>{
|
||||
"right": <Syntax.LogicalExpression>{
|
||||
"type": "LogicalExpression",
|
||||
"operator": "||",
|
||||
"left": <spiderMonkeyParserAPI.Syntax.Identifier>{
|
||||
"left": <Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "word"
|
||||
},
|
||||
"right": <spiderMonkeyParserAPI.Syntax.Literal>{
|
||||
"right": <Syntax.Literal>{
|
||||
"type": "Literal",
|
||||
"value": "TypeScript",
|
||||
"raw": "\"TypeScript\""
|
||||
@@ -106,7 +108,7 @@ var program:spiderMonkeyParserAPI.Syntax.Program = {
|
||||
}
|
||||
}
|
||||
},
|
||||
<spiderMonkeyParserAPI.Syntax.ReturnStatement>{
|
||||
<Syntax.ReturnStatement>{
|
||||
"type": "ReturnStatement",
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
|
||||
Reference in New Issue
Block a user