@@ -0,0 +1,2079 @@
+package org.mozilla.javascript.tests;%0A%0Aimport org.mozilla.javascript.Context;%0Aimport org.mozilla.javascript.ContextFactory;%0Aimport org.mozilla.javascript.Scriptable;%0Aimport org.mozilla.javascript.Wrapper;%0Aimport junit.framework.TestCase;%0A%0A/**%0A * Test for overloaded varargs/non-varargs methods. %0A * See https://bugzilla.mozilla.org/show_bug.cgi?id=467396%0A * @author Hannes Wallnoefer%0A */%0Apublic class Bug467396Test extends TestCase %7B%0A%0A    public void testOverloadedVarargs() %7B%0A        Context cx = ContextFactory.getGlobal().enterContext();%0A        try %7B%0A            Scriptable scope = cx.initStandardObjects();%0A            Object result = unwrap(cx.evaluateString(scope,%0A                    %22java.lang.reflect.Array.newInstance(java.lang.Object, 1)%22,%0A                    %22source%22, 1, null));%0A            assertTrue(result instanceof Object%5B%5D);%0A            assertEquals(1, ((Object%5B%5D) result).length);%0A            result = unwrap(cx.evaluateString(scope,%0A                    %22java.lang.reflect.Array.newInstance(java.lang.Object, %5B1%5D)%22,%0A                    %22source%22, 1, null));%0A            assertTrue(result instanceof Object%5B%5D);%0A            assertEquals(1, ((Object%5B%5D) result).length);%0A            result = unwrap(cx.evaluateString(scope,%0A                    %22java.lang.reflect.Array.newInstance(java.lang.Object, %5B1, 1%5D)%22,%0A                    %22source%22, 1, null));%0A            assertTrue(result instanceof Object%5B%5D%5B%5D);%0A            assertEquals(1, ((Object%5B%5D%5B%5D) result).length);%0A            assertEquals(1, ((Object%5B%5D%5B%5D) result)%5B0%5D.length);%0A            result = unwrap(cx.evaluateString(scope,%0A                    %22java.lang.reflect.Array.newInstance(java.lang.Object, 1, 1)%22,%0A                    %22source%22, 1, null));%0A            assertTrue(result instanceof Object%5B%5D%5B%5D);%0A            assertEquals(1, ((Object%5B%5D%5B%5D) result).length);%0A            assertEquals(1, ((Object%5B%5D%5B%5D) result)%5B0%5D.length);%0A        %7D finally %7B%0A            Context.exit();%0A        %7D%0A    %7D%0A%0A%0A    private Object unwrap(Object obj) %7B%0A        return obj instanceof Wrapper ? ((Wrapper) obj).unwrap() : obj;%0A    %7D%0A%7D%0A

Add Bug467396Test.java to HEAD where it belongs