lib/tools/phantomas/custom_modules/core/scopeYLT/scopeYLT.js
function readFullTree() {
                        // Return null if the contextTree is not correctly closed
                        if (root !== currentContext) {
                            return null;
                        }

                        function recusiveRead(node) {
                            if (node.children.length === 0) {
                                delete node.children;
                            } else {
                                for (var i=0, max=node.children.length ; i<max ; i++) {
                                    recusiveRead(node.children[i]);
                                }
                            }
                            delete node.parent;
                        }
                        recusiveRead(root);

                        return root;
                    }
function readFullTree() {
                        // Return null if the contextTree is not correctly closed
                        if (root !== currentContext) {
                            return null;
                        }

                        function recusiveRead(node) {
                            if (node.children.length === 0) {
                                delete node.children;
                            } else {
                                for (var i=0, max=node.children.length ; i<max ; i++) {
                                    recusiveRead(node.children[i]);
                                }
                            }
                            delete node.parent;
                        }
                        recusiveRead(root);

                        return root;
                    }
function readFullTree ( ) { // Return null if the contextTree is not correctly closed if ( root !== currentContext ) { return null ; } function recusiveRead ( node ) { if ( node . children . length === 0 ) { delete node . children ; } else { for ( var i = 0 , max = node . children . length ; i < max ; i ++ ) { recusiveRead ( node . children [ i ] ) ; } } delete node . parent ; } recusiveRead ( root ) ; return root ; }
Returns a clean object, without the parent which causes recursive loops
Returns a clean object without the parent which causes recursive loops