mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
Replace native methods with methods from partial classes.
This commit is contained in:
parent
e54fa767c1
commit
8fccc94615
@ -388,9 +388,12 @@ public class ClassFile {
|
||||
String origClassName = partialClassFile.thisClass.getName();
|
||||
ArrayList<MethodInfo> allMethods = new ArrayList<>( Arrays.asList( methods ) );
|
||||
for( MethodInfo m : partialClassFile.methods ) {
|
||||
if( getMethod( m.getName(), m.getType() ) == null ) {
|
||||
m.setDeclaringClassFile( origClassName, this );
|
||||
m.setDeclaringClassFile( origClassName, this );
|
||||
MethodInfo origMethod = getMethod( m.getName(), m.getType() );
|
||||
if( origMethod == null ) {
|
||||
allMethods.add( m );
|
||||
} else if( origMethod.isNative() ) {
|
||||
allMethods.set( allMethods.indexOf( origMethod ), m );
|
||||
}
|
||||
}
|
||||
methods = allMethods.toArray( methods );
|
||||
|
@ -101,6 +101,15 @@ public class MethodInfo implements Member {
|
||||
return (accessFlags & 0x0008) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the method is native
|
||||
*
|
||||
* @return true, if abstract
|
||||
*/
|
||||
public boolean isNative() {
|
||||
return (accessFlags & 0x0100) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the method is abstract
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user