{ "type": "File", "start": 0, "end": 383, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 21, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 383, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 21, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ExportDefaultDeclaration", "start": 180, "end": 382, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 20, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 195, "end": 382, "loc": { "start": { "line": 11, "column": 15 }, "end": { "line": 20, "column": 1 } }, "id": { "type": "Identifier", "start": 204, "end": 214, "loc": { "start": { "line": 11, "column": 24 }, "end": { "line": 11, "column": 34 }, "identifierName": "isParentOf" }, "name": "isParentOf", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 216, "end": 222, "loc": { "start": { "line": 11, "column": 36 }, "end": { "line": 11, "column": 42 }, "identifierName": "parent" }, "name": "parent" }, { "type": "Identifier", "start": 224, "end": 229, "loc": { "start": { "line": 11, "column": 44 }, "end": { "line": 11, "column": 49 }, "identifierName": "child" }, "name": "child" } ], "body": { "type": "BlockStatement", "start": 231, "end": 382, "loc": { "start": { "line": 11, "column": 51 }, "end": { "line": 20, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 235, "end": 256, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 23 } }, "expression": { "type": "AssignmentExpression", "start": 235, "end": 256, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 23 } }, "operator": "=", "left": { "type": "Identifier", "start": 235, "end": 240, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 7 }, "identifierName": "child" }, "name": "child" }, "right": { "type": "MemberExpression", "start": 243, "end": 256, "loc": { "start": { "line": 12, "column": 10 }, "end": { "line": 12, "column": 23 } }, "object": { "type": "Identifier", "start": 243, "end": 248, "loc": { "start": { "line": 12, "column": 10 }, "end": { "line": 12, "column": 15 }, "identifierName": "child" }, "name": "child" }, "property": { "type": "Identifier", "start": 249, "end": 256, "loc": { "start": { "line": 12, "column": 16 }, "end": { "line": 12, "column": 23 }, "identifierName": "_parent" }, "name": "_parent" }, "computed": false } } }, { "type": "WhileStatement", "start": 259, "end": 365, "loc": { "start": { "line": 13, "column": 2 }, "end": { "line": 18, "column": 3 } }, "test": { "type": "BinaryExpression", "start": 266, "end": 280, "loc": { "start": { "line": 13, "column": 9 }, "end": { "line": 13, "column": 23 } }, "left": { "type": "Identifier", "start": 266, "end": 271, "loc": { "start": { "line": 13, "column": 9 }, "end": { "line": 13, "column": 14 }, "identifierName": "child" }, "name": "child" }, "operator": "!==", "right": { "type": "NullLiteral", "start": 276, "end": 280, "loc": { "start": { "line": 13, "column": 19 }, "end": { "line": 13, "column": 23 } } } }, "body": { "type": "BlockStatement", "start": 282, "end": 365, "loc": { "start": { "line": 13, "column": 25 }, "end": { "line": 18, "column": 3 } }, "body": [ { "type": "IfStatement", "start": 288, "end": 335, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 16, "column": 5 } }, "test": { "type": "BinaryExpression", "start": 292, "end": 308, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 24 } }, "left": { "type": "Identifier", "start": 292, "end": 297, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 13 }, "identifierName": "child" }, "name": "child" }, "operator": "===", "right": { "type": "Identifier", "start": 302, "end": 308, "loc": { "start": { "line": 14, "column": 18 }, "end": { "line": 14, "column": 24 }, "identifierName": "parent" }, "name": "parent" } }, "consequent": { "type": "BlockStatement", "start": 310, "end": 335, "loc": { "start": { "line": 14, "column": 26 }, "end": { "line": 16, "column": 5 } }, "body": [ { "type": "ReturnStatement", "start": 318, "end": 329, "loc": { "start": { "line": 15, "column": 6 }, "end": { "line": 15, "column": 17 } }, "argument": { "type": "BooleanLiteral", "start": 325, "end": 329, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 15, "column": 17 } }, "value": true } } ], "directives": [] }, "alternate": null }, { "type": "ExpressionStatement", "start": 340, "end": 361, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 25 } }, "expression": { "type": "AssignmentExpression", "start": 340, "end": 361, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 25 } }, "operator": "=", "left": { "type": "Identifier", "start": 340, "end": 345, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 9 }, "identifierName": "child" }, "name": "child" }, "right": { "type": "MemberExpression", "start": 348, "end": 361, "loc": { "start": { "line": 17, "column": 12 }, "end": { "line": 17, "column": 25 } }, "object": { "type": "Identifier", "start": 348, "end": 353, "loc": { "start": { "line": 17, "column": 12 }, "end": { "line": 17, "column": 17 }, "identifierName": "child" }, "name": "child" }, "property": { "type": "Identifier", "start": 354, "end": 361, "loc": { "start": { "line": 17, "column": 18 }, "end": { "line": 17, "column": 25 }, "identifierName": "_parent" }, "name": "_parent" }, "computed": false } } } ], "directives": [] } }, { "type": "ReturnStatement", "start": 368, "end": 380, "loc": { "start": { "line": 19, "column": 2 }, "end": { "line": 19, "column": 14 } }, "argument": { "type": "BooleanLiteral", "start": 375, "end": 380, "loc": { "start": { "line": 19, "column": 9 }, "end": { "line": 19, "column": 14 } }, "value": false } } ], "directives": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * Check if `parent` is a parent of `child`.\n *\n * @param {Type} parent\n * @param {Type} child\n * @return {Boolean} Whether `parent` is a parent of `child`.\n *\n * @public\n ", "start": 1, "end": 179, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 10, "column": 3 } } } ], "trailingComments": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * Check if `parent` is a parent of `child`.\n *\n * @param {Type} parent\n * @param {Type} child\n * @return {Boolean} Whether `parent` is a parent of `child`.\n *\n * @public\n ", "start": 1, "end": 179, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 10, "column": 3 } } } ] } ], "directives": [] }, "comments": [ { "type": "CommentBlock", "value": "*\n * Check if `parent` is a parent of `child`.\n *\n * @param {Type} parent\n * @param {Type} child\n * @return {Boolean} Whether `parent` is a parent of `child`.\n *\n * @public\n ", "start": 1, "end": 179, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 10, "column": 3 } } } ], "tokens": [ { "type": "CommentBlock", "value": "*\n * Check if `parent` is a parent of `child`.\n *\n * @param {Type} parent\n * @param {Type} child\n * @return {Boolean} Whether `parent` is a parent of `child`.\n *\n * @public\n ", "start": 1, "end": 179, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 10, "column": 3 } } }, { "type": { "label": "export", "keyword": "export", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "export", "start": 180, "end": 186, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 6 } } }, { "type": { "label": "default", "keyword": "default", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "default", "start": 187, "end": 194, "loc": { "start": { "line": 11, "column": 7 }, "end": { "line": 11, "column": 14 } } }, { "type": { "label": "function", "keyword": "function", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "function", "start": 195, "end": 203, "loc": { "start": { "line": 11, "column": 15 }, "end": { "line": 11, "column": 23 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "isParentOf", "start": 204, "end": 214, "loc": { "start": { "line": 11, "column": 24 }, "end": { "line": 11, "column": 34 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 215, "end": 216, "loc": { "start": { "line": 11, "column": 35 }, "end": { "line": 11, "column": 36 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "parent", "start": 216, "end": 222, "loc": { "start": { "line": 11, "column": 36 }, "end": { "line": 11, "column": 42 } } }, { "type": { "label": ",", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 222, "end": 223, "loc": { "start": { "line": 11, "column": 42 }, "end": { "line": 11, "column": 43 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "child", "start": 224, "end": 229, "loc": { "start": { "line": 11, "column": 44 }, "end": { "line": 11, "column": 49 } } }, { "type": { "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 229, "end": 230, "loc": { "start": { "line": 11, "column": 49 }, "end": { "line": 11, "column": 50 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 231, "end": 232, "loc": { "start": { "line": 11, "column": 51 }, "end": { "line": 11, "column": 52 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "child", "start": 235, "end": 240, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 7 } } }, { "type": { "label": "=", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": true, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "=", "start": 241, "end": 242, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 9 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "child", "start": 243, "end": 248, "loc": { "start": { "line": 12, "column": 10 }, "end": { "line": 12, "column": 15 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 248, "end": 249, "loc": { "start": { "line": 12, "column": 15 }, "end": { "line": 12, "column": 16 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "_parent", "start": 249, "end": 256, "loc": { "start": { "line": 12, "column": 16 }, "end": { "line": 12, "column": 23 } } }, { "type": { "label": "while", "keyword": "while", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": true, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "while", "start": 259, "end": 264, "loc": { "start": { "line": 13, "column": 2 }, "end": { "line": 13, "column": 7 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 265, "end": 266, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 9 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "child", "start": 266, "end": 271, "loc": { "start": { "line": 13, "column": 9 }, "end": { "line": 13, "column": 14 } } }, { "type": { "label": "==/!=", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": 6, "updateContext": null }, "value": "!==", "start": 272, "end": 275, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 18 } } }, { "type": { "label": "null", "keyword": "null", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "null", "start": 276, "end": 280, "loc": { "start": { "line": 13, "column": 19 }, "end": { "line": 13, "column": 23 } } }, { "type": { "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 280, "end": 281, "loc": { "start": { "line": 13, "column": 23 }, "end": { "line": 13, "column": 24 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 282, "end": 283, "loc": { "start": { "line": 13, "column": 25 }, "end": { "line": 13, "column": 26 } } }, { "type": { "label": "if", "keyword": "if", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "if", "start": 288, "end": 290, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 6 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 291, "end": 292, "loc": { "start": { "line": 14, "column": 7 }, "end": { "line": 14, "column": 8 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "child", "start": 292, "end": 297, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 13 } } }, { "type": { "label": "==/!=", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": 6, "updateContext": null }, "value": "===", "start": 298, "end": 301, "loc": { "start": { "line": 14, "column": 14 }, "end": { "line": 14, "column": 17 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "parent", "start": 302, "end": 308, "loc": { "start": { "line": 14, "column": 18 }, "end": { "line": 14, "column": 24 } } }, { "type": { "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 308, "end": 309, "loc": { "start": { "line": 14, "column": 24 }, "end": { "line": 14, "column": 25 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 310, "end": 311, "loc": { "start": { "line": 14, "column": 26 }, "end": { "line": 14, "column": 27 } } }, { "type": { "label": "return", "keyword": "return", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "return", "start": 318, "end": 324, "loc": { "start": { "line": 15, "column": 6 }, "end": { "line": 15, "column": 12 } } }, { "type": { "label": "true", "keyword": "true", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "true", "start": 325, "end": 329, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 15, "column": 17 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 334, "end": 335, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 5 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "child", "start": 340, "end": 345, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 9 } } }, { "type": { "label": "=", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": true, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "=", "start": 346, "end": 347, "loc": { "start": { "line": 17, "column": 10 }, "end": { "line": 17, "column": 11 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "child", "start": 348, "end": 353, "loc": { "start": { "line": 17, "column": 12 }, "end": { "line": 17, "column": 17 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 353, "end": 354, "loc": { "start": { "line": 17, "column": 17 }, "end": { "line": 17, "column": 18 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "_parent", "start": 354, "end": 361, "loc": { "start": { "line": 17, "column": 18 }, "end": { "line": 17, "column": 25 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 364, "end": 365, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 18, "column": 3 } } }, { "type": { "label": "return", "keyword": "return", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "return", "start": 368, "end": 374, "loc": { "start": { "line": 19, "column": 2 }, "end": { "line": 19, "column": 8 } } }, { "type": { "label": "false", "keyword": "false", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "false", "start": 375, "end": 380, "loc": { "start": { "line": 19, "column": 9 }, "end": { "line": 19, "column": 14 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 381, "end": 382, "loc": { "start": { "line": 20, "column": 0 }, "end": { "line": 20, "column": 1 } } }, { "type": { "label": "eof", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 383, "end": 383, "loc": { "start": { "line": 21, "column": 0 }, "end": { "line": 21, "column": 0 } } } ] }