Skip to content

Commit

Permalink
This fixes #146: Browser js console warning: unreachable code after r…
Browse files Browse the repository at this point in the history
…eturn statement
  • Loading branch information
fernando petrola committed Mar 7, 2017
1 parent 42c3ea9 commit e3fd2f1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ else if (classCompilerType != null)
Signature signature= Project.getSingleton().getSignature(methodBinding.toString()).relative();
String signatureReplaced= normalizeExpression(signature);

if (typeDecl.getClassName().equals("java.lang.String") && method.isInstanceConstructor())
boolean isString= typeDecl.getClassName().equals("java.lang.String");
if (isString && method.isInstanceConstructor())
{

Block body= method.getBody();
Expand Down Expand Up @@ -381,7 +382,7 @@ else if (classCompilerType != null)
else if (isNative)
println("return dragomeJs.resolveNativeMethod(this, \"" + signatureReplaced + "\").apply(this, arguments);");

if (method.isInstanceConstructor())
if (method.isInstanceConstructor() && !isString)
print("return this;\n");

print(closingString);
Expand Down

0 comments on commit e3fd2f1

Please sign in to comment.