UNPKG

awv3

Version:
1,659 lines (1,658 loc) 296 kB
{ "type": "Program", "start": 0, "end": 6002, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 125, "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": 56, "end": 92, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 36 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 63, "end": 69, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 13 } }, "local": { "type": "Identifier", "start": 63, "end": 69, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 13 } }, "name": "Parser" } } ], "importKind": "value", "source": { "type": "Literal", "start": 75, "end": 91, "loc": { "start": { "line": 2, "column": 19 }, "end": { "line": 2, "column": 35 } }, "value": "../core/parser", "rawValue": "../core/parser", "raw": "'../core/parser'" } }, { "type": "ImportDeclaration", "start": 94, "end": 130, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 36 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 101, "end": 107, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 } }, "local": { "type": "Identifier", "start": 101, "end": 107, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 } }, "name": "Events" } } ], "importKind": "value", "source": { "type": "Literal", "start": 113, "end": 129, "loc": { "start": { "line": 3, "column": 19 }, "end": { "line": 3, "column": 35 } }, "value": "../core/events", "rawValue": "../core/events", "raw": "'../core/events'" } }, { "type": "ImportDeclaration", "start": 132, "end": 172, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 40 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 139, "end": 147, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 15 } }, "local": { "type": "Identifier", "start": 139, "end": 147, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 15 } }, "name": "Renderer" } } ], "importKind": "value", "source": { "type": "Literal", "start": 153, "end": 171, "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": 176, "end": 202, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 26 } }, "range": [ 176, 202 ] } ] }, { "type": "ExportNamedDeclaration", "start": 204, "end": 233, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 29 } }, "declaration": { "type": "VariableDeclaration", "start": 211, "end": 233, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 29 } }, "declarations": [ { "type": "VariableDeclarator", "start": 215, "end": 232, "loc": { "start": { "line": 7, "column": 11 }, "end": { "line": 7, "column": 28 } }, "id": { "type": "Identifier", "start": 215, "end": 222, "loc": { "start": { "line": 7, "column": 11 }, "end": { "line": 7, "column": 18 } }, "name": "version", "leadingComments": null }, "init": { "type": "Literal", "start": 225, "end": 232, "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": 176, "end": 202, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 26 } }, "range": [ 176, 202 ] } ], "trailingComments": [ { "type": "Block", "value": "* last created canvas ", "start": 235, "end": 261, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 26 } }, "range": [ 235, 261 ] } ] }, "specifiers": [], "source": null, "leadingComments": [ { "type": "Block", "value": "* Global awv3 version ", "start": 176, "end": 202, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 26 } }, "range": [ 176, 202 ] } ], "trailingComments": [ { "type": "Block", "value": "* last created canvas ", "start": 235, "end": 261, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 26 } }, "range": [ 235, 261 ] } ] }, { "type": "ExportNamedDeclaration", "start": 263, "end": 298, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 35 } }, "declaration": { "type": "VariableDeclaration", "start": 270, "end": 298, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 35 } }, "declarations": [ { "type": "VariableDeclarator", "start": 274, "end": 297, "loc": { "start": { "line": 9, "column": 11 }, "end": { "line": 9, "column": 34 } }, "id": { "type": "Identifier", "start": 274, "end": 285, "loc": { "start": { "line": 9, "column": 11 }, "end": { "line": 9, "column": 22 } }, "name": "lastCreated", "leadingComments": null }, "init": { "type": "Identifier", "start": 288, "end": 297, "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": 235, "end": 261, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 26 } }, "range": [ 235, 261 ] } ], "trailingComments": [ { "type": "Block", "value": "* The Canvas class holds the webGL context and maps the underlying views.\r\n It initializes it's own renderer, event system and parser. ", "start": 302, "end": 444, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 12, "column": 65 } }, "range": [ 302, 444 ] } ] }, "specifiers": [], "source": null, "leadingComments": [ { "type": "Block", "value": "* last created canvas ", "start": 235, "end": 261, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 26 } }, "range": [ 235, 261 ] } ], "trailingComments": [ { "type": "Block", "value": "* The Canvas class holds the webGL context and maps the underlying views.\r\n It initializes it's own renderer, event system and parser. ", "start": 302, "end": 444, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 12, "column": 65 } }, "range": [ 302, 444 ] } ] }, { "type": "ExportDefaultDeclaration", "start": 446, "end": 6000, "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 124, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 461, "end": 6000, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 124, "column": 1 } }, "id": { "type": "Identifier", "start": 467, "end": 473, "loc": { "start": { "line": 13, "column": 21 }, "end": { "line": 13, "column": 27 } }, "name": "Canvas", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 474, "end": 6000, "loc": { "start": { "line": 13, "column": 28 }, "end": { "line": 124, "column": 1 } }, "body": [ { "type": "MethodDefinition", "start": 2409, "end": 5592, "loc": { "start": { "line": 38, "column": 4 }, "end": { "line": 110, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 2409, "end": 2420, "loc": { "start": { "line": 38, "column": 4 }, "end": { "line": 38, "column": 15 } }, "name": "constructor", "leadingComments": null }, "static": false, "kind": "constructor", "value": { "type": "FunctionExpression", "start": 2420, "end": 5592, "loc": { "start": { "line": 38, "column": 15 }, "end": { "line": 110, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "AssignmentPattern", "start": 2421, "end": 2433, "loc": { "start": { "line": 38, "column": 16 }, "end": { "line": 38, "column": 28 } }, "operator": "=", "left": { "type": "Identifier", "start": 2421, "end": 2428, "loc": { "start": { "line": 38, "column": 16 }, "end": { "line": 38, "column": 23 } }, "name": "options" }, "right": { "type": "ObjectExpression", "start": 2431, "end": 2433, "loc": { "start": { "line": 38, "column": 26 }, "end": { "line": 38, "column": 28 } }, "properties": [] } } ], "body": { "type": "BlockStatement", "start": 2435, "end": 5592, "loc": { "start": { "line": 38, "column": 30 }, "end": { "line": 110, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 2477, "end": 2500, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 31 } }, "expression": { "type": "AssignmentExpression", "start": 2477, "end": 2499, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 30 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2477, "end": 2489, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 20 } }, "object": { "type": "ThisExpression", "start": 2477, "end": 2481, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2482, "end": 2489, "loc": { "start": { "line": 41, "column": 13 }, "end": { "line": 41, "column": 20 } }, "name": "version" }, "computed": false, "leadingComments": null }, "right": { "type": "Identifier", "start": 2492, "end": 2499, "loc": { "start": { "line": 41, "column": 23 }, "end": { "line": 41, "column": 30 } }, "name": "version" }, "leadingComments": null }, "leadingComments": [ { "type": "Block", "value": "* awv3 version ", "start": 2448, "end": 2467, "loc": { "start": { "line": 40, "column": 8 }, "end": { "line": 40, "column": 27 } }, "range": [ 2448, 2467 ] } ], "trailingComments": [ { "type": "Block", "value": "* GUID to help identify the canvas ", "start": 2510, "end": 2549, "loc": { "start": { "line": 42, "column": 8 }, "end": { "line": 42, "column": 47 } }, "range": [ 2510, 2549 ] } ] }, { "type": "ExpressionStatement", "start": 2559, "end": 2576, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 25 } }, "expression": { "type": "AssignmentExpression", "start": 2559, "end": 2575, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 24 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2559, "end": 2566, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 15 } }, "object": { "type": "ThisExpression", "start": 2559, "end": 2563, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2564, "end": 2566, "loc": { "start": { "line": 43, "column": 13 }, "end": { "line": 43, "column": 15 } }, "name": "id" }, "computed": false, "leadingComments": null }, "right": { "type": "CallExpression", "start": 2569, "end": 2575, "loc": { "start": { "line": 43, "column": 18 }, "end": { "line": 43, "column": 24 } }, "callee": { "type": "Identifier", "start": 2569, "end": 2573, "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": 2510, "end": 2549, "loc": { "start": { "line": 42, "column": 8 }, "end": { "line": 42, "column": 47 } }, "range": [ 2510, 2549 ] } ], "trailingComments": [ { "type": "Block", "value": "* List of managed views ", "start": 2586, "end": 2614, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 36 } }, "range": [ 2586, 2614 ] } ] }, { "type": "ExpressionStatement", "start": 2624, "end": 2640, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 24 } }, "expression": { "type": "AssignmentExpression", "start": 2624, "end": 2639, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 23 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2624, "end": 2634, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 18 } }, "object": { "type": "ThisExpression", "start": 2624, "end": 2628, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2629, "end": 2634, "loc": { "start": { "line": 45, "column": 13 }, "end": { "line": 45, "column": 18 } }, "name": "views" }, "computed": false, "leadingComments": null }, "right": { "type": "ArrayExpression", "start": 2637, "end": 2639, "loc": { "start": { "line": 45, "column": 21 }, "end": { "line": 45, "column": 23 } }, "elements": [] }, "leadingComments": null }, "leadingComments": [ { "type": "Block", "value": "* List of managed views ", "start": 2586, "end": 2614, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 36 } }, "range": [ 2586, 2614 ] } ] }, { "type": "IfStatement", "start": 2652, "end": 2964, "loc": { "start": { "line": 47, "column": 8 }, "end": { "line": 50, "column": 9 } }, "test": { "type": "UnaryExpression", "start": 2656, "end": 2668, "loc": { "start": { "line": 47, "column": 12 }, "end": { "line": 47, "column": 24 } }, "operator": "!", "prefix": true, "argument": { "type": "MemberExpression", "start": 2657, "end": 2668, "loc": { "start": { "line": 47, "column": 13 }, "end": { "line": 47, "column": 24 } }, "object": { "type": "Identifier", "start": 2657, "end": 2664, "loc": { "start": { "line": 47, "column": 13 }, "end": { "line": 47, "column": 20 } }, "name": "options" }, "property": { "type": "Identifier", "start": 2665, "end": 2668, "loc": { "start": { "line": 47, "column": 21 }, "end": { "line": 47, "column": 24 } }, "name": "dom" }, "computed": false } }, "consequent": { "type": "BlockStatement", "start": 2670, "end": 2964, "loc": { "start": { "line": 47, "column": 26 }, "end": { "line": 50, "column": 9 } }, "body": [ { "type": "ExpressionStatement", "start": 2685, "end": 2729, "loc": { "start": { "line": 48, "column": 12 }, "end": { "line": 48, "column": 56 } }, "expression": { "type": "AssignmentExpression", "start": 2685, "end": 2728, "loc": { "start": { "line": 48, "column": 12 }, "end": { "line": 48, "column": 55 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2685, "end": 2696, "loc": { "start": { "line": 48, "column": 12 }, "end": { "line": 48, "column": 23 } }, "object": { "type": "Identifier", "start": 2685, "end": 2692, "loc": { "start": { "line": 48, "column": 12 }, "end": { "line": 48, "column": 19 } }, "name": "options" }, "property": { "type": "Identifier", "start": 2693, "end": 2696, "loc": { "start": { "line": 48, "column": 20 }, "end": { "line": 48, "column": 23 } }, "name": "dom" }, "computed": false }, "right": { "type": "CallExpression", "start": 2699, "end": 2728, "loc": { "start": { "line": 48, "column": 26 }, "end": { "line": 48, "column": 55 } }, "callee": { "type": "MemberExpression", "start": 2699, "end": 2721, "loc": { "start": { "line": 48, "column": 26 }, "end": { "line": 48, "column": 48 } }, "object": { "type": "Identifier", "start": 2699, "end": 2707, "loc": { "start": { "line": 48, "column": 26 }, "end": { "line": 48, "column": 34 } }, "name": "document" }, "property": { "type": "Identifier", "start": 2708, "end": 2721, "loc": { "start": { "line": 48, "column": 35 }, "end": { "line": 48, "column": 48 } }, "name": "createElement" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 2722, "end": 2727, "loc": { "start": { "line": 48, "column": 49 }, "end": { "line": 48, "column": 54 } }, "value": "div", "rawValue": "div", "raw": "\"div\"" } ] } } }, { "type": "ExpressionStatement", "start": 2743, "end": 2953, "loc": { "start": { "line": 49, "column": 12 }, "end": { "line": 49, "column": 222 } }, "expression": { "type": "AssignmentExpression", "start": 2743, "end": 2952, "loc": { "start": { "line": 49, "column": 12 }, "end": { "line": 49, "column": 221 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2743, "end": 2768, "loc": { "start": { "line": 49, "column": 12 }, "end": { "line": 49, "column": 37 } }, "object": { "type": "MemberExpression",