Skip to content

Commit 61ef73b

Browse files
committed
JS: Add change note and deprecation member
1 parent 6246eb2 commit 61ef73b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

change-notes/1.21/analysis-javascript.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,7 @@
4848
* `RegExpLiteral` is now a `DataFlow::SourceNode`.
4949
* `JSDocTypeExpr` now has source locations and is a subclass of `Locatable` and `TypeAnnotation`.
5050
* Various predicates named `getTypeAnnotation()` now return `TypeAnnotation` instead of `TypeExpr`.
51-
In rare cases, this may cause compilation errors. Cast the result to `TypeExpr` if this happens.
51+
In rare cases, this may cause compilation errors in existing code. Cast the result to `TypeExpr` if this happens.
52+
* The `getALabel` predicate in `LabeledBarrierGuardNode` and `LabeledSanitizerGuardNode`
53+
has been deprecated and overriding it no longer has any effect.
54+
Instead use the 3-parameter version of `blocks` or `sanitizes`.

javascript/ql/src/semmle/javascript/dataflow/Configuration.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,13 @@ abstract class BarrierGuardNode extends DataFlow::Node {
320320
*/
321321
abstract class LabeledBarrierGuardNode extends BarrierGuardNode {
322322
override predicate blocks(boolean outcome, Expr e) { none() }
323+
324+
/**
325+
* DEPRECATED: Use `blocks(outcome, e, label)` or `sanitizes(outcome, e, label)` instead.
326+
*
327+
* Overriding this predicate has no effect.
328+
*/
329+
deprecated FlowLabel getALabel() { none() }
323330
}
324331

325332
/**

0 commit comments

Comments
 (0)