From 2ef13ef6e85dc90807a31f17c26d02cea96d820e Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Wed, 29 Apr 2020 14:30:03 +0200 Subject: [PATCH] cousing -> sibling --- .../src/Expressions/ImplicitOperandConversion.ql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/javascript/ql/src/Expressions/ImplicitOperandConversion.ql b/javascript/ql/src/Expressions/ImplicitOperandConversion.ql index c9cb618626a..6b9a308869d 100644 --- a/javascript/ql/src/Expressions/ImplicitOperandConversion.ql +++ b/javascript/ql/src/Expressions/ImplicitOperandConversion.ql @@ -163,23 +163,23 @@ class PlusConversion extends NullOrUndefinedConversion { PlusConversion() { parent instanceof AddExpr or parent instanceof AssignAddExpr } override string getConversionTarget() { - result = getDefiniteCousinType() + result = getDefiniteSiblingType() or - not exists(getDefiniteCousinType()) and + not exists(getDefiniteSiblingType()) and result = "number or string" } /** - * Gets the cousin of this implicit conversion. - * E.g. if this is `a` in the expression `a + b`, then the cousin is `b`. + * Gets the sibling of this implicit conversion. + * E.g. if this is `a` in the expression `a + b`, then the sibling is `b`. */ - private Expr getCousin() { result = parent.getAChild() and not result = this.getEnclosingExpr() } + private Expr getSibling() { result = parent.getAChild() and not result = this.getEnclosingExpr() } /** - * Gets the unique type of the cousin expression, if that type is `string` or `number`. + * Gets the unique type of the sibling expression, if that type is `string` or `number`. */ - private string getDefiniteCousinType() { - result = unique(InferredType t | t = getCousin().flow().analyze().getAType()).getTypeofTag() and + private string getDefiniteSiblingType() { + result = unique(InferredType t | t = getSibling().flow().analyze().getAType()).getTypeofTag() and result = ["string", "number"] } }