mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
convert also AssertErrors to WasmExceptions
This commit is contained in:
parent
442e0c896c
commit
4958cb2f46
@ -98,7 +98,7 @@ class JavaMethodWasmCodeBuilder extends WasmCodeBuilder {
|
|||||||
AnyType returnType = new ValueTypeParser( method.getType().substring( method.getType().lastIndexOf( ')' ) + 1), getTypeManager() ).next();
|
AnyType returnType = new ValueTypeParser( method.getType().substring( method.getType().lastIndexOf( ')' ) + 1), getTypeManager() ).next();
|
||||||
writeCode( byteCode, code.getConstantPool(), method.getDeclaringClassFile(), returnType );
|
writeCode( byteCode, code.getConstantPool(), method.getDeclaringClassFile(), returnType );
|
||||||
calculateVariables();
|
calculateVariables();
|
||||||
} catch( Exception ioex ) {
|
} catch( Throwable ioex ) {
|
||||||
int lineNumber = byteCode == null ? -1 : byteCode.getLineNumber();
|
int lineNumber = byteCode == null ? -1 : byteCode.getLineNumber();
|
||||||
throw WasmException.create( ioex, lineNumber );
|
throw WasmException.create( ioex, lineNumber );
|
||||||
}
|
}
|
||||||
@ -763,7 +763,7 @@ class JavaMethodWasmCodeBuilder extends WasmCodeBuilder {
|
|||||||
patchTypeOfNullConst();
|
patchTypeOfNullConst();
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch( Exception ex ) {
|
} catch( Throwable ex ) {
|
||||||
throw WasmException.create( ex, lineNumber );
|
throw WasmException.create( ex, lineNumber );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -988,7 +988,7 @@ class JavaMethodWasmCodeBuilder extends WasmCodeBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch( Exception ex ) {
|
} catch( Throwable ex ) {
|
||||||
throw WasmException.create( ex, instr.getLineNumber() );
|
throw WasmException.create( ex, instr.getLineNumber() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,7 @@ public class ModuleGenerator {
|
|||||||
for( MethodInfo method : methods ) {
|
for( MethodInfo method : methods ) {
|
||||||
handler.accept( method );
|
handler.accept( method );
|
||||||
}
|
}
|
||||||
} catch( IOException ioex ) {
|
} catch( Throwable ioex ) {
|
||||||
throw WasmException.create( ioex, sourceFile, className, methodName, -1 );
|
throw WasmException.create( ioex, sourceFile, className, methodName, -1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -526,7 +526,7 @@ public class ModuleGenerator {
|
|||||||
functions.markAsExport( name, annotationValues );
|
functions.markAsExport( name, annotationValues );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch( Exception ioex ) {
|
} catch( Throwable ioex ) {
|
||||||
throw WasmException.create( ioex, sourceFile, className, methodName, -1 );
|
throw WasmException.create( ioex, sourceFile, className, methodName, -1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -604,7 +604,7 @@ public class ModuleGenerator {
|
|||||||
}
|
}
|
||||||
throw new WasmException( "Abstract or native method can not be used: " + name.signatureName +"\nIf you want to use classes with native code, you must use a library that implements these native methods, such as 'de.inetsoftware:jwebassembly-api:+'.", -1 );
|
throw new WasmException( "Abstract or native method can not be used: " + name.signatureName +"\nIf you want to use classes with native code, you must use a library that implements these native methods, such as 'de.inetsoftware:jwebassembly-api:+'.", -1 );
|
||||||
}
|
}
|
||||||
} catch( Exception ioex ) {
|
} catch( Throwable ioex ) {
|
||||||
int lineNumber = code == null ? -1 : code.getFirstLineNr();
|
int lineNumber = code == null ? -1 : code.getFirstLineNr();
|
||||||
throw WasmException.create( ioex, sourceFile, className, methodName, lineNumber );
|
throw WasmException.create( ioex, sourceFile, className, methodName, lineNumber );
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ class StaticCodeBuilder {
|
|||||||
state.dependenciesClasses.add( otherClassName );
|
state.dependenciesClasses.add( otherClassName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch( IOException ex ) {
|
} catch( Throwable ex ) {
|
||||||
throw WasmException.create( ex, sourceFile, className, name.methodName, instr == null ? -1 : instr.getLineNumber() );
|
throw WasmException.create( ex, sourceFile, className, name.methodName, instr == null ? -1 : instr.getLineNumber() );
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
|
@ -553,7 +553,7 @@ public abstract class WasmCodeBuilder {
|
|||||||
FieldInfo field = classFile.getField( name.methodName );
|
FieldInfo field = classFile.getField( name.methodName );
|
||||||
AnyType type = new ValueTypeParser( field.getType(), types ).next();
|
AnyType type = new ValueTypeParser( field.getType(), types ).next();
|
||||||
addGlobalInstruction( load, name, type, null, javaCodePos, lineNumber );
|
addGlobalInstruction( load, name, type, null, javaCodePos, lineNumber );
|
||||||
} catch( Exception ex ) {
|
} catch( Throwable ex ) {
|
||||||
throw WasmException.create( ex, lineNumber );
|
throw WasmException.create( ex, lineNumber );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -865,7 +865,7 @@ public abstract class WasmCodeBuilder {
|
|||||||
return new FunctionName( method );
|
return new FunctionName( method );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch( IOException ex ) {
|
} catch( Throwable ex ) {
|
||||||
throw WasmException.create( ex, lineNumber );
|
throw WasmException.create( ex, lineNumber );
|
||||||
}
|
}
|
||||||
throw new WasmException( "Not implemented NonGC polyfill function: " + name, lineNumber );
|
throw new WasmException( "Not implemented NonGC polyfill function: " + name, lineNumber );
|
||||||
|
@ -330,7 +330,7 @@ public class WatParser extends WasmCodeBuilder {
|
|||||||
throw new WasmException( "Unknown WASM token: " + tok, lineNumber );
|
throw new WasmException( "Unknown WASM token: " + tok, lineNumber );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch( Exception ex ) {
|
} catch( Throwable ex ) {
|
||||||
throw WasmException.create( ex, lineNumber );
|
throw WasmException.create( ex, lineNumber );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user