mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fix unwrapping null JS functions in JSO
This commit is contained in:
parent
e1234df7e1
commit
2aa9d5b24a
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user