Useful method moved to values.kt
This commit is contained in:
@@ -97,4 +97,11 @@ val Value.obj: Any?
|
||||
return v
|
||||
}
|
||||
return (this as AbstractValue<*>).value
|
||||
}
|
||||
}
|
||||
|
||||
fun Any?.checkNull(): Any {
|
||||
if (this == null) {
|
||||
throw ThrownFromEvalException(ObjectValue(NullPointerException(), Type.getType(javaClass<NullPointerException>())))
|
||||
}
|
||||
return this
|
||||
}
|
||||
@@ -225,13 +225,6 @@ object REFLECTION_EVAL : Eval {
|
||||
}
|
||||
}
|
||||
|
||||
fun Any?.checkNull(): Any {
|
||||
if (this == null) {
|
||||
throw ThrownFromEvalException(ObjectValue(NullPointerException(), Type.getType(javaClass<NullPointerException>())))
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
override fun getStaticField(fieldDesc: FieldDescription): Value {
|
||||
val field = findStaticField(fieldDesc)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user