Changes in k2js after kotlin compiler update

This commit is contained in:
Natalia.Ukhorskaya
2011-12-27 14:50:09 +04:00
parent 10aa2e62d2
commit eea73bf476
3 changed files with 13 additions and 5 deletions
@@ -38,13 +38,17 @@ import static org.jetbrains.k2js.utils.JetTestUtils.analyzeNamespace;
public final class K2JSTranslator {
@NotNull
private final JetCoreEnvironment environment = new JetCoreEnvironment(new Disposable() {
private JetCoreEnvironment environment = new JetCoreEnvironment(new Disposable() {
@Override
public void dispose() {
}
});
public void setEnvironment(JetCoreEnvironment env) {
environment = env;
}
@Nullable
private BindingContext bindingContext = null;
@@ -24,13 +24,13 @@ public final class K2JSTranslatorApplet extends Applet {
return generateJSCode(code, arguments);
} catch (AssertionError e) {
reportException(e);
return EXCEPTION + " Translation error.";
return EXCEPTION + "Translation error.";
} catch (UnsupportedOperationException e) {
reportException(e);
return EXCEPTION + " Unsupported feature.";
return EXCEPTION + "Unsupported feature.";
} catch (Throwable e) {
reportException(e);
return EXCEPTION + " Unexpected exception.";
return EXCEPTION + "Unexpected exception.";
}
}
@@ -83,7 +83,11 @@ public final class DescriptorUtils {
@NotNull
public static PropertyDescriptor getPropertyByName(@NotNull JetScope scope,
@NotNull String name) {
PropertyDescriptor descriptor = (PropertyDescriptor) scope.getVariable(name);
VariableDescriptor variable = scope.getLocalVariable(name);
if (variable == null) {
variable = org.jetbrains.jet.lang.resolve.DescriptorUtils.filterNonExtensionProperty(scope.getProperties(name));
}
PropertyDescriptor descriptor = (PropertyDescriptor) variable;
assert descriptor != null : "Must have a descriptor.";
return descriptor;
}