UNPKG

awv3

Version:
1,609 lines (1,608 loc) 563 kB
{ "type": "File", "start": 0, "end": 5812, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 125, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 5812, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 125, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 25, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 25 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 9, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 9 } }, "local": { "type": "Identifier", "start": 7, "end": 9, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 9 }, "identifierName": "v4" }, "name": "v4" } } ], "source": { "type": "StringLiteral", "start": 15, "end": 24, "loc": { "start": { "line": 1, "column": 15 }, "end": { "line": 1, "column": 24 } }, "extra": { "rawValue": "uuid-v4", "raw": "'uuid-v4'" }, "value": "uuid-v4" } }, { "type": "ImportDeclaration", "start": 26, "end": 68, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 42 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 35, "end": 43, "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 17 } }, "imported": { "type": "Identifier", "start": 35, "end": 43, "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 17 }, "identifierName": "queryDom" }, "name": "queryDom" }, "local": { "type": "Identifier", "start": 35, "end": 43, "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 17 }, "identifierName": "queryDom" }, "name": "queryDom" } }, { "type": "ImportSpecifier", "start": 45, "end": 48, "loc": { "start": { "line": 2, "column": 19 }, "end": { "line": 2, "column": 22 } }, "imported": { "type": "Identifier", "start": 45, "end": 48, "loc": { "start": { "line": 2, "column": 19 }, "end": { "line": 2, "column": 22 }, "identifierName": "url" }, "name": "url" }, "local": { "type": "Identifier", "start": 45, "end": 48, "loc": { "start": { "line": 2, "column": 19 }, "end": { "line": 2, "column": 22 }, "identifierName": "url" }, "name": "url" } } ], "source": { "type": "StringLiteral", "start": 56, "end": 67, "loc": { "start": { "line": 2, "column": 30 }, "end": { "line": 2, "column": 41 } }, "extra": { "rawValue": "./helpers", "raw": "'./helpers'" }, "value": "./helpers" } }, { "type": "ImportDeclaration", "start": 69, "end": 99, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 30 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 76, "end": 82, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 } }, "local": { "type": "Identifier", "start": 76, "end": 82, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 }, "identifierName": "Parser" }, "name": "Parser" } } ], "source": { "type": "StringLiteral", "start": 88, "end": 98, "loc": { "start": { "line": 3, "column": 19 }, "end": { "line": 3, "column": 29 } }, "extra": { "rawValue": "./parser", "raw": "'./parser'" }, "value": "./parser" } }, { "type": "ImportDeclaration", "start": 100, "end": 130, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 30 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 107, "end": 113, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 13 } }, "local": { "type": "Identifier", "start": 107, "end": 113, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 13 }, "identifierName": "Events" }, "name": "Events" } } ], "source": { "type": "StringLiteral", "start": 119, "end": 129, "loc": { "start": { "line": 4, "column": 19 }, "end": { "line": 4, "column": 29 } }, "extra": { "rawValue": "./events", "raw": "'./events'" }, "value": "./events" } }, { "type": "ImportDeclaration", "start": 131, "end": 165, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 34 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 138, "end": 146, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 15 } }, "local": { "type": "Identifier", "start": 138, "end": 146, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 15 }, "identifierName": "Renderer" }, "name": "Renderer" } } ], "source": { "type": "StringLiteral", "start": 152, "end": 164, "loc": { "start": { "line": 5, "column": 21 }, "end": { "line": 5, "column": 33 } }, "extra": { "rawValue": "./renderer", "raw": "'./renderer'" }, "value": "./renderer" }, "trailingComments": [ { "type": "CommentBlock", "value": "* Global awv3 version ", "start": 167, "end": 193, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 26 } } } ] }, { "type": "ExportNamedDeclaration", "start": 194, "end": 223, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 29 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 201, "end": 223, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 29 } }, "declarations": [ { "type": "VariableDeclarator", "start": 205, "end": 222, "loc": { "start": { "line": 8, "column": 11 }, "end": { "line": 8, "column": 28 } }, "id": { "type": "Identifier", "start": 205, "end": 212, "loc": { "start": { "line": 8, "column": 11 }, "end": { "line": 8, "column": 18 }, "identifierName": "version" }, "name": "version", "leadingComments": null }, "init": { "type": "StringLiteral", "start": 215, "end": 222, "loc": { "start": { "line": 8, "column": 21 }, "end": { "line": 8, "column": 28 } }, "extra": { "rawValue": "2.0.4", "raw": "'2.0.4'" }, "value": "2.0.4" }, "leadingComments": null } ], "kind": "let", "leadingComments": [ { "type": "CommentBlock", "value": "* Global awv3 version ", "start": 167, "end": 193, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 26 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* last created canvas ", "start": 224, "end": 250, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 26 } } } ] }, "leadingComments": [ { "type": "CommentBlock", "value": "* Global awv3 version ", "start": 167, "end": 193, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 26 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* last created canvas ", "start": 224, "end": 250, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 26 } } } ] }, { "type": "ExportNamedDeclaration", "start": 251, "end": 286, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 35 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 258, "end": 286, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 35 } }, "declarations": [ { "type": "VariableDeclarator", "start": 262, "end": 285, "loc": { "start": { "line": 10, "column": 11 }, "end": { "line": 10, "column": 34 } }, "id": { "type": "Identifier", "start": 262, "end": 273, "loc": { "start": { "line": 10, "column": 11 }, "end": { "line": 10, "column": 22 }, "identifierName": "lastCreated" }, "name": "lastCreated", "leadingComments": null }, "init": { "type": "Identifier", "start": 276, "end": 285, "loc": { "start": { "line": 10, "column": 25 }, "end": { "line": 10, "column": 34 }, "identifierName": "undefined" }, "name": "undefined" }, "leadingComments": null } ], "kind": "let", "leadingComments": [ { "type": "CommentBlock", "value": "* last created canvas ", "start": 224, "end": 250, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 26 } } } ], "trailingComments": [ { "type": "CommentBlock", "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": 288, "end": 429, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 13, "column": 65 } } } ] }, "leadingComments": [ { "type": "CommentBlock", "value": "* last created canvas ", "start": 224, "end": 250, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 26 } } } ], "trailingComments": [ { "type": "CommentBlock", "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": 288, "end": 429, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 13, "column": 65 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 430, "end": 5811, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 124, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 445, "end": 5811, "loc": { "start": { "line": 14, "column": 15 }, "end": { "line": 124, "column": 1 } }, "id": { "type": "Identifier", "start": 451, "end": 457, "loc": { "start": { "line": 14, "column": 21 }, "end": { "line": 14, "column": 27 }, "identifierName": "Canvas" }, "name": "Canvas", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 458, "end": 5811, "loc": { "start": { "line": 14, "column": 28 }, "end": { "line": 124, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 2368, "end": 5417, "loc": { "start": { "line": 39, "column": 4 }, "end": { "line": 110, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 2368, "end": 2379, "loc": { "start": { "line": 39, "column": 4 }, "end": { "line": 39, "column": 15 }, "identifierName": "constructor" }, "name": "constructor", "leadingComments": null }, "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "AssignmentPattern", "start": 2380, "end": 2392, "loc": { "start": { "line": 39, "column": 16 }, "end": { "line": 39, "column": 28 } }, "left": { "type": "Identifier", "start": 2380, "end": 2387, "loc": { "start": { "line": 39, "column": 16 }, "end": { "line": 39, "column": 23 }, "identifierName": "options" }, "name": "options" }, "right": { "type": "ObjectExpression", "start": 2390, "end": 2392, "loc": { "start": { "line": 39, "column": 26 }, "end": { "line": 39, "column": 28 } }, "properties": [] } } ], "body": { "type": "BlockStatement", "start": 2394, "end": 5417, "loc": { "start": { "line": 39, "column": 30 }, "end": { "line": 110, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 2433, "end": 2456, "loc": { "start": { "line": 42, "column": 8 }, "end": { "line": 42, "column": 31 } }, "expression": { "type": "AssignmentExpression", "start": 2433, "end": 2455, "loc": { "start": { "line": 42, "column": 8 }, "end": { "line": 42, "column": 30 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2433, "end": 2445, "loc": { "start": { "line": 42, "column": 8 }, "end": { "line": 42, "column": 20 } }, "object": { "type": "ThisExpression", "start": 2433, "end": 2437, "loc": { "start": { "line": 42, "column": 8 }, "end": { "line": 42, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2438, "end": 2445, "loc": { "start": { "line": 42, "column": 13 }, "end": { "line": 42, "column": 20 }, "identifierName": "version" }, "name": "version" }, "computed": false, "leadingComments": null }, "right": { "type": "Identifier", "start": 2448, "end": 2455, "loc": { "start": { "line": 42, "column": 23 }, "end": { "line": 42, "column": 30 }, "identifierName": "version" }, "name": "version" }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* awv3 version ", "start": 2405, "end": 2424, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 27 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* GUID to help identify the canvas ", "start": 2465, "end": 2504, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 47 } } } ] }, { "type": "ExpressionStatement", "start": 2513, "end": 2528, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 23 } }, "expression": { "type": "AssignmentExpression", "start": 2513, "end": 2527, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 22 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2513, "end": 2520, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 15 } }, "object": { "type": "ThisExpression", "start": 2513, "end": 2517, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2518, "end": 2520, "loc": { "start": { "line": 44, "column": 13 }, "end": { "line": 44, "column": 15 }, "identifierName": "id" }, "name": "id" }, "computed": false, "leadingComments": null }, "right": { "type": "CallExpression", "start": 2523, "end": 2527, "loc": { "start": { "line": 44, "column": 18 }, "end": { "line": 44, "column": 22 } }, "callee": { "type": "Identifier", "start": 2523, "end": 2525, "loc": { "start": { "line": 44, "column": 18 }, "end": { "line": 44, "column": 20 }, "identifierName": "v4" }, "name": "v4" }, "arguments": [] }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* GUID to help identify the canvas ", "start": 2465, "end": 2504, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 47 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* List of managed views ", "start": 2537, "end": 2565, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 36 } } } ] }, { "type": "ExpressionStatement", "start": 2574, "end": 2590, "loc": { "start": { "line": 46, "column": 8 }, "end": { "line": 46, "column": 24 } }, "expression": { "type": "AssignmentExpression", "start": 2574, "end": 2589, "loc": { "start": { "line": 46, "column": 8 }, "end": { "line": 46, "column": 23 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2574, "end": 2584, "loc": { "start": { "line": 46, "column": 8 }, "end": { "line": 46, "column": 18 } }, "object": { "type": "ThisExpression", "start": 2574, "end": 2578, "loc": { "start": { "line": 46, "column": 8 }, "end": { "line": 46, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2579, "end": 2584, "loc": { "start": { "line": 46, "column": 13 }, "end": { "line": 46, "column": 18 }, "identifierName": "views" }, "name": "views" }, "computed": false, "leadingComments": null }, "right": { "type": "ArrayExpression", "start": 2587, "end": 2589, "loc": { "start": { "line": 46, "column": 21 }, "end": { "line": 46, "column": 23 } }, "elements": [] }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* List of managed views ", "start": 2537, "end": 2565, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 36 } } } ] }, { "type": "IfStatement", "start": 2600, "end": 2909, "loc": { "start": { "line": 48, "column": 8 }, "end": { "line": 51, "column": 9 } }, "test": { "type": "UnaryExpression", "start": 2604, "end": 2616, "loc": { "start": { "line": 48, "column": 12 }, "end": { "line": 48, "column": 24 } }, "operator": "!", "prefix": true, "argument": { "type": "MemberExpression", "start": 2605, "end": 2616, "loc": { "start": { "line": 48, "column": 13 }, "end": { "line": 48, "column": 24 } }, "object": { "type": "Identifier", "start": 2605, "end": 2612, "loc": { "start": { "line": 48, "column": 13 }, "end": { "line": 48, "column": 20 }, "identifierName": "options" }, "name": "options" }, "property": { "type": "Identifier", "start": 2613, "end": 2616, "loc": { "start": { "line": 48, "column": 21 }, "end": { "line": 48, "column": 24 }, "identifierName": "dom" }, "name": "dom" }, "computed": false }, "extra": { "parenthesizedArgument": false } }, "consequent": { "type": "BlockStatement", "start": 2618, "end": 2909, "loc": { "start": { "line": 48, "column": 26 }, "end": { "line": 51, "column": 9 } }, "body": [ { "type": "ExpressionStatement", "start": 2632, "end": 2676, "loc": { "start": { "line": 49, "column": 12 }, "end": { "line": 49, "column": 56 } }, "expression": { "type": "AssignmentExpression", "start": 2632, "end": 2675, "loc": { "start": { "line": 49, "column": 12 }, "end": { "line": 49, "column": 55 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2632, "end": 2643, "loc": { "start": { "line": 49, "column": 12 }, "end": { "line": 49, "column": 23 } }, "object": { "type": "Identifier", "start": 2632, "end": 2639, "loc": { "start": { "line": 49, "column": 12 }, "end": { "line": 49, "column": 19 }, "identifierName": "options" }, "name": "options" }, "property": { "type": "Identifier", "start": 2640, "end": 2643, "loc": { "start": { "line": 49, "column": 20 }, "end": { "line": 49, "column": 23 }, "identifierName": "dom" }, "name": "dom" }, "computed": false }, "right": { "type": "CallExpression", "start": 2646, "end": 2675, "loc": { "start": { "line": 49, "column": 26 }, "end": { "line": 49, "column": 55 } }, "callee": { "type": "MemberExpression", "start": 2646, "end": 2668, "loc": { "start": { "line": 49, "column": 26 }, "end": { "line": 49, "column": 48 } }, "object": { "type": "Identifier", "start": 2646, "end": 2654, "loc": { "start": { "line": 49, "column": 26 }, "end": { "line": 49, "column": 34 }, "identifierName": "document" }, "name": "document" }, "property": { "type": "Identifier", "start": 2655, "end": 2668, "loc": { "start": { "line": 49, "column": 35 }, "end": { "line": 49, "column": 48 }, "identifierName": "createElement" }, "name": "createElement" }, "computed": false }, "arguments": [ { "type": "StringLiteral", "start": 2669, "end": 2674, "loc": { "start": { "line": 49, "column": 49 }, "end": { "line": 49, "column": 54 } }, "extra": { "rawValue": "div", "raw": "\"div\"" }, "value": "div"