Skip to content

Commit b999bf7

Browse files
committed
Replacement for new String(char[],int,int)
1 parent 8487feb commit b999bf7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/de/inetsoftware/jwebassembly/api/java/lang/ReplacementForString.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,13 @@ static String init(byte[] value) {
4242
static String init(char[] value) {
4343
return null; // for compiler
4444
}
45+
46+
/**
47+
* Replacement for new String(char[],int,int)
48+
*/
49+
@Import( name="newSubChars", js = "(value,off,count)=>String.fromCharCode.apply(null,value.subarray(off,off+count))")
50+
@Replace( "java/lang/String.<init>([CII)V" )
51+
static String init(char[] value, int offset, int count) {
52+
return null; // for compiler
53+
}
4554
}

0 commit comments

Comments
 (0)