awv3
Version:
AWV client CAD framework
1,638 lines • 231 kB
JSON
{
"type": "Program",
"start": 0,
"end": 2564,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 78,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "VariableDeclaration",
"start": 74,
"end": 108,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 34
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 80,
"end": 107,
"loc": {
"start": {
"line": 2,
"column": 6
},
"end": {
"line": 2,
"column": 33
}
},
"id": {
"type": "Identifier",
"start": 80,
"end": 87,
"loc": {
"start": {
"line": 2,
"column": 6
},
"end": {
"line": 2,
"column": 13
}
},
"name": "resolve",
"leadingComments": null
},
"init": {
"type": "CallExpression",
"start": 90,
"end": 107,
"loc": {
"start": {
"line": 2,
"column": 16
},
"end": {
"line": 2,
"column": 33
}
},
"callee": {
"type": "Identifier",
"start": 90,
"end": 96,
"loc": {
"start": {
"line": 2,
"column": 16
},
"end": {
"line": 2,
"column": 22
}
},
"name": "Symbol"
},
"arguments": [
{
"type": "Literal",
"start": 97,
"end": 106,
"loc": {
"start": {
"line": 2,
"column": 23
},
"end": {
"line": 2,
"column": 32
}
},
"value": "resolve",
"rawValue": "resolve",
"raw": "'resolve'"
}
]
},
"leadingComments": null
}
],
"kind": "const",
"leadingComments": [
{
"type": "CommentLine",
"value": " Unique symbol to guarantee that external code can't resolve Statements",
"start": 0,
"end": 73,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 73
}
},
"range": [
0,
73
]
}
]
},
{
"type": "ClassDeclaration",
"start": 110,
"end": 688,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 27,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 116,
"end": 130,
"loc": {
"start": {
"line": 4,
"column": 6
},
"end": {
"line": 4,
"column": 20
}
},
"name": "StatementsBase"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 131,
"end": 688,
"loc": {
"start": {
"line": 4,
"column": 21
},
"end": {
"line": 27,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 137,
"end": 275,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 9,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 137,
"end": 148,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 15
}
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 148,
"end": 275,
"loc": {
"start": {
"line": 5,
"column": 15
},
"end": {
"line": 9,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 149,
"end": 157,
"loc": {
"start": {
"line": 5,
"column": 16
},
"end": {
"line": 5,
"column": 24
}
},
"name": "commands"
},
{
"type": "Identifier",
"start": 159,
"end": 166,
"loc": {
"start": {
"line": 5,
"column": 26
},
"end": {
"line": 5,
"column": 33
}
},
"name": "promise"
},
{
"type": "Identifier",
"start": 168,
"end": 171,
"loc": {
"start": {
"line": 5,
"column": 35
},
"end": {
"line": 5,
"column": 38
}
},
"name": "res"
}
],
"body": {
"type": "BlockStatement",
"start": 173,
"end": 275,
"loc": {
"start": {
"line": 5,
"column": 40
},
"end": {
"line": 9,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 183,
"end": 208,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 33
}
},
"expression": {
"type": "AssignmentExpression",
"start": 183,
"end": 207,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 32
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 183,
"end": 196,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 183,
"end": 187,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 188,
"end": 196,
"loc": {
"start": {
"line": 6,
"column": 13
},
"end": {
"line": 6,
"column": 21
}
},
"name": "commands"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 199,
"end": 207,
"loc": {
"start": {
"line": 6,
"column": 24
},
"end": {
"line": 6,
"column": 32
}
},
"name": "commands"
}
}
},
{
"type": "ExpressionStatement",
"start": 217,
"end": 240,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 31
}
},
"expression": {
"type": "AssignmentExpression",
"start": 217,
"end": 239,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 30
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 217,
"end": 229,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 20
}
},
"object": {
"type": "ThisExpression",
"start": 217,
"end": 221,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 222,
"end": 229,
"loc": {
"start": {
"line": 7,
"column": 13
},
"end": {
"line": 7,
"column": 20
}
},
"name": "promise"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 232,
"end": 239,
"loc": {
"start": {
"line": 7,
"column": 23
},
"end": {
"line": 7,
"column": 30
}
},
"name": "promise"
}
}
},
{
"type": "ExpressionStatement",
"start": 249,
"end": 269,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 28
}
},
"expression": {
"type": "AssignmentExpression",
"start": 249,
"end": 268,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 27
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 249,
"end": 262,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 249,
"end": 253,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 254,
"end": 261,
"loc": {
"start": {
"line": 8,
"column": 13
},
"end": {
"line": 8,
"column": 20
}
},
"name": "resolve"
},
"computed": true
},
"right": {
"type": "Identifier",
"start": 265,
"end": 268,
"loc": {
"start": {
"line": 8,
"column": 24
},
"end": {
"line": 8,
"column": 27
}
},
"name": "res"
}
}
}
]
}
}
},
{
"type": "MethodDefinition",
"start": 281,
"end": 384,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 13,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 281,
"end": 285,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 8
}
},
"name": "then"
},
"static": false,
"kind": "method",
"value": {
"type": "FunctionExpression",
"start": 285,
"end": 384,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 13,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 286,
"end": 297,
"loc": {
"start": {
"line": 11,
"column": 9
},
"end": {
"line": 11,
"column": 20
}
},
"name": "onFulfilled"
},
{
"type": "Identifier",
"start": 299,
"end": 309,
"loc": {
"start": {
"line": 11,
"column": 22
},
"end": {
"line": 11,
"column": 32
}
},
"name": "onRejected"
}
],
"body": {
"type": "BlockStatement",
"start": 311,
"end": 384,
"loc": {
"start": {
"line": 11,
"column": 34
},
"end": {
"line": 13,
"column": 5
}
},
"body": [
{
"type": "ReturnStatement",
"start": 321,
"end": 378,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 65
}
},
"argument": {
"type": "NewExpression",
"start": 328,
"end": 377,
"loc": {
"start": {
"line": 12,
"column": 15
},
"end": {
"line": 12,
"column": 64
}
},
"callee": {
"type": "Identifier",
"start": 332,
"end": 346,
"loc": {
"start": {
"line": 12,
"column": 19
},
"end": {
"line": 12,
"column": 33
}
},
"name": "StatementsThen"
},
"arguments": [
{
"type": "ThisExpression",
"start": 347,
"end": 351,
"loc": {
"start": {
"line": 12,
"column": 34
},
"end": {
"line": 12,
"column": 38
}
}
},
{
"type": "Identifier",
"start": 353,
"end": 364,
"loc": {
"start": {
"line": 12,
"column": 40
},
"end": {
"line": 12,
"column": 51
}
},
"name": "onFulfilled"
},
{
"type": "Identifier",
"start": 366,
"end": 376,
"loc": {
"start": {
"line": 12,
"column": 53
},
"end": {
"line": 12,
"column": 63
}
},
"name": "onRejected"
}
]
}
}
]
}
}
},
{
"type": "MethodDefinition",
"start": 390,
"end": 473,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 17,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 390,
"end": 393,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 7
}
},
"name": "and"
},
"static": false,
"kind": "method",
"value": {
"type": "FunctionExpression",
"start": 393,
"end": 473,
"loc": {
"start": {
"line": 15,
"column": 7
},
"end": {
"line": 17,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "RestElement",
"start": 394,
"end": 407,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 21
}
},
"argument": {
"type": "Identifier",
"start": 397,
"end": 407,
"loc": {
"start": {
"line": 15,
"column": 11
},
"end": {
"line": 15,
"column": 21
}
},
"name": "statements"
}
}
],
"body": {
"type": "BlockStatement",
"start": 409,
"end": 473,
"loc": {
"start": {
"line": 15,
"column": 23
},
"end": {
"line": 17,
"column": 5
}
},
"body": [
{
"type": "ReturnStatement",
"start": 419,
"end": 467,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 56
}
},
"argument": {
"type": "NewExpression",
"start": 426,
"end": 466,
"loc": {
"start": {
"line": 16,
"column": 15
},
"end": {
"line": 16,
"column": 55
}
},
"callee": {
"type": "Identifier",
"start": 430,
"end": 443,
"loc": {
"start": {
"line": 16,
"column": 19
},
"end": {
"line": 16,
"column": 32
}
},
"name": "StatementsAll"
},
"arguments": [
{
"type": "ArrayExpression",
"start": 444,
"end": 465,
"loc": {
"start": {
"line": 16,
"column": 33
},
"end": {
"line": 16,
"column": 54
}
},
"elements": [
{
"type": "ThisExpression",
"start": 445,
"end": 449,
"loc": {
"start": {
"line": 16,
"column": 34
},
"end": {
"line": 16,
"column": 38
}
}
},
{
"type": "SpreadElement",
"start": 451,
"end": 464,
"loc": {
"start": {
"line": 16,
"column": 40
},
"end": {
"line": 16,
"column": 53
}
},
"argument": {
"type": "Identifier",
"start": 454,
"end": 464,
"loc": {
"start": {
"line": 16,
"column": 43
},
"end": {
"line": 16,
"column": 53
}
},
"name": "statements"
}
}
]
}
]
}
}
]
}
}
},
{
"type": "MethodDefinition",
"start": 479,
"end": 555,
"loc": {
"start": {
"line": 19,
"column": 4
},
"end": {
"line": 21,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 486,
"end": 489,
"loc": {
"start": {
"line": 19,
"column": 11
},
"end": {
"line": 19,
"column": 14
}
},
"name": "all"
},
"static": true,
"kind": "method",
"value": {
"type": "FunctionExpression",
"start": 489,
"end": 555,
"loc": {
"start": {
"line": 19,
"column": 14
},
"end": {
"line": 21,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 490,
"end": 500,
"loc": {
"start": {
"line": 19,
"column": 15
},
"end": {
"line": 19,
"column": 25
}
},
"name": "statements"
}
],
"body": {
"type": "BlockStatement",
"start": 502,
"end": 555,
"loc": {
"start": {
"line": 19,
"column": 27
},
"end": {
"line": 21,
"column": 5
}
},
"body": [
{
"type": "ReturnStatement",
"start": 512,
"end": 549,
"loc": {
"start": {
"line": 20,
"column": 8
},
"end": {
"line": 20,
"column": 45
}
},
"argument": {
"type": "NewExpression",
"start": 519,
"end": 548,
"loc": {
"start": {
"line": 20,
"column": 15
},
"end": {
"line": 20,
"column": 44
}
},
"callee": {
"type": "Identifier",
"start": 523,
"end": 536,
"loc": {
"start": {
"line": 20,
"column": 19
},
"end": {
"line": 20,
"column": 32
}
},
"name": "StatementsAll"
},
"arguments": [
{
"type": "Identifier",
"start": 537,
"end": 547,
"loc": {
"start": {
"line": 20,
"column": 33
},
"end": {
"line": 20,
"column": 43
}
},
"name": "statements"
}
]
}
}
]
}
}
},
{
"type": "MethodDefinition",
"start": 561,
"end": 686,
"loc": {
"start": {
"line": 23,
"column": 4
},
"end": {
"line": 26,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 561,
"end": 568,
"loc": {
"start": {
"line": 23,
"column": 4
},
"end": {
"line": 23,
"column": 11
}
},
"name": "execute"
},
"static": false,
"kind": "method",
"value": {
"type": "FunctionExpression",
"start": 568,
"end": 686,
"loc": {
"start": {
"line": 23,
"column": 11
},
"end": {
"line": 26,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 569,
"end": 575,
"loc": {
"start": {
"line": 23,
"column": 12
},
"end": {
"line": 23,
"column": 18
}
},
"name": "socket"
},
{
"type": "Identifier",
"start": 577,
"end": 584,
"loc": {
"start": {
"line": 23,
"column": 20
},
"end": {
"line": 23,
"column": 27
}
},
"name": "factory"
}
],
"body": {
"type": "BlockStatement",
"start": 586,
"end": 686,
"loc": {
"start": {
"line": 23,
"column": 29
},
"end": {
"line": 26,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 596,
"end": 651,
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 63
}
},
"expression": {
"type": "CallExpression",
"start": 596,
"end": 650,
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 62
}
},
"callee": {
"type": "MemberExpression",
"start": 596,
"end": 609,
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 596,
"end": 600,
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 601,
"end": 608,
"loc": {
"start": {
"line": 24,
"column": 13
},
"end": {
"line": 24,
"column": 20
}
},
"name": "resolve"
},
"computed": true
},
"arguments": [
{
"type": "CallExpression",
"start": 610,
"end": 649,
"loc": {
"start": {
"line": 24,
"column": 22
},
"end": {
"line": 24,
"column": 61
}
},
"callee": {
"type": "Identifier",
"start": 610,
"end": 617,
"loc": {
"start": {
"line": 24,
"column": 22
},
"end": {
"line": 24,
"column": 29
}
},
"name": "execute"
},
"arguments": [
{
"type": "Identifier",
"start": 618,
"end": 624,
"loc": {
"start": {
"line": 24,
"column": 30
},
"end": {
"line": 24,
"column": 36
}
},
"name": "socket"
},
{
"type": "MemberExpression",
"start": 626,
"end": 639,
"loc": {
"start": {
"line": 24,
"column": 38
},
"end": {
"line": 24,
"column": 51
}
},
"object": {
"type": "ThisExpression",
"start": 626,
"end": 630,
"loc": {
"start": {
"line": 24,
"column": 38
},
"end": {
"line": 24,
"column": 42
}
}
},
"property": {
"type": "Identifier",
"start": 631,
"end": 639,
"loc": {
"start": {
"line": 24,
"column": 43
},
"end": {
"line": 24,
"column": 51
}
},
"name": "commands"
},
"computed": false
},
{
"type": "Identifier",
"start": 641,
"end": 648,
"loc": {
"start": {
"line": 24,
"column": 53
},
"end": {
"line": 24,
"column": 60
}
},
"name": "factory"
}
]
}
]
}
},
{
"type": "ReturnStatement",
"start": 660,
"end": 680,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 28
}
},
"argument": {
"type": "MemberExpression",
"start": 667,
"end": 679,
"loc": {
"start": {
"line": 25,
"column": 15
},
"end": {
"line": 25,
"column": 27
}
},
"object": {
"type": "ThisExpression",
"start": 667,
"end": 671,
"loc": {
"start": {
"line": 25,
"column": 15
},
"end": {
"line": 25,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"start": 672,
"end": 679,
"loc": {
"start": {
"line": 25,
"column": 20
},
"end": {
"line": 25,
"column": 27
}
},
"name": "promise"
},
"computed": false
}
}
]
}
}
}
]
}
},
{
"type": "ExportDefaultDeclaration",
"start": 690,
"end": 875,
"loc": {
"start": {
"line": 29,
"column": 0
},
"end": {
"line": 34,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 705,
"end": 875,
"loc": {
"start": {
"line": 29,
"column": 15
},
"end": {
"line": 34,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 711,
"end": 721,
"loc": {
"start": {
"line": 29,
"column": 21
},
"end": {
"line": 29,
"column": 31
}
},
"name": "Statements"
},
"superClass": {
"type": "Identifier",
"start": 730,
"end": 744,
"loc": {
"start": {
"line": 29,
"column": 40
},
"end": {
"line": 29,
"column": 54
}
},
"name": "StatementsBase"
},
"body": {
"type": "ClassBody",
"start": 745,
"end": 875,
"loc": {
"start": {
"line": 29,
"column": 55
},
"end": {
"line": 34,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 751,
"end": 873,
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 33,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 751,
"end": 762,
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 30,
"column": 15
}
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 762,
"end": 873,
"loc": {
"start": {
"line": 30,
"column": 15
},
"end": {
"line": 33,
"column": 5
}
},
"id": null,
"generator": false,
"e