awv3
Version:
⚡ AWV3 embedded CAD
1,374 lines (1,373 loc) • 134 kB
JSON
{
"type": "File",
"start": 0,
"end": 1099,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 28,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 1099,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 28,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ExportDefaultDeclaration",
"start": 491,
"end": 908,
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 21,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 506,
"end": 908,
"loc": {
"start": {
"line": 9,
"column": 15
},
"end": {
"line": 21,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 512,
"end": 523,
"loc": {
"start": {
"line": 9,
"column": 21
},
"end": {
"line": 9,
"column": 32
},
"identifierName": "MultiRunner"
},
"name": "MultiRunner",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 524,
"end": 908,
"loc": {
"start": {
"line": 9,
"column": 33
},
"end": {
"line": 21,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 530,
"end": 664,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 14,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 530,
"end": 541,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 542,
"end": 555,
"loc": {
"start": {
"line": 10,
"column": 16
},
"end": {
"line": 10,
"column": 29
},
"identifierName": "commandRunner"
},
"name": "commandRunner"
}
],
"body": {
"type": "BlockStatement",
"start": 557,
"end": 664,
"loc": {
"start": {
"line": 10,
"column": 31
},
"end": {
"line": 14,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 567,
"end": 602,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 43
}
},
"expression": {
"type": "AssignmentExpression",
"start": 567,
"end": 601,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 42
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 567,
"end": 585,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 26
}
},
"object": {
"type": "ThisExpression",
"start": 567,
"end": 571,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 572,
"end": 585,
"loc": {
"start": {
"line": 11,
"column": 13
},
"end": {
"line": 11,
"column": 26
},
"identifierName": "commandRunner"
},
"name": "commandRunner"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 588,
"end": 601,
"loc": {
"start": {
"line": 11,
"column": 29
},
"end": {
"line": 11,
"column": 42
},
"identifierName": "commandRunner"
},
"name": "commandRunner"
}
}
},
{
"type": "ExpressionStatement",
"start": 611,
"end": 630,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 27
}
},
"expression": {
"type": "AssignmentExpression",
"start": 611,
"end": 629,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 26
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 611,
"end": 624,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 611,
"end": 615,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 616,
"end": 624,
"loc": {
"start": {
"line": 12,
"column": 13
},
"end": {
"line": 12,
"column": 21
},
"identifierName": "commands"
},
"name": "commands"
},
"computed": false
},
"right": {
"type": "ArrayExpression",
"start": 627,
"end": 629,
"loc": {
"start": {
"line": 12,
"column": 24
},
"end": {
"line": 12,
"column": 26
}
},
"elements": []
}
}
},
{
"type": "ExpressionStatement",
"start": 639,
"end": 658,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 27
}
},
"expression": {
"type": "AssignmentExpression",
"start": 639,
"end": 657,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 26
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 639,
"end": 652,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 639,
"end": 643,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 644,
"end": 652,
"loc": {
"start": {
"line": 13,
"column": 13
},
"end": {
"line": 13,
"column": 21
},
"identifierName": "resolves"
},
"name": "resolves"
},
"computed": false
},
"right": {
"type": "ArrayExpression",
"start": 655,
"end": 657,
"loc": {
"start": {
"line": 13,
"column": 24
},
"end": {
"line": 13,
"column": 26
}
},
"elements": []
}
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 670,
"end": 906,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 20,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 670,
"end": 673,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 7
},
"identifierName": "run"
},
"name": "run"
},
"static": false,
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 674,
"end": 681,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 15
},
"identifierName": "command"
},
"name": "command"
}
],
"body": {
"type": "BlockStatement",
"start": 683,
"end": 906,
"loc": {
"start": {
"line": 16,
"column": 17
},
"end": {
"line": 20,
"column": 5
}
},
"body": [
{
"type": "IfStatement",
"start": 693,
"end": 832,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 18,
"column": 100
}
},
"test": {
"type": "BinaryExpression",
"start": 697,
"end": 730,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 45
}
},
"left": {
"type": "CallExpression",
"start": 697,
"end": 724,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 39
}
},
"callee": {
"type": "MemberExpression",
"start": 697,
"end": 715,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 30
}
},
"object": {
"type": "MemberExpression",
"start": 697,
"end": 710,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 25
}
},
"object": {
"type": "ThisExpression",
"start": 697,
"end": 701,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 16
}
}
},
"property": {
"type": "Identifier",
"start": 702,
"end": 710,
"loc": {
"start": {
"line": 17,
"column": 17
},
"end": {
"line": 17,
"column": 25
},
"identifierName": "commands"
},
"name": "commands"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 711,
"end": 715,
"loc": {
"start": {
"line": 17,
"column": 26
},
"end": {
"line": 17,
"column": 30
},
"identifierName": "push"
},
"name": "push"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 716,
"end": 723,
"loc": {
"start": {
"line": 17,
"column": 31
},
"end": {
"line": 17,
"column": 38
},
"identifierName": "command"
},
"name": "command"
}
]
},
"operator": "===",
"right": {
"type": "NumericLiteral",
"start": 729,
"end": 730,
"loc": {
"start": {
"line": 17,
"column": 44
},
"end": {
"line": 17,
"column": 45
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
}
},
"consequent": {
"type": "ExpressionStatement",
"start": 744,
"end": 832,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 100
}
},
"expression": {
"type": "CallExpression",
"start": 744,
"end": 831,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 99
}
},
"callee": {
"type": "MemberExpression",
"start": 744,
"end": 761,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 29
}
},
"object": {
"type": "Identifier",
"start": 744,
"end": 750,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 18
},
"identifierName": "window"
},
"name": "window"
},
"property": {
"type": "Identifier",
"start": 751,
"end": 761,
"loc": {
"start": {
"line": 18,
"column": 19
},
"end": {
"line": 18,
"column": 29
},
"identifierName": "setTimeout"
},
"name": "setTimeout"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 762,
"end": 777,
"loc": {
"start": {
"line": 18,
"column": 30
},
"end": {
"line": 18,
"column": 45
},
"identifierName": "resolveCommands"
},
"name": "resolveCommands"
},
{
"type": "NumericLiteral",
"start": 779,
"end": 780,
"loc": {
"start": {
"line": 18,
"column": 47
},
"end": {
"line": 18,
"column": 48
}
},
"extra": {
"rawValue": 0,
"raw": "0"
},
"value": 0
},
{
"type": "MemberExpression",
"start": 782,
"end": 800,
"loc": {
"start": {
"line": 18,
"column": 50
},
"end": {
"line": 18,
"column": 68
}
},
"object": {
"type": "ThisExpression",
"start": 782,
"end": 786,
"loc": {
"start": {
"line": 18,
"column": 50
},
"end": {
"line": 18,
"column": 54
}
}
},
"property": {
"type": "Identifier",
"start": 787,
"end": 800,
"loc": {
"start": {
"line": 18,
"column": 55
},
"end": {
"line": 18,
"column": 68
},
"identifierName": "commandRunner"
},
"name": "commandRunner"
},
"computed": false
},
{
"type": "MemberExpression",
"start": 802,
"end": 815,
"loc": {
"start": {
"line": 18,
"column": 70
},
"end": {
"line": 18,
"column": 83
}
},
"object": {
"type": "ThisExpression",
"start": 802,
"end": 806,
"loc": {
"start": {
"line": 18,
"column": 70
},
"end": {
"line": 18,
"column": 74
}
}
},
"property": {
"type": "Identifier",
"start": 807,
"end": 815,
"loc": {
"start": {
"line": 18,
"column": 75
},
"end": {
"line": 18,
"column": 83
},
"identifierName": "commands"
},
"name": "commands"
},
"computed": false
},
{
"type": "MemberExpression",
"start": 817,
"end": 830,
"loc": {
"start": {
"line": 18,
"column": 85
},
"end": {
"line": 18,
"column": 98
}
},
"object": {
"type": "ThisExpression",
"start": 817,
"end": 821,
"loc": {
"start": {
"line": 18,
"column": 85
},
"end": {
"line": 18,
"column": 89
}
}
},
"property": {
"type": "Identifier",
"start": 822,
"end": 830,
"loc": {
"start": {
"line": 18,
"column": 90
},
"end": {
"line": 18,
"column": 98
},
"identifierName": "resolves"
},
"name": "resolves"
},
"computed": false
}
]
}
},
"alternate": null
},
{
"type": "ReturnStatement",
"start": 841,
"end": 900,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 67
}
},
"argument": {
"type": "NewExpression",
"start": 848,
"end": 899,
"loc": {
"start": {
"line": 19,
"column": 15
},
"end": {
"line": 19,
"column": 66
}
},
"callee": {
"type": "Identifier",
"start": 852,
"end": 859,
"loc": {
"start": {
"line": 19,
"column": 19
},
"end": {
"line": 19,
"column": 26
},
"identifierName": "Promise"
},
"name": "Promise"
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 860,
"end": 898,
"loc": {
"start": {
"line": 19,
"column": 27
},
"end": {
"line": 19,
"column": 65
}
},
"id": null,
"generator": false,
"expression": true,
"async": false,
"params": [
{
"type": "Identifier",
"start": 860,
"end": 867,
"loc": {
"start": {
"line": 19,
"column": 27
},
"end": {
"line": 19,
"column": 34
},
"identifierName": "resolve"
},
"name": "resolve"
}
],
"body": {
"type": "CallExpression",
"start": 871,
"end": 898,
"loc": {
"start": {
"line": 19,
"column": 38
},
"end": {
"line": 19,
"column": 65
}
},
"callee": {
"type": "MemberExpression",
"start": 871,
"end": 889,
"loc": {
"start": {
"line": 19,
"column": 38
},
"end": {
"line": 19,
"column": 56
}
},
"object": {
"type": "MemberExpression",
"start": 871,
"end": 884,
"loc": {
"start": {
"line": 19,
"column": 38
},
"end": {
"line": 19,
"column": 51
}
},
"object": {
"type": "ThisExpression",
"start": 871,
"end": 875,
"loc": {
"start": {
"line": 19,
"column": 38
},
"end": {
"line": 19,
"column": 42
}
}
},
"property": {
"type": "Identifier",
"start": 876,
"end": 884,
"loc": {
"start": {
"line": 19,
"column": 43
},
"end": {
"line": 19,
"column": 51
},
"identifierName": "resolves"
},
"name": "resolves"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 885,
"end": 889,
"loc": {
"start": {
"line": 19,
"column": 52
},
"end": {
"line": 19,
"column": 56
},
"identifierName": "push"
},
"name": "push"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 890,
"end": 897,
"loc": {
"start": {
"line": 19,
"column": 57
},
"end": {
"line": 19,
"column": 64
},
"identifierName": "resolve"
},
"name": "resolve"
}
]
}
}
]
}
}
],
"directives": []
}
}
]
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "\n * Combine multiple calls to run (e.g. session.request) into minimal number of group calls.\n * All calls to run will be remembered and executed at once at the next macrotask\n * (i.e. after all already resolved promises/async functions are executed).\n * commandRunner must be a function that accepts an array of arguments (commands)\n * and returns an array of results (possibly promises) of the same length.\n * It's intented to use a wrapper around session.execute as a commandRunner.\n ",
"start": 0,
"end": 490,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 8,
"column": 3
}
}
}
],
"trailingComments": []
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "\n * Combine multiple calls to run (e.g. session.request) into minimal number of group calls.\n * All calls to run will be remembered and executed at once at the next macrotask\n * (i.e. after all already resolved promises/async functions are executed).\n * commandRunner must be a function that accepts an array of arguments (commands)\n * and returns an array of results (possibly promises) of the same length.\n * It's intented to use a wrapper around session.execute as a commandRunner.\n ",
"start": 0,
"end": 490,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 8,
"column": 3
}
}
}
]
},
{
"type": "FunctionDeclaration",
"start": 910,
"end": 1098,
"loc": {
"start": {
"line": 23,
"column": 0
},
"end": {
"line": 27,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 919,
"end": 934,
"loc": {
"start": {
"line": 23,
"column": 9
},
"end": {
"line": 23,
"column": 24
},
"identifierName": "resolveCommands"
},
"name": "resolveCommands"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 935,
"end": 948,
"loc": {
"start": {
"line": 23,
"column": 25
},
"end": {
"line": 23,
"column": 38
},
"identifierName": "commandRunner"
},
"name": "commandRunner"
},
{
"type": "Identifier",
"start": 950,
"end": 958,
"loc": {
"start": {
"line": 23,
"column": 40
},
"end": {
"line": 23,
"column": 48
},
"identifierName": "commands"
},
"name": "commands"
},
{
"type": "Identifier",
"start": 960,
"end": 968,
"loc": {
"start": {
"line": 23,
"column": 50
},
"end": {
"line": 23,
"column": 58
},
"identifierName": "resolves"
},
"name": "resolves"
}
],
"body": {
"type": "BlockStatement",
"start": 970,
"end": 1098,
"loc": {
"start": {
"line": 23,
"column": 60
},
"end": {
"line": 27,
"column": 1
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 976,
"end": 1048,
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 24,
"column": 76
}
},
"expression": {
"type": "CallExpression",
"start": 976,
"end": 1047,
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 24,
"column": 75
}
},
"callee": {
"type": "MemberExpression",
"start": 976,
"end": 1007,
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 24,
"column": 35
}
},
"object": {
"type": "CallExpression",
"start": 976,
"end": 999,
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 24,
"column": 27
}
},
"callee": {
"type": "Identifier",
"start": 976,
"end": 989,
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 24,
"column": 17