1.1 --- a/emul/mini/src/main/java/org/apidesign/bck2brwsr/emul/lang/System.java Wed Feb 06 15:19:59 2013 +0100
1.2 +++ b/emul/mini/src/main/java/org/apidesign/bck2brwsr/emul/lang/System.java Thu Feb 07 12:58:12 2013 +0100
1.3 @@ -17,6 +17,7 @@
1.4 */
1.5 package org.apidesign.bck2brwsr.emul.lang;
1.6
1.7 +import java.lang.reflect.Method;
1.8 import org.apidesign.bck2brwsr.core.JavaScriptBody;
1.9
1.10 /**
1.11 @@ -38,7 +39,15 @@
1.12 " }\n" +
1.13 "}"
1.14 )
1.15 - public static native void arraycopy(Object value, int srcBegin, Object dst, int dstBegin, int count);
1.16 + public static void arraycopy(Object src, int srcBegin, Object dst, int dstBegin, int count) {
1.17 + try {
1.18 + Class<?> system = Class.forName("java.lang.System");
1.19 + Method m = system.getMethod("arraycopy", Object.class, int.class, Object.class, int.class, int.class);
1.20 + m.invoke(null, src, srcBegin, dst, dstBegin, count);
1.21 + } catch (Exception ex) {
1.22 + throw new IllegalStateException(ex);
1.23 + }
1.24 + }
1.25
1.26 @JavaScriptBody(args = { "arr", "expectedSize" }, body =
1.27 "while (expectedSize-- > arr.length) { arr.push(0); }; return arr;"