mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
test for interface calls
This commit is contained in:
parent
800edc837d
commit
674eb84129
@ -58,6 +58,6 @@ class WasmCallInterfaceInstruction extends WasmCallInstruction {
|
|||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public void writeTo( @Nonnull ModuleWriter writer ) throws IOException {
|
public void writeTo( @Nonnull ModuleWriter writer ) throws IOException {
|
||||||
throw new WasmException( "Interface calls not supported", getLineNumber() );
|
throw new WasmException( "Interface calls are not supported.", getLineNumber() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,9 @@ import static org.junit.Assert.assertTrue;
|
|||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
@ -111,4 +113,18 @@ public class RuntimeErrors {
|
|||||||
run.run();
|
run.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void interfaceCall() throws IOException {
|
||||||
|
compileErrorTest( "Interface calls are not supported.", InterfaceMethod.class );
|
||||||
|
}
|
||||||
|
|
||||||
|
static class InterfaceMethod {
|
||||||
|
@Export
|
||||||
|
static int runnable() {
|
||||||
|
List list = new ArrayList();
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user