dirtybomb
Version:
A dirty bomb model
1,513 lines • 860 kB
JSON
{
"type": "Program",
"body": [
{
"type": "Identifier",
"id": {
"type": "Identifier",
"name": "Vector",
"range": [
143,
149
],
"loc": {
"start": {
"line": 13,
"column": 9
},
"end": {
"line": 13,
"column": 15
}
}
},
"params": [
{
"type": "Identifier",
"name": "x",
"range": [
150,
151
],
"loc": {
"start": {
"line": 13,
"column": 16
},
"end": {
"line": 13,
"column": 17
}
}
},
{
"type": "Identifier",
"name": "y",
"range": [
153,
154
],
"loc": {
"start": {
"line": 13,
"column": 19
},
"end": {
"line": 13,
"column": 20
}
}
},
{
"type": "Identifier",
"name": "z",
"range": [
156,
157
],
"loc": {
"start": {
"line": 13,
"column": 22
},
"end": {
"line": 13,
"column": 23
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
165,
169
],
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"name": "x",
"range": [
170,
171
],
"loc": {
"start": {
"line": 14,
"column": 9
},
"end": {
"line": 14,
"column": 10
}
}
},
"range": [
165,
171
],
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 10
}
}
},
"right": {
"type": "LogicalExpression",
"operator": "||",
"left": {
"type": "Identifier",
"name": "x",
"range": [
174,
175
],
"loc": {
"start": {
"line": 14,
"column": 13
},
"end": {
"line": 14,
"column": 14
}
}
},
"right": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
179,
180
],
"loc": {
"start": {
"line": 14,
"column": 18
},
"end": {
"line": 14,
"column": 19
}
}
},
"range": [
174,
180
],
"loc": {
"start": {
"line": 14,
"column": 13
},
"end": {
"line": 14,
"column": 19
}
}
},
"range": [
165,
180
],
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 19
}
}
},
"range": [
165,
181
],
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 20
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
186,
190
],
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"name": "y",
"range": [
191,
192
],
"loc": {
"start": {
"line": 15,
"column": 9
},
"end": {
"line": 15,
"column": 10
}
}
},
"range": [
186,
192
],
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 10
}
}
},
"right": {
"type": "LogicalExpression",
"operator": "||",
"left": {
"type": "Identifier",
"name": "y",
"range": [
195,
196
],
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 15,
"column": 14
}
}
},
"right": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
200,
201
],
"loc": {
"start": {
"line": 15,
"column": 18
},
"end": {
"line": 15,
"column": 19
}
}
},
"range": [
195,
201
],
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 15,
"column": 19
}
}
},
"range": [
186,
201
],
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 19
}
}
},
"range": [
186,
202
],
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 20
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
207,
211
],
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"name": "z",
"range": [
212,
213
],
"loc": {
"start": {
"line": 16,
"column": 9
},
"end": {
"line": 16,
"column": 10
}
}
},
"range": [
207,
213
],
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 10
}
}
},
"right": {
"type": "LogicalExpression",
"operator": "||",
"left": {
"type": "Identifier",
"name": "z",
"range": [
216,
217
],
"loc": {
"start": {
"line": 16,
"column": 13
},
"end": {
"line": 16,
"column": 14
}
}
},
"right": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
221,
222
],
"loc": {
"start": {
"line": 16,
"column": 18
},
"end": {
"line": 16,
"column": 19
}
}
},
"range": [
216,
222
],
"loc": {
"start": {
"line": 16,
"column": 13
},
"end": {
"line": 16,
"column": 19
}
}
},
"range": [
207,
222
],
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 19
}
}
},
"range": [
207,
223
],
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 20
}
}
}
],
"range": [
159,
225
],
"loc": {
"start": {
"line": 13,
"column": 25
},
"end": {
"line": 17,
"column": 1
}
}
},
"generator": false,
"expression": false,
"range": [
134,
225
],
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 17,
"column": 1
}
},
"leadingComments": [],
"name": "_",
"trailingComments": []
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Vector",
"range": [
227,
233
],
"loc": {
"start": {
"line": 19,
"column": 0
},
"end": {
"line": 19,
"column": 6
}
}
},
"property": {
"type": "Identifier",
"name": "prototype",
"range": [
234,
243
],
"loc": {
"start": {
"line": 19,
"column": 7
},
"end": {
"line": 19,
"column": 16
}
}
},
"range": [
227,
243
],
"loc": {
"start": {
"line": 19,
"column": 0
},
"end": {
"line": 19,
"column": 16
}
}
},
"right": {
"type": "ObjectExpression",
"properties": [
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "negative",
"range": [
300,
308
],
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 24,
"column": 12
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "Vector",
"range": [
342,
348
],
"loc": {
"start": {
"line": 25,
"column": 19
},
"end": {
"line": 25,
"column": 25
}
}
},
"arguments": [
{
"type": "UnaryExpression",
"operator": "-",
"argument": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
350,
354
],
"loc": {
"start": {
"line": 25,
"column": 27
},
"end": {
"line": 25,
"column": 31
}
}
},
"property": {
"type": "Identifier",
"name": "x",
"range": [
355,
356
],
"loc": {
"start": {
"line": 25,
"column": 32
},
"end": {
"line": 25,
"column": 33
}
}
},
"range": [
350,
356
],
"loc": {
"start": {
"line": 25,
"column": 27
},
"end": {
"line": 25,
"column": 33
}
}
},
"prefix": true,
"range": [
349,
356
],
"loc": {
"start": {
"line": 25,
"column": 26
},
"end": {
"line": 25,
"column": 33
}
}
},
{
"type": "UnaryExpression",
"operator": "-",
"argument": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
359,
363
],
"loc": {
"start": {
"line": 25,
"column": 36
},
"end": {
"line": 25,
"column": 40
}
}
},
"property": {
"type": "Identifier",
"name": "y",
"range": [
364,
365
],
"loc": {
"start": {
"line": 25,
"column": 41
},
"end": {
"line": 25,
"column": 42
}
}
},
"range": [
359,
365
],
"loc": {
"start": {
"line": 25,
"column": 36
},
"end": {
"line": 25,
"column": 42
}
}
},
"prefix": true,
"range": [
358,
365
],
"loc": {
"start": {
"line": 25,
"column": 35
},
"end": {
"line": 25,
"column": 42
}
}
},
{
"type": "UnaryExpression",
"operator": "-",
"argument": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
368,
372
],
"loc": {
"start": {
"line": 25,
"column": 45
},
"end": {
"line": 25,
"column": 49
}
}
},
"property": {
"type": "Identifier",
"name": "z",
"range": [
373,
374
],
"loc": {
"start": {
"line": 25,
"column": 50
},
"end": {
"line": 25,
"column": 51
}
}
},
"range": [
368,
374
],
"loc": {
"start": {
"line": 25,
"column": 45
},
"end": {
"line": 25,
"column": 51
}
}
},
"prefix": true,
"range": [
367,
374
],
"loc": {
"start": {
"line": 25,
"column": 44
},
"end": {
"line": 25,
"column": 51
}
}
}
],
"range": [
338,
375
],
"loc": {
"start": {
"line": 25,
"column": 15
},
"end": {
"line": 25,
"column": 52
}
}
},
"range": [
331,
376
],
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 53
}
}
}
],
"range": [
321,
382
],
"loc": {
"start": {
"line": 24,
"column": 25
},
"end": {
"line": 26,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
310,
382
],
"loc": {
"start": {
"line": 24,
"column": 14
},
"end": {
"line": 26,
"column": 5
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
300,
382
],
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 26,
"column": 5
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n *\n * @returns {Vector}\n ",
"range": [
252,
295
],
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 23,
"column": 7
}
}
}
]
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "add",
"range": [
471,
474
],
"loc": {
"start": {
"line": 32,
"column": 4
},
"end": {
"line": 32,
"column": 7
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "v",
"range": [
485,
486
],
"loc": {
"start": {
"line": 32,
"column": 18
},
"end": {
"line": 32,
"column": 19
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": "instanceof",
"left": {
"type": "Identifier",
"name": "v",
"range": [
502,
503
],
"loc": {
"start": {
"line": 33,
"column": 12
},
"end": {
"line": 33,
"column": 13
}
}
},
"right": {
"type": "Identifier",
"name": "Vector",
"range": [
515,
521
],
"loc": {
"start": {
"line": 33,
"column": 25
},
"end": {
"line": 33,
"column": 31
}
}
},
"range": [
502,
521
],
"loc": {
"start": {
"line": 33,
"column": 12
},
"end": {
"line": 33,
"column": 31
}
}
},
"consequent": {
"type": "ReturnStatement",
"argument": {
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "Vector",
"range": [
534,
540
],
"loc": {
"start": {
"line": 33,
"column": 44
},
"end": {
"line": 33,
"column": 50
}
}
},
"arguments": [
{
"type": "BinaryExpression",
"operator": "+",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
541,
545
],
"loc": {
"start": {
"line": 33,
"column": 51
},
"end": {
"line": 33,
"column": 55
}
}
},
"property": {
"type": "Identifier",
"name": "x",
"range": [
546,
547
],
"loc": {
"start": {
"line": 33,
"column": 56
},
"end": {
"line": 33,
"column": 57
}
}
},
"range": [
541,
547
],
"loc": {
"start": {
"line": 33,
"column": 51
},
"end": {
"line": 33,
"column": 57
}
}
},
"right": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "v",
"range": [
550,
551
],
"loc": {
"start": {
"line": 33,
"column": 60
},
"end": {
"line": 33,
"column": 61
}
}
},
"property": {
"type": "Identifier",
"name": "x",
"range": [
552,
553
],
"loc": {
"start": {
"line": 33,
"column": 62
},
"end": {
"line": 33,
"column": 63
}
}
},
"range": [
550,
553
],
"loc": {
"start": {
"line": 33,
"column": 60
},
"end": {
"line": 33,
"column": 63
}
}
},
"range": [
541,
553
],
"loc": {
"start": {
"line": 33,
"column": 51
},
"end": {
"line": 33,
"column": 63
}
}
},
{
"type": "BinaryExpression",
"operator": "+",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
555,
559
],
"loc": {
"start": {
"line": 33,
"column": 65
},
"end": {
"line": 33,
"column": 69
}
}
},
"property": {
"type": "Identifier",
"name": "y",
"range": [
560,
561
],
"loc": {
"start": {
"line": 33,
"column": 70
},
"end": {
"line": 33,
"column": 71
}
}
},
"range": [
555,
561
],
"loc": {
"start": {
"line": 33,
"column": 65
},
"end": {
"line": 33,
"column": 71
}
}
},
"right": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "v",
"range": [
564,
565
],
"loc": {
"start": {
"line": 33,
"column": 74
},
"end": {
"line": 33,
"column": 75
}
}
},
"property": {
"type": "Identifier",
"name": "y",
"range": [
566,
567
],
"loc": {
"start": {
"line": 33,
"column": 76
},
"end": {
"line": 33,
"column": 77
}
}
},
"range": [
564,
567
],
"loc": {
"start": {
"line": 33,
"column": 74
},
"end": {
"line": 33,
"column": 77
}
}
},
"range": [
555,
567
],
"loc": {
"start": {
"line": 33,
"column": 65
},
"end": {
"line": 33,
"column": 77
}
}
},
{
"type": "BinaryExpression",
"operator": "+",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
569,
573
],
"loc": {
"start": {
"line": 33,
"column": 79
},
"end": {
"line": 33,
"column": 83
}
}
},
"property": {
"type": "Identifier",
"name": "z",
"range": [
574,
575
],
"loc": {
"start": {
"line": 33,
"column": 84
},
"end": {
"line": 33,
"column": 85
}
}
},
"range": [
569,
575
],
"loc": {
"start": {
"line": 33,
"column": 79
},
"end": {
"line": 33,
"column": 85
}
}
},
"right": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "v",
"range": [
578,
579
],
"loc": {
"start": {
"line": 33,
"column": 88
},
"end": {
"line": 33,
"column": 89
}
}
},
"property": {
"type": "Identifier",
"name": "z",
"range": [
580,
581
],
"loc": {
"start": {
"line": 33,
"column": 90
},
"end": {
"line": 33,
"column": 91
}
}
},
"range": [
578,
581
],
"loc": {
"start": {
"line": 33,
"column": 88
},
"end": {
"line": 33,
"column": 91
}
}
},
"range": [
569,
581
],
"loc": {
"start": {
"line": 33,
"column": 79
},
"end": {
"line": 33,
"column": 91
}
}
}
],
"range": [
530,
582
],
"loc": {
"start": {
"line": 33,
"column": 40
},
"end": {
"line": 33,
"column": 92
}
}
},
"range": [
523,
583
],
"loc": {
"start": {
"line": 33,
"column": 33
},
"end": {
"line": 33,
"column": 93
}
}
},
"alternate": {
"type": "ReturnStatement",
"argument": {
"type": "NewExpressio