mirror of
https://github.com/konsoletyper/teavm.git
synced 2025-02-23 11:29:56 +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 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("result[").append(methodName).append("]").ws().append("=").ws().append(thisName)
|
||||
.append(";").softNewLine();
|
||||
|
Loading…
Reference in New Issue
Block a user