UNPKG

awv3

Version:
1,609 lines (1,608 loc) 563 kB
{ "type": "File", "start": 0, "end": 5813, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 125, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 5813, "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": 224, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 30 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 201, "end": 224, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 30 } }, "declarations": [ { "type": "VariableDeclarator", "start": 205, "end": 223, "loc": { "start": { "line": 8, "column": 11 }, "end": { "line": 8, "column": 29 } }, "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": 223, "loc": { "start": { "line": 8, "column": 21 }, "end": { "line": 8, "column": 29 } }, "extra": { "rawValue": "7.0.19", "raw": "'7.0.19'" }, "value": "7.0.19" }, "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": 225, "end": 251, "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": 225, "end": 251, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 26 } } } ] }, { "type": "ExportNamedDeclaration", "start": 252, "end": 287, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 35 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 259, "end": 287, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 35 } }, "declarations": [ { "type": "VariableDeclarator", "start": 263, "end": 286, "loc": { "start": { "line": 10, "column": 11 }, "end": { "line": 10, "column": 34 } }, "id": { "type": "Identifier", "start": 263, "end": 274, "loc": { "start": { "line": 10, "column": 11 }, "end": { "line": 10, "column": 22 }, "identifierName": "lastCreated" }, "name": "lastCreated", "leadingComments": null }, "init": { "type": "Identifier", "start": 277, "end": 286, "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": 225, "end": 251, "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": 289, "end": 430, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 13, "column": 65 } } } ] }, "leadingComments": [ { "type": "CommentBlock", "value": "* last created canvas ", "start": 225, "end": 251, "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": 289, "end": 430, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 13, "column": 65 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 431, "end": 5812, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 124, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 446, "end": 5812, "loc": { "start": { "line": 14, "column": 15 }, "end": { "line": 124, "column": 1 } }, "id": { "type": "Identifier", "start": 452, "end": 458, "loc": { "start": { "line": 14, "column": 21 }, "end": { "line": 14, "column": 27 }, "identifierName": "Canvas" }, "name": "Canvas", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 459, "end": 5812, "loc": { "start": { "line": 14, "column": 28 }, "end": { "line": 124, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 2369, "end": 5418, "loc": { "start": { "line": 39, "column": 4 }, "end": { "line": 110, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 2369, "end": 2380, "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": 2381, "end": 2393, "loc": { "start": { "line": 39, "column": 16 }, "end": { "line": 39, "column": 28 } }, "left": { "type": "Identifier", "start": 2381, "end": 2388, "loc": { "start": { "line": 39, "column": 16 }, "end": { "line": 39, "column": 23 }, "identifierName": "options" }, "name": "options" }, "right": { "type": "ObjectExpression", "start": 2391, "end": 2393, "loc": { "start": { "line": 39, "column": 26 }, "end": { "line": 39, "column": 28 } }, "properties": [] } } ], "body": { "type": "BlockStatement", "start": 2395, "end": 5418, "loc": { "start": { "line": 39, "column": 30 }, "end": { "line": 110, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 2434, "end": 2457, "loc": { "start": { "line": 42, "column": 8 }, "end": { "line": 42, "column": 31 } }, "expression": { "type": "AssignmentExpression", "start": 2434, "end": 2456, "loc": { "start": { "line": 42, "column": 8 }, "end": { "line": 42, "column": 30 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2434, "end": 2446, "loc": { "start": { "line": 42, "column": 8 }, "end": { "line": 42, "column": 20 } }, "object": { "type": "ThisExpression", "start": 2434, "end": 2438, "loc": { "start": { "line": 42, "column": 8 }, "end": { "line": 42, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2439, "end": 2446, "loc": { "start": { "line": 42, "column": 13 }, "end": { "line": 42, "column": 20 }, "identifierName": "version" }, "name": "version" }, "computed": false, "leadingComments": null }, "right": { "type": "Identifier", "start": 2449, "end": 2456, "loc": { "start": { "line": 42, "column": 23 }, "end": { "line": 42, "column": 30 }, "identifierName": "version" }, "name": "version" }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* awv3 version ", "start": 2406, "end": 2425, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 27 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* GUID to help identify the canvas ", "start": 2466, "end": 2505, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 47 } } } ] }, { "type": "ExpressionStatement", "start": 2514, "end": 2529, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 23 } }, "expression": { "type": "AssignmentExpression", "start": 2514, "end": 2528, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 22 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2514, "end": 2521, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 15 } }, "object": { "type": "ThisExpression", "start": 2514, "end": 2518, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2519, "end": 2521, "loc": { "start": { "line": 44, "column": 13 }, "end": { "line": 44, "column": 15 }, "identifierName": "id" }, "name": "id" }, "computed": false, "leadingComments": null }, "right": { "type": "CallExpression", "start": 2524, "end": 2528, "loc": { "start": { "line": 44, "column": 18 }, "end": { "line": 44, "column": 22 } }, "callee": { "type": "Identifier", "start": 2524, "end": 2526, "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": 2466, "end": 2505, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 47 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* List of managed views ", "start": 2538, "end": 2566, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 36 } } } ] }, { "type": "ExpressionStatement", "start": 2575, "end": 2591, "loc": { "start": { "line": 46, "column": 8 }, "end": { "line": 46, "column": 24 } }, "expression": { "type": "AssignmentExpression", "start": 2575, "end": 2590, "loc": { "start": { "line": 46, "column": 8 }, "end": { "line": 46, "column": 23 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2575, "end": 2585, "loc": { "start": { "line": 46, "column": 8 }, "end": { "line": 46, "column": 18 } }, "object": { "type": "ThisExpression", "start": 2575, "end": 2579, "loc": { "start": { "line": 46, "column": 8 }, "end": { "line": 46, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 2580, "end": 2585, "loc": { "start": { "line": 46, "column": 13 }, "end": { "line": 46, "column": 18 }, "identifierName": "views" }, "name": "views" }, "computed": false, "leadingComments": null }, "right": { "type": "ArrayExpression", "start": 2588, "end": 2590, "loc": { "start": { "line": 46, "column": 21 }, "end": { "line": 46, "column": 23 } }, "elements": [] }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* List of managed views ", "start": 2538, "end": 2566, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 36 } } } ] }, { "type": "IfStatement", "start": 2601, "end": 2910, "loc": { "start": { "line": 48, "column": 8 }, "end": { "line": 51, "column": 9 } }, "test": { "type": "UnaryExpression", "start": 2605, "end": 2617, "loc": { "start": { "line": 48, "column": 12 }, "end": { "line": 48, "column": 24 } }, "operator": "!", "prefix": true, "argument": { "type": "MemberExpression", "start": 2606, "end": 2617, "loc": { "start": { "line": 48, "column": 13 }, "end": { "line": 48, "column": 24 } }, "object": { "type": "Identifier", "start": 2606, "end": 2613, "loc": { "start": { "line": 48, "column": 13 }, "end": { "line": 48, "column": 20 }, "identifierName": "options" }, "name": "options" }, "property": { "type": "Identifier", "start": 2614, "end": 2617, "loc": { "start": { "line": 48, "column": 21 }, "end": { "line": 48, "column": 24 }, "identifierName": "dom" }, "name": "dom" }, "computed": false }, "extra": { "parenthesizedArgument": false } }, "consequent": { "type": "BlockStatement", "start": 2619, "end": 2910, "loc": { "start": { "line": 48, "column": 26 }, "end": { "line": 51, "column": 9 } }, "body": [ { "type": "ExpressionStatement", "start": 2633, "end": 2677, "loc": { "start": { "line": 49, "column": 12 }, "end": { "line": 49, "column": 56 } }, "expression": { "type": "AssignmentExpression", "start": 2633, "end": 2676, "loc": { "start": { "line": 49, "column": 12 }, "end": { "line": 49, "column": 55 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2633, "end": 2644, "loc": { "start": { "line": 49, "column": 12 }, "end": { "line": 49, "column": 23 } }, "object": { "type": "Identifier", "start": 2633, "end": 2640, "loc": { "start": { "line": 49, "column": 12 }, "end": { "line": 49, "column": 19 }, "identifierName": "options" }, "name": "options" }, "property": { "type": "Identifier", "start": 2641, "end": 2644, "loc": { "start": { "line": 49, "column": 20 }, "end": { "line": 49, "column": 23 }, "identifierName": "dom" }, "name": "dom" }, "computed": false }, "right": { "type": "CallExpression", "start": 2647, "end": 2676, "loc": { "start": { "line": 49, "column": 26 }, "end": { "line": 49, "column": 55 } }, "callee": { "type": "MemberExpression", "start": 2647, "end": 2669, "loc": { "start": { "line": 49, "column": 26 }, "end": { "line": 49, "column": 48 } }, "object": { "type": "Identifier", "start": 2647, "end": 2655, "loc": { "start": { "line": 49, "column": 26 }, "end": { "line": 49, "column": 34 }, "identifierName": "document" }, "name": "document" }, "property": { "type": "Identifier", "start": 2656, "end": 2669, "loc": { "start": { "line": 49, "column": 35 }, "end": { "line": 49, "column": 48 }, "identifierName": "createElement" }, "name": "createElement" }, "computed": false }, "arguments": [ { "type": "StringLiteral", "start": 2670, "end": 2675, "loc": { "start": { "line": 49, "column": 49 }, "end": { "line": 49, "column": 54 } }, "extra": { "rawValue": "div", "raw": "\"div\"" }, "value": "div"