UNPKG

awv3

Version:
1,658 lines (1,657 loc) 278 kB
{ "type": "Program", "start": 0, "end": 5489, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 117, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 54, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 54 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 9, "end": 13, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 13 } }, "imported": { "type": "Identifier", "start": 9, "end": 13, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 13 } }, "name": "guid" }, "local": { "type": "Identifier", "start": 9, "end": 13, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 13 } }, "name": "guid" } }, { "type": "ImportSpecifier", "start": 15, "end": 23, "loc": { "start": { "line": 1, "column": 15 }, "end": { "line": 1, "column": 23 } }, "imported": { "type": "Identifier", "start": 15, "end": 23, "loc": { "start": { "line": 1, "column": 15 }, "end": { "line": 1, "column": 23 } }, "name": "queryDom" }, "local": { "type": "Identifier", "start": 15, "end": 23, "loc": { "start": { "line": 1, "column": 15 }, "end": { "line": 1, "column": 23 } }, "name": "queryDom" } }, { "type": "ImportSpecifier", "start": 25, "end": 28, "loc": { "start": { "line": 1, "column": 25 }, "end": { "line": 1, "column": 28 } }, "imported": { "type": "Identifier", "start": 25, "end": 28, "loc": { "start": { "line": 1, "column": 25 }, "end": { "line": 1, "column": 28 } }, "name": "url" }, "local": { "type": "Identifier", "start": 25, "end": 28, "loc": { "start": { "line": 1, "column": 25 }, "end": { "line": 1, "column": 28 } }, "name": "url" } } ], "importKind": "value", "source": { "type": "Literal", "start": 36, "end": 53, "loc": { "start": { "line": 1, "column": 36 }, "end": { "line": 1, "column": 53 } }, "value": "../core/helpers", "rawValue": "../core/helpers", "raw": "'../core/helpers'" } }, { "type": "ImportDeclaration", "start": 55, "end": 91, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 36 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 62, "end": 68, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 13 } }, "local": { "type": "Identifier", "start": 62, "end": 68, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 13 } }, "name": "Parser" } } ], "importKind": "value", "source": { "type": "Literal", "start": 74, "end": 90, "loc": { "start": { "line": 2, "column": 19 }, "end": { "line": 2, "column": 35 } }, "value": "../core/parser", "rawValue": "../core/parser", "raw": "'../core/parser'" } }, { "type": "ImportDeclaration", "start": 92, "end": 128, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 36 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 99, "end": 105, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 } }, "local": { "type": "Identifier", "start": 99, "end": 105, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 } }, "name": "Events" } } ], "importKind": "value", "source": { "type": "Literal", "start": 111, "end": 127, "loc": { "start": { "line": 3, "column": 19 }, "end": { "line": 3, "column": 35 } }, "value": "../core/events", "rawValue": "../core/events", "raw": "'../core/events'" } }, { "type": "ImportDeclaration", "start": 129, "end": 169, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 40 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 136, "end": 144, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 15 } }, "local": { "type": "Identifier", "start": 136, "end": 144, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 15 } }, "name": "Renderer" } } ], "importKind": "value", "source": { "type": "Literal", "start": 150, "end": 168, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 39 } }, "value": "../core/renderer", "rawValue": "../core/renderer", "raw": "'../core/renderer'" }, "trailingComments": [ { "type": "Block", "value": "* Global awv3 version ", "start": 171, "end": 197, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 26 } }, "range": [ 171, 197 ] } ] }, { "type": "ExportNamedDeclaration", "start": 198, "end": 227, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 29 } }, "declaration": { "type": "VariableDeclaration", "start": 205, "end": 227, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 29 } }, "declarations": [ { "type": "VariableDeclarator", "start": 209, "end": 226, "loc": { "start": { "line": 7, "column": 11 }, "end": { "line": 7, "column": 28 } }, "id": { "type": "Identifier", "start": 209, "end": 216, "loc": { "start": { "line": 7, "column": 11 }, "end": { "line": 7, "column": 18 } }, "name": "version", "leadingComments": null }, "init": { "type": "Literal", "start": 219, "end": 226, "loc": { "start": { "line": 7, "column": 21 }, "end": { "line": 7, "column": 28 } }, "value": "1.0.0", "rawValue": "1.0.0", "raw": "'1.0.0'" }, "leadingComments": null } ], "kind": "let", "leadingComments": [ { "type": "Block", "value": "* Global awv3 version ", "start": 171, "end": 197, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 26 } }, "range": [ 171, 197 ] } ], "trailingComments": [ { "type": "Block", "value": "* last created canvas ", "start": 228, "end": 254, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 26 } }, "range": [ 228, 254 ] } ] }, "specifiers": [], "source": null, "leadingComments": [ { "type": "Block", "value": "* Global awv3 version ", "start": 171, "end": 197, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 26 } }, "range": [ 171, 197 ] } ], "trailingComments": [ { "type": "Block", "value": "* last created canvas ", "start": 228, "end": 254, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 26 } }, "range": [ 228, 254 ] } ] }, { "type": "ExportNamedDeclaration", "start": 255, "end": 290, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 35 } }, "declaration": { "type": "VariableDeclaration", "start": 262, "end": 290, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 35 } }, "declarations": [ { "type": "VariableDeclarator", "start": 266, "end": 289, "loc": { "start": { "line": 9, "column": 11 }, "end": { "line": 9, "column": 34 } }, "id": { "type": "Identifier", "start": 266, "end": 277, "loc": { "start": { "line": 9, "column": 11 }, "end": { "line": 9, "column": 22 } }, "name": "lastCreated", "leadingComments": null }, "init": { "type": "Identifier", "start": 280, "end": 289, "loc": { "start": { "line": 9, "column": 25 }, "end": { "line": 9, "column": 34 } }, "name": "undefined" }, "leadingComments": null } ], "kind": "let", "leadingComments": [ { "type": "Block", "value": "* last created canvas ", "start": 228, "end": 254, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 26 } }, "range": [ 228, 254 ] } ], "trailingComments": [ { "type": "Block", "value": "* The Canvas class holds the webGL context and maps the underlying views.\n It initializes it's own renderer, event system and parser. ", "start": 292, "end": 433, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 12, "column": 65 } }, "range": [ 292, 433 ] } ] }, "specifiers": [], "source": null, "leadingComments": [ { "type": "Block", "value": "* last created canvas ", "start": 228, "end": 254, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 26 } }, "range": [ 228, 254 ] } ], "trailingComments": [ { "type": "Block", "value": "* The Canvas class holds the webGL context and maps the underlying views.\n It initializes it's own renderer, event system and parser. ", "start": 292, "end": 433, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 12, "column": 65 } }, "range": [ 292, 433 ] } ] }, { "type": "ExportDefaultDeclaration", "start": 434, "end": 5488, "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 116, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 449, "end": 5488, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 116, "column": 1 } }, "id": { "type": "Identifier", "start": 455, "end": 461, "loc": { "start": { "line": 13, "column": 21 }, "end": { "line": 13, "column": 27 } }, "name": "Canvas", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 462, "end": 5488, "loc": { "start": { "line": 13, "column": 28 }, "end": { "line": 116, "column": 1 } }, "body": [ { "type": "MethodDefinition", "start": 2372, "end": 5486, "loc": { "start": { "line": 38, "column": 4 }, "end": { "line": 115, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 2372, "end": 2383, "loc": { "start": { "line": 38, "column": 4 }, "end": { "line": 38, "column": 15 } }, "name": "constructor", "leadingComments": null }, "static": false, "kind": "constructor", "value": { "type": "FunctionExpression", "start": 2383, "end": 5486, "loc": { "start": { "line": 38, "column": 15 }, "end": { "line": 115, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "AssignmentPattern", "start": 2384, "end": 2396, "loc": { "start": { "line": 38, "column": 16 }, "end": { "line": 38, "column": 28 } }, "operator": "=", "left": { "type": "Identifier", "start": 2384, "end": 2391, "loc": { "start": { "line": 38, "column": 16 }, "end": { "line": 38, "column": 23 } }, "name": "options" }, "right": { "type": "ObjectExpression", "start": 2394, "end": 2396, "loc": { "start": { "line": 38, "column": 26 }, "end": { "line": 38, "column": 28 } }, "properties": [] } } ], "body": { "type": "BlockStatement", "start": 2398, "end": 5486, "loc": { "start": { "line": 38, "column": 30 }, "end": { "line": 115, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 2437, "end": 2460, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 31 } }, "expression": { "type": "AssignmentExpression", "start": 2437, "end": 2459, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 30 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2437, "end": 2449, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 20 } }, "object": { "type": "ThisExpression", "start": 2437, "end": 2441, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2442, "end": 2449, "loc": { "start": { "line": 41, "column": 13 }, "end": { "line": 41, "column": 20 } }, "name": "version" }, "computed": false, "leadingComments": null }, "right": { "type": "Identifier", "start": 2452, "end": 2459, "loc": { "start": { "line": 41, "column": 23 }, "end": { "line": 41, "column": 30 } }, "name": "version" }, "leadingComments": null }, "leadingComments": [ { "type": "Block", "value": "* awv3 version ", "start": 2409, "end": 2428, "loc": { "start": { "line": 40, "column": 8 }, "end": { "line": 40, "column": 27 } }, "range": [ 2409, 2428 ] } ], "trailingComments": [ { "type": "Block", "value": "* GUID to help identify the canvas ", "start": 2469, "end": 2508, "loc": { "start": { "line": 42, "column": 8 }, "end": { "line": 42, "column": 47 } }, "range": [ 2469, 2508 ] } ] }, { "type": "ExpressionStatement", "start": 2517, "end": 2534, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 25 } }, "expression": { "type": "AssignmentExpression", "start": 2517, "end": 2533, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 24 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2517, "end": 2524, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 15 } }, "object": { "type": "ThisExpression", "start": 2517, "end": 2521, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2522, "end": 2524, "loc": { "start": { "line": 43, "column": 13 }, "end": { "line": 43, "column": 15 } }, "name": "id" }, "computed": false, "leadingComments": null }, "right": { "type": "CallExpression", "start": 2527, "end": 2533, "loc": { "start": { "line": 43, "column": 18 }, "end": { "line": 43, "column": 24 } }, "callee": { "type": "Identifier", "start": 2527, "end": 2531, "loc": { "start": { "line": 43, "column": 18 }, "end": { "line": 43, "column": 22 } }, "name": "guid" }, "arguments": [] }, "leadingComments": null }, "leadingComments": [ { "type": "Block", "value": "* GUID to help identify the canvas ", "start": 2469, "end": 2508, "loc": { "start": { "line": 42, "column": 8 }, "end": { "line": 42, "column": 47 } }, "range": [ 2469, 2508 ] } ], "trailingComments": [ { "type": "Block", "value": "* List of managed views ", "start": 2543, "end": 2571, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 36 } }, "range": [ 2543, 2571 ] } ] }, { "type": "ExpressionStatement", "start": 2580, "end": 2596, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 24 } }, "expression": { "type": "AssignmentExpression", "start": 2580, "end": 2595, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 23 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2580, "end": 2590, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 18 } }, "object": { "type": "ThisExpression", "start": 2580, "end": 2584, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2585, "end": 2590, "loc": { "start": { "line": 45, "column": 13 }, "end": { "line": 45, "column": 18 } }, "name": "views" }, "computed": false, "leadingComments": null }, "right": { "type": "ArrayExpression", "start": 2593, "end": 2595, "loc": { "start": { "line": 45, "column": 21 }, "end": { "line": 45, "column": 23 } }, "elements": [] }, "leadingComments": null }, "leadingComments": [ { "type": "Block", "value": "* List of managed views ", "start": 2543, "end": 2571, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 36 } }, "range": [ 2543, 2571 ] } ] }, { "type": "IfStatement", "start": 2606, "end": 2891, "loc": { "start": { "line": 47, "column": 8 }, "end": { "line": 53, "column": 9 } }, "test": { "type": "UnaryExpression", "start": 2610, "end": 2624, "loc": { "start": { "line": 47, "column": 12 }, "end": { "line": 47, "column": 26 } }, "operator": "!", "prefix": true, "argument": { "type": "UnaryExpression", "start": 2611, "end": 2624, "loc": { "start": { "line": 47, "column": 13 }, "end": { "line": 47, "column": 26 } }, "operator": "!", "prefix": true, "argument": { "type": "UnaryExpression", "start": 2612, "end": 2624, "loc": { "start": { "line": 47, "column": 14 }, "end": { "line": 47, "column": 26 } }, "operator": "!", "prefix": true, "argument": { "type": "MemberExpression", "start": 2613, "end": 2624, "loc": { "start": { "line": 47, "column": 15 }, "end": { "line": 47, "column": 26 } }, "object": { "type": "Identifier", "start": 2613, "end": 2620, "loc": { "start": { "line": 47, "column": 15 }, "end": { "line": 47, "column": 22 } }, "name": "options" }, "property": { "type": "Identifier", "start": 2621, "end": 2624, "loc": { "start": { "line": 47, "column": 23 }, "end": { "line": 47, "column": 26 } }, "name": "dom" }, "computed": false } } } }, "consequent": { "type": "BlockStatement", "start": 2626, "end": 2891, "loc": { "start": { "line": 47, "column": 28 }, "end": { "line": 53, "column": 9 } }, "body": [ { "type": "ExpressionStatement", "start": 2640, "end": 2684, "loc": { "start": { "line": 48, "column": 12 }, "end": { "line": 48, "column": 56 } }, "expression": { "type": "AssignmentExpression", "start": 2640, "end": 2683, "loc": { "start": { "line": 48, "column": 12 }, "end": { "line": 48, "column": 55 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2640, "end": 2651, "loc": { "start": { "line": 48, "column": 12 }, "end": { "line": 48, "column": 23 } }, "object": { "type": "Identifier", "start": 2640, "end": 2647, "loc": { "start": { "line": 48, "column": 12 }, "end": { "line": 48, "column": 19 } }, "name": "options" }, "property": { "type": "Identifier", "start": 2648, "end": 2651, "loc": { "start": { "line": 48, "column": 20 }, "end": { "line": 48, "column": 23 } }, "name": "dom" }, "computed": false }, "right": { "type": "CallExpression", "start": 2654, "end": 2683, "loc": { "start": { "line": 48, "column": 26 }, "end": { "line": 48, "column": 55 } }, "callee": { "type": "MemberExpression", "start": 2654, "end": 2676, "loc": { "start": { "line": 48, "column": 26 }, "end": { "line": 48, "column": 48 } }, "object": { "type": "Identifier", "start": 2654, "end": 2662, "loc": { "start": { "line": 48, "column": 26 }, "end": { "line": 48, "column": 34 } }, "name": "document" }, "property": { "type": "Identifier", "start": 2663, "end": 2676, "loc": { "start": { "line": 48, "column": 35 }, "end": { "line": 48, "column": 48 } }, "name": "createElement" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 2677, "end": 2682, "loc": { "start": { "line": 48, "column": 49 }, "end": { "line": 48, "column": 54 } }, "value": "div", "rawValue": "div", "raw": "\"div\"" } ] } } }, { "type": "ExpressionStatement", "start": 2697, "end": 2737, "loc": { "start": { "line": 49, "column": 12 }, "end": {