ASTNode.getAChild与ASTNode.getChild
    #string-manipulations.js

    1. document.write(document.location.href.charCodeAt(0)); // OK
    2. document.write(document.location); // NOT OK
    3. document.write(document.location.href); // NOT OK
    4. document.write(document.location.href.valueOf()); // NOT OK
    5. document.write(document.location.href.sup()); // NOT OK
    6. document.write(document.location.href.toUpperCase()); // NOT OK
    7. document.write(document.location.href.trimLeft()); // NOT OK
    8. document.write(String.fromCharCode(document.location.href)); // NOT OK
    9. document.write(String(document.location.href)); // NOT OK
    10. document.write(escape(document.location.href)); // OK (for now)
    11. document.write(escape(escape(escape(document.location.href)))); // OK (for now)
    1. import javascript
    2. from ASTNode node
    3. where node.getFile().getBaseName() = "string-manipulations.js"
    4. select node, node.getAChild()

    image.png
    getAChild等价于i不受限制的getChild

    1. import javascript
    2. from ASTNode node, int i
    3. where node.getFile().getBaseName() = "string-manipulations.js"
    4. select node, node.getChild(i)

    image.png