JS: make kotlin.Throwable = Error. See KT-15312

This commit is contained in:
Alexey Andreev
2016-12-29 13:37:30 +03:00
parent c565697e77
commit f34093db9f
18 changed files with 299 additions and 52 deletions
@@ -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