mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
Error message for native methods
This commit is contained in:
parent
c2be64a525
commit
4bb145d116
@ -352,7 +352,7 @@ public class ModuleGenerator {
|
||||
codeBuilder = javaCodeBuilder;
|
||||
localVariableTable = code.getLocalVariableTable();
|
||||
} else {
|
||||
return;
|
||||
throw new WasmException( "Abstract or native method can not be used: " + name.fullName, -1 );
|
||||
}
|
||||
writeExport( name, method );
|
||||
writeMethodImpl( name, method.isStatic(), localVariableTable, codeBuilder );
|
||||
|
@ -110,4 +110,14 @@ public class RuntimeErrors {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nativeMethod() throws IOException {
|
||||
compileErrorTest( "Abstract or native method can not be used:", NativeMethod.class );
|
||||
}
|
||||
|
||||
static class NativeMethod {
|
||||
@Export
|
||||
native static float function();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user