mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Python: update test to reflect correct behaviour
also add comments
This commit is contained in:
@@ -129,13 +129,16 @@ a, b = c.instance_method(SOURCE)
|
||||
SINK_F(a)
|
||||
SINK(b) # $ flow="SOURCE, l:-2 -> b"
|
||||
|
||||
# call the instance method on the class to expose the self argument
|
||||
# Call the instance method on the class to expose the self argument
|
||||
x, y = MS_Class.instance_method(SOURCE, NONSOURCE)
|
||||
SINK(x) # $ MISSING: flow="SOURCE, l:-1 -> x"
|
||||
SINK_F(y)
|
||||
|
||||
# call the instance method on the class to expose the self argument
|
||||
SINK(MS_Class.explicit_self(SOURCE)) # $ MISSING: flow="SOURCE, l:0 -> ms(SOURCE)"
|
||||
# Call the instance method on the class to expose the self argument
|
||||
# That self argument is not referenced by `Argument[self:]`
|
||||
SINK_F(MS_Class.explicit_self(SOURCE))
|
||||
# Instead, `Argument[self:]` refers to a keyword argument named `self` (which you are allowed to do in Python)
|
||||
SINK(c.explicit_self(self = SOURCE)) # $ flow="SOURCE -> c.explicit_self(..)"
|
||||
|
||||
# Modeled flow-summary is not value preserving
|
||||
from json import MS_loads as json_loads
|
||||
|
||||
Reference in New Issue
Block a user