1.1 --- a/boot/src/main/java/org/netbeans/html/boot/impl/FnUtils.java Thu Feb 11 06:03:40 2016 +0100
1.2 +++ b/boot/src/main/java/org/netbeans/html/boot/impl/FnUtils.java Mon Feb 15 05:23:17 2016 +0100
1.3 @@ -380,6 +380,11 @@
1.4 public void visitClassType(String name) {
1.5 returnType = Type.getType("[" + Type.getObjectType(name).getDescriptor());
1.6 }
1.7 +
1.8 + @Override
1.9 + public void visitBaseType(char descriptor) {
1.10 + returnType = Type.getType("[" + descriptor);
1.11 + }
1.12 };
1.13 }
1.14 loadObject();
2.1 --- a/boot/src/test/java/org/netbeans/html/boot/impl/JsClassLoaderBase.java Thu Feb 11 06:03:40 2016 +0100
2.2 +++ b/boot/src/test/java/org/netbeans/html/boot/impl/JsClassLoaderBase.java Mon Feb 15 05:23:17 2016 +0100
2.3 @@ -126,6 +126,18 @@
2.4 throw ex.getTargetException();
2.5 }
2.6 }
2.7 +
2.8 + @Test public void primitiveArrayReturn() throws Throwable {
2.9 + Method st = methodClass.getMethod("both", double.class, double.class);
2.10 + Throwable ex;
2.11 + try {
2.12 + Object arr = st.invoke(null, 2, 5);
2.13 + ex = null;
2.14 + } catch (InvocationTargetException invoke) {
2.15 + ex = invoke.getTargetException();
2.16 + }
2.17 + assertTrue(ex instanceof ClassCastException, "Primitive arrays aren't returned from JavaScript: " + ex);
2.18 + }
2.19
2.20 @Test public void truth() throws Throwable {
2.21 Method st = methodClass.getMethod("truth");
3.1 --- a/boot/src/test/java/org/netbeans/html/boot/impl/JsMethods.java Thu Feb 11 06:03:40 2016 +0100
3.2 +++ b/boot/src/test/java/org/netbeans/html/boot/impl/JsMethods.java Mon Feb 15 05:23:17 2016 +0100
3.3 @@ -146,6 +146,9 @@
3.4 "map.@java.util.Map::put(Ljava/lang/Object;Ljava/lang/Object;)('key',value);"
3.5 )
3.6 public static native void callParamTypes(Map<String,Integer> map, int value);
3.7 +
3.8 + @JavaScriptBody(args = { "a", "b" }, body = "return [ a, b ];")
3.9 + public static native double[] both(double a, double b);
3.10
3.11 enum Enm {
3.12 A, B;