Fix unwrapping null JS functions in JSO

This commit is contained in:
Alexey Andreev 2017-07-17 22:15:43 +03:00
parent e1234df7e1
commit 2aa9d5b24a

View File

@ -76,6 +76,8 @@ public class JSNativeGenerator implements Injector, DependencyPlugin, Generator
String thisName = context.getParameterName(1); String thisName = context.getParameterName(1);
String methodName = context.getParameterName(2); String methodName = context.getParameterName(2);
writer.append("if").ws().append("(").append(thisName).ws().append("===").ws().append("null)").ws()
.append("return null;").softNewLine();
writer.append("var result").ws().append("=").ws().append("{};").softNewLine(); writer.append("var result").ws().append("=").ws().append("{};").softNewLine();
writer.append("result[").append(methodName).append("]").ws().append("=").ws().append(thisName) writer.append("result[").append(methodName).append("]").ws().append("=").ws().append(thisName)
.append(";").softNewLine(); .append(";").softNewLine();