JS: make kotlin.Throwable = Error. See KT-15312
This commit is contained in:
@@ -601,6 +601,19 @@ public class DescriptorUtils {
|
||||
throw new IllegalStateException("Function not found");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static PropertyDescriptor getPropertyByName(@NotNull MemberScope scope, @NotNull Name name) {
|
||||
Collection<DeclarationDescriptor> callables = scope.getContributedDescriptors(
|
||||
DescriptorKindFilter.CALLABLES, MemberScope.Companion.getALL_NAME_FILTER());
|
||||
for (DeclarationDescriptor d : callables) {
|
||||
if (d instanceof PropertyDescriptor && name.equals(d.getOriginal().getName())) {
|
||||
return (PropertyDescriptor) d;
|
||||
}
|
||||
}
|
||||
|
||||
throw new IllegalStateException("Property not found");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static CallableMemberDescriptor getDirectMember(@NotNull CallableMemberDescriptor descriptor) {
|
||||
return descriptor instanceof PropertyAccessorDescriptor
|
||||
|
||||
Reference in New Issue
Block a user