function hasScopeRef(node, ids) {
    if (!node || Object.keys(ids).length === 0) {
        return false;
    }
    switch (node.type) {
        case 1 /* ELEMENT */:
            for (let i = 0; i < node.props.length; i++) {
                const p = node.props[i];
                if (p.type === 7 /* DIRECTIVE */ &&
                    (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {
                    return true;
                }
            }
            return node.children.some(c => hasScopeRef(c, ids));
        case 11 /* FOR */:
            if (hasScopeRef(node.source, ids)) {
                return true;
            }
            return node.children.some(c => hasScopeRef(c, ids));
        case 9 /* IF */:
            return node.branches.some(b => hasScopeRef(b, ids));
        case 10 /* IF_BRANCH */:
            if (hasScopeRef(node.condition, ids)) {
                return true;
            }
            return node.children.some(c => hasScopeRef(c, ids));
        case 4 /* SIMPLE_EXPRESSION */:
            return (!node.isStatic &&
                isSimpleIdentifier(node.content) &&
                !!ids[node.content]);
        case 8 /* COMPOUND_EXPRESSION */:
            return node.children.some(c => isObject(c) && hasScopeRef(c, ids));
        case 5 /* INTERPOLATION */:
        case 12 /* TEXT_CALL */:
            return hasScopeRef(node.content, ids);
        case 2 /* TEXT */:
        case 3 /* COMMENT */:
            return false;
        default:
            if (__DEV__) {
                const exhaustiveCheck = node;
                exhaustiveCheck;
            }
            return false;
    }
}
// Check if a node contains expressions that reference current context scope ids
Check if a node contains expressions that reference current context scope ids
Check if a node contains expressions that reference current context scope ids
function hasScopeRef(node, ids) {
    if (!node || Object.keys(ids).length === 0) {
        return false;
    }
    switch (node.type) {
        case 1 :
            for (let i = 0; i < node.props.length; i++) {
                const p = node.props[i];
                if (p.type === 7  &&
                    (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {
                    return true;
                }
            }
            return node.children.some(c => hasScopeRef(c, ids));
        case 11 :
            if (hasScopeRef(node.source, ids)) {
                return true;
            }
            return node.children.some(c => hasScopeRef(c, ids));
        case 9 :
            return node.branches.some(b => hasScopeRef(b, ids));
        case 10 :
            if (hasScopeRef(node.condition, ids)) {
                return true;
            }
            return node.children.some(c => hasScopeRef(c, ids));
        case 4 :
            return (!node.isStatic &&
                isSimpleIdentifier(node.content) &&
                !!ids[node.content]);
        case 8 :
            return node.children.some(c => isObject(c) && hasScopeRef(c, ids));
        case 5 :
        case 12 :
            return hasScopeRef(node.content, ids);
        case 2 :
        case 3 :
            return false;
        default:
            if (__DEV__) {
                const exhaustiveCheck = node;
                exhaustiveCheck;
            }
            return false;
    }
}
function hasScopeRef ( node , ids ) { if ( ! node || Object . keys ( ids ) . length === 0 ) { return false ; } switch ( node . type ) { case 1 : for ( let i = 0 ; i < node . props . length ; i ++ ) { const p = node . props [ i ] ; if ( p . type === 7 && ( hasScopeRef ( p . arg , ids ) || hasScopeRef ( p . exp , ids ) ) ) { return true ; } } return node . children . some ( c => hasScopeRef ( c , ids ) ) ; case 11 : if ( hasScopeRef ( node . source , ids ) ) { return true ; } return node . children . some ( c => hasScopeRef ( c , ids ) ) ; case 9 : return node . branches . some ( b => hasScopeRef ( b , ids ) ) ; case 10 : if ( hasScopeRef ( node . condition , ids ) ) { return true ; } return node . children . some ( c => hasScopeRef ( c , ids ) ) ; case 4 : return ( ! node . isStatic && isSimpleIdentifier ( node . content ) && ! ! ids [ node . content ] ) ; case 8 : return node . children . some ( c => isObject ( c ) && hasScopeRef ( c , ids ) ) ; case 5 : case 12 : return hasScopeRef ( node . content , ids ) ; case 2 : case 3 : return false ; default : if ( __DEV__ ) { const exhaustiveCheck = node ; exhaustiveCheck ; } return false ; } }
Check if a node contains expressions that reference current context scope ids
Check if a node contains expressions that reference current context scope ids
/* ELEMENT */ /* DIRECTIVE */ /* FOR */ /* IF */ /* IF_BRANCH */ /* SIMPLE_EXPRESSION */ /* COMPOUND_EXPRESSION */ /* INTERPOLATION */ /* TEXT_CALL */ /* TEXT */ /* COMMENT */