Adds modernized files.

This commit is contained in:
Rebecca Valentine
2020-02-11 21:45:49 -08:00
parent 5269fb713f
commit 2270c6c960
2 changed files with 6 additions and 1 deletions

View File

@@ -69,7 +69,7 @@ predicate is_unhashable(ControlFlowNode f, ClassValue cls, ControlFlowNode origi
predicate typeerror_is_caught(ControlFlowNode f) {
exists (Try try |
try.getBody().contains(f.getNode()) and
try.getAHandler().getType().refersTo(theTypeErrorType()))
try.getAHandler().getType().pointsTo(ClassValue::typeErrorType()))
}
from ControlFlowNode f, ClassValue c, ControlFlowNode origin

View File

@@ -743,6 +743,11 @@ module ClassValue {
ClassValue nonetype() {
result = TBuiltinClassObject(Builtin::special("NoneType"))
}
/** Get the `ClassValue` for the `TypeError` class */
ClassValue typeErrorType() {
result = TBuiltinClassObject(Builtin::special("TypeError"))
}
/** Get the `ClassValue` for the `NameError` class. */
ClassValue nameError() {