mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
JS: Avoid lots of unhelpful magic
This commit is contained in:
@@ -586,6 +586,7 @@ module DataFlow {
|
||||
* This predicate is undefined for spread properties, accessor
|
||||
* properties, and most uses of `Object.defineProperty`.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
abstract Node getRhs();
|
||||
|
||||
/**
|
||||
|
||||
@@ -156,6 +156,7 @@ class InvokeNode extends DataFlow::SourceNode {
|
||||
* Holds if the `i`th argument of this invocation is an object literal whose property
|
||||
* `name` is set to `result`.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
DataFlow::ValueNode getOptionArgument(int i, string name) {
|
||||
getOptionsArgument(i).hasPropertyWrite(name, result)
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ class SourceNode extends DataFlow::Node {
|
||||
* Holds if there is an assignment to property `propName` on this node,
|
||||
* and the right hand side of the assignment is `rhs`.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
predicate hasPropertyWrite(string propName, DataFlow::Node rhs) {
|
||||
rhs = getAPropertyWrite(propName).getRhs()
|
||||
}
|
||||
|
||||
@@ -461,6 +461,7 @@ class ComponentDirective extends CustomDirective, MkCustomComponent {
|
||||
|
||||
override DataFlow::Node getDefinition() { result = comp }
|
||||
|
||||
pragma[nomagic]
|
||||
override DataFlow::ValueNode getMemberInit(string name) {
|
||||
comp.getConfig().hasPropertyWrite(name, result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user