dirtybomb
Version:
A dirty bomb model
1,297 lines (1,296 loc) • 211 kB
JSON
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "Literal",
"value": "use strict",
"raw": "\"use strict\"",
"range": [
42,
54
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 12
}
}
},
"range": [
42,
55
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 13
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Created by austin on 6/20/16.\n ",
"range": [
0,
40
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 3
}
}
}
]
},
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"local": {
"type": "Identifier",
"name": "chai",
"range": [
64,
68
],
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 11
}
}
},
"range": [
64,
68
],
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 11
}
}
}
],
"source": {
"type": "Literal",
"value": "chai",
"raw": "'chai'",
"range": [
74,
80
],
"loc": {
"start": {
"line": 7,
"column": 17
},
"end": {
"line": 7,
"column": 23
}
}
},
"range": [
57,
81
],
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 24
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "db",
"range": [
88,
90
],
"loc": {
"start": {
"line": 8,
"column": 6
},
"end": {
"line": 8,
"column": 8
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "require",
"range": [
93,
100
],
"loc": {
"start": {
"line": 8,
"column": 11
},
"end": {
"line": 8,
"column": 18
}
}
},
"arguments": [
{
"type": "Literal",
"value": "../dist/Dirtybomb",
"raw": "'../dist/Dirtybomb'",
"range": [
101,
120
],
"loc": {
"start": {
"line": 8,
"column": 19
},
"end": {
"line": 8,
"column": 38
}
}
}
],
"range": [
93,
121
],
"loc": {
"start": {
"line": 8,
"column": 11
},
"end": {
"line": 8,
"column": 39
}
}
},
"range": [
88,
121
],
"loc": {
"start": {
"line": 8,
"column": 6
},
"end": {
"line": 8,
"column": 39
}
}
}
],
"kind": "const",
"range": [
82,
122
],
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 40
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "expect",
"range": [
130,
136
],
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 12
}
}
},
"init": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "chai",
"range": [
139,
143
],
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "expect",
"range": [
144,
150
],
"loc": {
"start": {
"line": 10,
"column": 20
},
"end": {
"line": 10,
"column": 26
}
}
},
"range": [
139,
150
],
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 26
}
}
},
"range": [
130,
150
],
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 26
}
}
}
],
"kind": "const",
"range": [
124,
151
],
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 10,
"column": 27
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "chai",
"range": [
152,
156
],
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 11,
"column": 4
}
}
},
"property": {
"type": "Identifier",
"name": "should",
"range": [
157,
163
],
"loc": {
"start": {
"line": 11,
"column": 5
},
"end": {
"line": 11,
"column": 11
}
}
},
"range": [
152,
163
],
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 11,
"column": 11
}
}
},
"arguments": [],
"range": [
152,
165
],
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 11,
"column": 13
}
}
},
"range": [
152,
166
],
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 11,
"column": 14
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
168,
176
],
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 13,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "NuclearMaterial",
"raw": "'NuclearMaterial'",
"range": [
177,
194
],
"loc": {
"start": {
"line": 13,
"column": 9
},
"end": {
"line": 13,
"column": 26
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "pu238",
"range": [
217,
222
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 13
}
}
},
"init": null,
"range": [
217,
222
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 13
}
}
},
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "cobalt60",
"range": [
224,
232
],
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 14,
"column": 23
}
}
},
"init": null,
"range": [
224,
232
],
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 14,
"column": 23
}
}
}
],
"kind": "let",
"range": [
213,
233
],
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 24
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
238,
246
],
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 12
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Constructor",
"raw": "'Constructor'",
"range": [
247,
260
],
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 15,
"column": 26
}
}
},
{
"type": "ArrowFunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "it",
"range": [
278,
280
],
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 10
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should construct from half life",
"raw": "'should construct from half life'",
"range": [
281,
314
],
"loc": {
"start": {
"line": 16,
"column": 11
},
"end": {
"line": 16,
"column": 44
}
}
},
{
"type": "ArrowFunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "Identifier",
"name": "pu238",
"range": [
336,
341
],
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 17
}
}
},
"right": {
"type": "NewExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "db",
"range": [
348,
350
],
"loc": {
"start": {
"line": 17,
"column": 24
},
"end": {
"line": 17,
"column": 26
}
}
},
"property": {
"type": "Identifier",
"name": "NuclearMaterial",
"range": [
351,
366
],
"loc": {
"start": {
"line": 17,
"column": 27
},
"end": {
"line": 17,
"column": 42
}
}
},
"range": [
348,
366
],
"loc": {
"start": {
"line": 17,
"column": 24
},
"end": {
"line": 17,
"column": 42
}
}
},
"arguments": [
{
"type": "Literal",
"value": 2767540000,
"raw": "2767540000",
"range": [
367,
377
],
"loc": {
"start": {
"line": 17,
"column": 43
},
"end": {
"line": 17,
"column": 53
}
}
},
{
"type": "Literal",
"value": 238,
"raw": "238",
"range": [
379,
382
],
"loc": {
"start": {
"line": 17,
"column": 55
},
"end": {
"line": 17,
"column": 58
}
}
},
{
"type": "Literal",
"value": 100,
"raw": "100",
"range": [
384,
387
],
"loc": {
"start": {
"line": 17,
"column": 60
},
"end": {
"line": 17,
"column": 63
}
}
}
],
"range": [
344,
388
],
"loc": {
"start": {
"line": 17,
"column": 20
},
"end": {
"line": 17,
"column": 64
}
}
},
"range": [
336,
388
],
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 64
}
}
},
"range": [
336,
389
],
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 65
}
}
}
],
"range": [
322,
399
],
"loc": {
"start": {
"line": 16,
"column": 52
},
"end": {
"line": 18,
"column": 9
}
}
},
"generator": false,
"expression": false,
"range": [
316,
399
],
"loc": {
"start": {
"line": 16,
"column": 46
},
"end": {
"line": 18,
"column": 9
}
}
}
],
"range": [
278,
400
],
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 18,
"column": 10
}
},
"_esdocTestId": 47,
"_esdocTestName": "it47"
},
"range": [
278,
401
],
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 18,
"column": 11
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "it",
"range": [
419,
421
],
"loc": {
"start": {
"line": 20,
"column": 8
},
"end": {
"line": 20,
"column": 10
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should construct from preset",
"raw": "'should construct from preset'",
"range": [
422,
452
],
"loc": {
"start": {
"line": 20,
"column": 11
},
"end": {
"line": 20,
"column": 41
}
}
},
{
"type": "ArrowFunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "Identifier",
"name": "cobalt60",
"range": [
474,
482
],
"loc": {
"start": {
"line": 21,
"column": 12
},
"end": {
"line": 21,
"column": 20
}
}
},
"right": {
"type": "NewExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "db",
"range": [
489,
491
],
"loc": {
"start": {
"line": 21,
"column": 27
},
"end": {
"line": 21,
"column": 29
}
}
},
"property": {
"type": "Identifier",
"name": "NuclearMaterial",
"range": [
492,
507
],
"loc": {
"start": {
"line": 21,
"column": 30
},
"end": {
"line": 21,
"column": 45
}
}
},
"range": [
489,
507
],
"loc": {
"start": {
"line": 21,
"column": 27
},
"end": {
"line": 21,
"column": 45
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Cobalt",
"raw": "\"Cobalt\"",
"range": [
508,
516
],
"loc": {
"start": {
"line": 21,
"column": 46
},
"end": {
"line": 21,
"column": 54
}
}
},
{
"type": "Literal",
"value": 60,
"raw": "60",
"range": [
518,
520
],
"loc": {
"start": {
"line": 21,
"column": 56
},
"end": {
"line": 21,
"column": 58
}
}
},
{
"type": "Literal",
"value": 100,
"raw": "100",
"range": [
522,
525
],
"loc": {
"start": {
"line": 21,
"column": 60
},
"end": {
"line": 21,
"column": 63
}
}
}
],
"range": [
485,
526
],
"loc": {
"start": {
"line": 21,
"column": 23
},
"end": {
"line": 21,
"column": 64
}
}
},
"range": [
474,
526
],
"loc": {
"start": {
"line": 21,
"column": 12
},
"end": {
"line": 21,
"column": 64
}
}
},
"range": [
474,
527
],
"loc": {
"start": {
"line": 21,
"column": 12
},
"end": {
"line": 21,
"column": 65
}
}
}
],
"range": [
460,
537
],
"loc": {
"start": {
"line": 20,
"column": 49
},
"end": {
"line": 22,
"column": 9
}
}
},
"generator": false,
"expression": false,
"range": [
454,
537
],
"loc": {
"start": {
"line": 20,
"column": 43
},
"end": {
"line": 22,
"column": 9
}
}
}
],
"range": [
419,
538
],
"loc": {
"start": {
"line": 20,
"column": 8
},
"end": {
"line": 22,
"column": 10
}
},
"_esdocTestId": 48,
"_esdocTestName": "it48"
},
"range": [
419,
539
],
"loc": {
"start": {
"line": 20,
"column": 8
},
"end": {
"line": 22,
"column": 11
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "it",
"range": [
557,
559
],
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 10
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should throw error if preset is not found",
"raw": "'should throw error if preset is not found'",
"range": [
560,
603
],
"loc": {
"start": {
"line": 24,
"column": 11
},
"end": {
"line": 24,
"column": 54
}
}
},
{
"type": "ArrowFunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "badConstruction",
"range": [
629,
644
],
"loc": {
"start": {
"line": 25,
"column": 16
},
"end": {
"line": 25,
"column": 31