Package org.mozilla.javascript.tests

Source Code of org.mozilla.javascript.tests.Bug496585

package org.mozilla.javascript.tests;

import org.mozilla.javascript.Function;
import org.mozilla.javascript.ContextFactory;
import org.mozilla.javascript.ContextAction;
import org.mozilla.javascript.Context;
import org.junit.Test;

public class Bug496585 {
    public void method(String one, Function function) {
        System.out.println("string+function");
    }

    public void method(String... strings) {
        System.out.println("string[]");
    }

    @Test
    public void callOverloadedFunction() {
        new ContextFactory().call(new ContextAction() {
            public Object run(Context cx) {
                cx.evaluateString(
                    cx.initStandardObjects(),
                    "new org.mozilla.javascript.tests.Bug496585().method('one', 'two', 'three')",
                    "<test>", 1, null);
                cx.evaluateString(
                    cx.initStandardObjects(),
                    "new org.mozilla.javascript.tests.Bug496585().method('one', function() {})",
                    "<test>", 1, null);
                return null;
            }
        });
    }
}
TOP

Related Classes of org.mozilla.javascript.tests.Bug496585

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.