Skip to content

Commit 9b014c3

Browse files
committed
JS: Avoid lots of unhelpful magic
1 parent a828359 commit 9b014c3

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ module DataFlow {
586586
* This predicate is undefined for spread properties, accessor
587587
* properties, and most uses of `Object.defineProperty`.
588588
*/
589+
pragma[nomagic]
589590
abstract Node getRhs();
590591

591592
/**

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ class InvokeNode extends DataFlow::SourceNode {
156156
* Holds if the `i`th argument of this invocation is an object literal whose property
157157
* `name` is set to `result`.
158158
*/
159+
pragma[nomagic]
159160
DataFlow::ValueNode getOptionArgument(int i, string name) {
160161
getOptionsArgument(i).hasPropertyWrite(name, result)
161162
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class SourceNode extends DataFlow::Node {
7070
* Holds if there is an assignment to property `propName` on this node,
7171
* and the right hand side of the assignment is `rhs`.
7272
*/
73+
pragma[nomagic]
7374
predicate hasPropertyWrite(string propName, DataFlow::Node rhs) {
7475
rhs = getAPropertyWrite(propName).getRhs()
7576
}

javascript/ql/src/semmle/javascript/frameworks/AngularJS/AngularJSCore.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ class ComponentDirective extends CustomDirective, MkCustomComponent {
461461

462462
override DataFlow::Node getDefinition() { result = comp }
463463

464+
pragma[nomagic]
464465
override DataFlow::ValueNode getMemberInit(string name) {
465466
comp.getConfig().hasPropertyWrite(name, result)
466467
}

0 commit comments

Comments
 (0)