From fdccd5da7ebb1a23fdca63606e08391c9bedbb82 Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Fri, 30 Apr 2021 11:58:45 +0100 Subject: [PATCH] Add AstNode::isSynthesized() --- ql/src/codeql_ruby/AST.qll | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ql/src/codeql_ruby/AST.qll b/ql/src/codeql_ruby/AST.qll index 244b82b2ecc..0c895478ddf 100644 --- a/ql/src/codeql_ruby/AST.qll +++ b/ql/src/codeql_ruby/AST.qll @@ -64,4 +64,16 @@ class AstNode extends TAstNode { */ cached AstNode getAChild(string pred) { none() } + + /** + * Holds if this node was synthesized to represent an implicit AST node not + * present in the source code. In the following example method call, the + * receiver is an implicit `self` reference, for which there is a synthesized + * `Self` node. + * + * ```rb + * foo(123) + * ``` + */ + predicate isSynthesized() { this instanceof TImplicitSelf } }