mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +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;
|
codeBuilder = javaCodeBuilder;
|
||||||
localVariableTable = code.getLocalVariableTable();
|
localVariableTable = code.getLocalVariableTable();
|
||||||
} else {
|
} else {
|
||||||
return;
|
throw new WasmException( "Abstract or native method can not be used: " + name.fullName, -1 );
|
||||||
}
|
}
|
||||||
writeExport( name, method );
|
writeExport( name, method );
|
||||||
writeMethodImpl( name, method.isStatic(), localVariableTable, codeBuilder );
|
writeMethodImpl( name, method.isStatic(), localVariableTable, codeBuilder );
|
||||||
|
@ -110,4 +110,14 @@ public class RuntimeErrors {
|
|||||||
return 1;
|
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