JS backend: Minor changes -- added @NotNull to some methods of InnerDeclarationTranslator.

This commit is contained in:
Zalim Bashorov
2013-12-12 16:46:10 +04:00
parent 948827aa06
commit 9e97f9615b
3 changed files with 7 additions and 0 deletions
@@ -39,6 +39,7 @@ abstract class InnerDeclarationTranslator {
this.fun = fun;
}
@NotNull
public JsExpression translate(@NotNull JsNameRef nameRef, @Nullable JsExpression self) {
UsageTracker usageTracker = context.usageTracker();
assert usageTracker != null : "Usage tracker should not be null for InnerDeclarationTranslator";
@@ -72,7 +73,9 @@ abstract class InnerDeclarationTranslator {
return invocation;
}
@NotNull
protected abstract JsExpression createExpression(@NotNull JsNameRef nameRef, @Nullable JsExpression self);
@NotNull
protected abstract JsInvocation createInvocation(@NotNull JsNameRef nameRef, @Nullable JsExpression self);
}
@@ -43,11 +43,13 @@ class InnerFunctionTranslator extends InnerDeclarationTranslator {
}
@Override
@NotNull
protected JsExpression createExpression(@NotNull JsNameRef nameRef, @Nullable JsExpression self) {
return nameRef;
}
@Override
@NotNull
protected JsInvocation createInvocation(@NotNull JsNameRef nameRef, @Nullable JsExpression self) {
return new JsInvocation(new JsNameRef("bind", nameRef), new SmartList<JsExpression>(self));
}
@@ -30,11 +30,13 @@ class InnerObjectTranslator extends InnerDeclarationTranslator {
}
@Override
@NotNull
protected JsExpression createExpression(@NotNull JsNameRef nameRef, @Nullable JsExpression self) {
return createInvocation(nameRef, self);
}
@Override
@NotNull
protected JsInvocation createInvocation(@NotNull JsNameRef nameRef, @Nullable JsExpression self) {
JsInvocation invocation = new JsInvocation(nameRef);
if (self != null) {