UNPKG

awv3

Version:
1,444 lines (1,443 loc) 207 kB
{ "type": "File", "start": 0, "end": 1005, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 30, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 1005, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 30, "column": 0 } }, "sourceType": "module", "body": [ { "type": "FunctionDeclaration", "start": 0, "end": 305, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 10, "column": 1 } }, "id": { "type": "Identifier", "start": 9, "end": 14, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 14 }, "identifierName": "parse" }, "name": "parse" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 15, "end": 21, "loc": { "start": { "line": 1, "column": 15 }, "end": { "line": 1, "column": 21 }, "identifierName": "string" }, "name": "string" }, { "type": "Identifier", "start": 23, "end": 35, "loc": { "start": { "line": 1, "column": 23 }, "end": { "line": 1, "column": 35 }, "identifierName": "restrictions" }, "name": "restrictions" } ], "body": { "type": "BlockStatement", "start": 37, "end": 305, "loc": { "start": { "line": 1, "column": 37 }, "end": { "line": 10, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 44, "end": 84, "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 44 } }, "declarations": [ { "type": "VariableDeclarator", "start": 48, "end": 83, "loc": { "start": { "line": 2, "column": 8 }, "end": { "line": 2, "column": 43 } }, "id": { "type": "Identifier", "start": 48, "end": 54, "loc": { "start": { "line": 2, "column": 8 }, "end": { "line": 2, "column": 14 }, "identifierName": "tokens" }, "name": "tokens" }, "init": { "type": "CallExpression", "start": 57, "end": 83, "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 43 } }, "callee": { "type": "MemberExpression", "start": 57, "end": 76, "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 36 } }, "object": { "type": "CallExpression", "start": 57, "end": 70, "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 30 } }, "callee": { "type": "MemberExpression", "start": 57, "end": 68, "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 28 } }, "object": { "type": "Identifier", "start": 57, "end": 63, "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 23 }, "identifierName": "string" }, "name": "string" }, "property": { "type": "Identifier", "start": 64, "end": 68, "loc": { "start": { "line": 2, "column": 24 }, "end": { "line": 2, "column": 28 }, "identifierName": "trim" }, "name": "trim" }, "computed": false }, "arguments": [] }, "property": { "type": "Identifier", "start": 71, "end": 76, "loc": { "start": { "line": 2, "column": 31 }, "end": { "line": 2, "column": 36 }, "identifierName": "split" }, "name": "split" }, "computed": false }, "arguments": [ { "type": "RegExpLiteral", "start": 77, "end": 82, "loc": { "start": { "line": 2, "column": 37 }, "end": { "line": 2, "column": 42 } }, "extra": { "raw": "/\\s+/" }, "pattern": "\\s+", "flags": "" } ] } } ], "kind": "let" }, { "type": "WhileStatement", "start": 90, "end": 302, "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 9, "column": 5 } }, "test": { "type": "BinaryExpression", "start": 97, "end": 116, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 30 } }, "left": { "type": "MemberExpression", "start": 97, "end": 110, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 24 } }, "object": { "type": "Identifier", "start": 97, "end": 103, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 17 }, "identifierName": "tokens" }, "name": "tokens" }, "property": { "type": "Identifier", "start": 104, "end": 110, "loc": { "start": { "line": 3, "column": 18 }, "end": { "line": 3, "column": 24 }, "identifierName": "length" }, "name": "length" }, "computed": false }, "operator": "!==", "right": { "type": "NumericLiteral", "start": 115, "end": 116, "loc": { "start": { "line": 3, "column": 29 }, "end": { "line": 3, "column": 30 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 } }, "body": { "type": "BlockStatement", "start": 118, "end": 302, "loc": { "start": { "line": 3, "column": 32 }, "end": { "line": 9, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 129, "end": 157, "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 36 } }, "declarations": [ { "type": "VariableDeclarator", "start": 135, "end": 156, "loc": { "start": { "line": 4, "column": 14 }, "end": { "line": 4, "column": 35 } }, "id": { "type": "Identifier", "start": 135, "end": 139, "loc": { "start": { "line": 4, "column": 14 }, "end": { "line": 4, "column": 18 }, "identifierName": "name" }, "name": "name" }, "init": { "type": "CallExpression", "start": 142, "end": 156, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 35 } }, "callee": { "type": "MemberExpression", "start": 142, "end": 154, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 33 } }, "object": { "type": "Identifier", "start": 142, "end": 148, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 27 }, "identifierName": "tokens" }, "name": "tokens" }, "property": { "type": "Identifier", "start": 149, "end": 154, "loc": { "start": { "line": 4, "column": 28 }, "end": { "line": 4, "column": 33 }, "identifierName": "shift" }, "name": "shift" }, "computed": false }, "arguments": [] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 167, "end": 204, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 45 } }, "declarations": [ { "type": "VariableDeclarator", "start": 173, "end": 203, "loc": { "start": { "line": 5, "column": 14 }, "end": { "line": 5, "column": 44 } }, "id": { "type": "Identifier", "start": 173, "end": 178, "loc": { "start": { "line": 5, "column": 14 }, "end": { "line": 5, "column": 19 }, "identifierName": "value" }, "name": "value" }, "init": { "type": "CallExpression", "start": 181, "end": 203, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 44 } }, "callee": { "type": "Identifier", "start": 181, "end": 187, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 28 }, "identifierName": "Number" }, "name": "Number" }, "arguments": [ { "type": "CallExpression", "start": 188, "end": 202, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 43 } }, "callee": { "type": "MemberExpression", "start": 188, "end": 200, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 41 } }, "object": { "type": "Identifier", "start": 188, "end": 194, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 35 }, "identifierName": "tokens" }, "name": "tokens" }, "property": { "type": "Identifier", "start": 195, "end": 200, "loc": { "start": { "line": 5, "column": 36 }, "end": { "line": 5, "column": 41 }, "identifierName": "shift" }, "name": "shift" }, "computed": false }, "arguments": [] } ] } } ], "kind": "const" }, { "type": "IfStatement", "start": 214, "end": 258, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 7, "column": 21 } }, "test": { "type": "UnaryExpression", "start": 218, "end": 234, "loc": { "start": { "line": 6, "column": 12 }, "end": { "line": 6, "column": 28 } }, "operator": "!", "prefix": true, "argument": { "type": "CallExpression", "start": 219, "end": 234, "loc": { "start": { "line": 6, "column": 13 }, "end": { "line": 6, "column": 28 } }, "callee": { "type": "Identifier", "start": 219, "end": 227, "loc": { "start": { "line": 6, "column": 13 }, "end": { "line": 6, "column": 21 }, "identifierName": "isFinite" }, "name": "isFinite" }, "arguments": [ { "type": "Identifier", "start": 228, "end": 233, "loc": { "start": { "line": 6, "column": 22 }, "end": { "line": 6, "column": 27 }, "identifierName": "value" }, "name": "value" } ] }, "extra": { "parenthesizedArgument": false } }, "consequent": { "type": "ContinueStatement", "start": 249, "end": 258, "loc": { "start": { "line": 7, "column": 12 }, "end": { "line": 7, "column": 21 } }, "label": null }, "alternate": null }, { "type": "ExpressionStatement", "start": 268, "end": 295, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 35 } }, "expression": { "type": "AssignmentExpression", "start": 268, "end": 294, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 34 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 268, "end": 286, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 26 } }, "object": { "type": "Identifier", "start": 268, "end": 280, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 20 }, "identifierName": "restrictions" }, "name": "restrictions" }, "property": { "type": "Identifier", "start": 281, "end": 285, "loc": { "start": { "line": 8, "column": 21 }, "end": { "line": 8, "column": 25 }, "identifierName": "name" }, "name": "name" }, "computed": true }, "right": { "type": "Identifier", "start": 289, "end": 294, "loc": { "start": { "line": 8, "column": 29 }, "end": { "line": 8, "column": 34 }, "identifierName": "value" }, "name": "value" } } } ], "directives": [] } } ], "directives": [] } }, { "type": "ExportDefaultDeclaration", "start": 309, "end": 1003, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 29, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 324, "end": 1003, "loc": { "start": { "line": 12, "column": 15 }, "end": { "line": 29, "column": 1 } }, "id": { "type": "Identifier", "start": 333, "end": 347, "loc": { "start": { "line": 12, "column": 24 }, "end": { "line": 12, "column": 38 }, "identifierName": "observeConsole" }, "name": "observeConsole" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 348, "end": 362, "loc": { "start": { "line": 12, "column": 39 }, "end": { "line": 12, "column": 53 }, "identifierName": "consoleElement" }, "name": "consoleElement" }, { "type": "Identifier", "start": 364, "end": 376, "loc": { "start": { "line": 12, "column": 55 }, "end": { "line": 12, "column": 67 }, "identifierName": "handlerThunk" }, "name": "handlerThunk" }, { "type": "Identifier", "start": 378, "end": 391, "loc": { "start": { "line": 12, "column": 69 }, "end": { "line": 12, "column": 82 }, "identifierName": "useNewConsole" }, "name": "useNewConsole" } ], "body": { "type": "BlockStatement", "start": 393, "end": 1003, "loc": { "start": { "line": 12, "column": 84 }, "end": { "line": 29, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 400, "end": 737, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 21, "column": 7 } }, "expression": { "type": "CallExpression", "start": 400, "end": 736, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 21, "column": 6 } }, "callee": { "type": "MemberExpression", "start": 400, "end": 422, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 26 } }, "object": { "type": "Identifier", "start": 400, "end": 414, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 18 }, "identifierName": "consoleElement" }, "name": "consoleElement" }, "property": { "type": "Identifier", "start": 415, "end": 422, "loc": { "start": { "line": 13, "column": 19 }, "end": { "line": 13, "column": 26 }, "identifierName": "observe" }, "name": "observe" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 423, "end": 447, "loc": { "start": { "line": 13, "column": 27 }, "end": { "line": 13, "column": 51 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 423, "end": 428, "loc": { "start": { "line": 13, "column": 27 }, "end": { "line": 13, "column": 32 }, "identifierName": "state" }, "name": "state" } ], "body": { "type": "MemberExpression", "start": 432, "end": 447, "loc": { "start": { "line": 13, "column": 36 }, "end": { "line": 13, "column": 51 } }, "object": { "type": "Identifier", "start": 432, "end": 437, "loc": { "start": { "line": 13, "column": 36 }, "end": { "line": 13, "column": 41 }, "identifierName": "state" }, "name": "state" }, "property": { "type": "Identifier", "start": 438, "end": 447, "loc": { "start": { "line": 13, "column": 42 }, "end": { "line": 13, "column": 51 }, "identifierName": "lastEvent" }, "name": "lastEvent" }, "computed": false } }, { "type": "ArrowFunctionExpression", "start": 449, "end": 735, "loc": { "start": { "line": 13, "column": 53 }, "end": { "line": 21, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 449, "end": 454, "loc": { "start": { "line": 13, "column": 53 }, "end": { "line": 13, "column": 58 }, "identifierName": "event" }, "name": "event" } ], "body": { "type": "BlockStatement", "start": 458, "end": 735, "loc": { "start": { "line": 13, "column": 62 }, "end": { "line": 21, "column": 5 } }, "body": [ { "type": "IfStatement", "start": 469, "end": 498, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 37 } }, "test": { "type": "UnaryExpression", "start": 473, "end": 489, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 28 } }, "operator": "!", "prefix": true, "argument": { "type": "CallExpression", "start": 474, "end": 489, "loc": { "start": { "line": 14, "column": 13 }, "end": { "line": 14, "column": 28 } }, "callee": { "type": "Identifier", "start": 474, "end": 487, "loc": { "start": { "line": 14, "column": 13 }, "end": { "line": 14, "column": 26 }, "identifierName": "useNewConsole" }, "name": "useNewConsole" }, "arguments": [] }, "extra": { "parenthesizedArgument": false } }, "consequent": { "type": "ReturnStatement", "start": 491, "end": 498, "loc": { "start": { "line": 14, "column": 30 }, "end": { "line": 14, "column": 37 } }, "argument": null }, "alternate": null }, { "type": "IfStatement", "start": 508, "end": 728, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 20, "column": 9 } }, "test": { "type": "BinaryExpression", "start": 512, "end": 533, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 33 } }, "left": { "type": "MemberExpression", "start": 512, "end": 521, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 21 } }, "object": { "type": "Identifier", "start": 512, "end": 517, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 17 }, "identifierName": "event" }, "name": "event" }, "property": { "type": "Identifier", "start": 518, "end": 521, "loc": { "start": { "line": 15, "column": 18 }, "end": { "line": 15, "column": 21 }, "identifierName": "key" }, "name": "key" }, "computed": false }, "operator": "===", "right": { "type": "StringLiteral", "start": 526, "end": 533, "loc": { "start": { "line": 15, "column": 26 }, "end": { "line": 15, "column": 33 } }, "extra": { "rawValue": "Enter", "raw": "'Enter'" }, "value": "Enter" } }, "consequent": { "type": "BlockStatement", "start": 535, "end": 728, "loc": { "start": { "line": 15, "column": 35 }, "end": { "line": 20, "column": 9 } }, "body": [ { "type": "VariableDeclaration", "start": 550, "end": 583, "loc": { "start": { "line": 16, "column": 12 }, "end": { "line": 16, "column": 45 } }, "declarations": [ { "type": "VariableDeclarator",