Examples of evalJS()


Examples of be.klak.rhino.RhinoContext.evalJS()

        ClassInJS objInJava = (ClassInJS) context.evalJS("var obj = new ClassInJS(); obj");

        objInJava.increaseProp();
        assertThat(newDefaultInstance.jsGet_prop()).isEqualTo(0);
        assertThat(context.evalJS("obj.prop")).isEqualTo(1);
        assertThat(context.evalJS("obj.fn()")).isEqualTo("fn");
    }
}
View Full Code Here

Examples of be.klak.rhino.RhinoContext.evalJS()

    @Test
    public void loadEnvJSShouldSetWindowSpaceAndBeES5Complaint() {
        RhinoContext context = new RhinoContext();

        context.loadEnv("src/test/javascript");
        assertThat(context.evalJS("window")).isInstanceOf(Global.class);

        assertThat(context.evalJS("Object.create({ test: 'test' });")).isInstanceOf(NativeObject.class);
    }

    @Test(expected = EcmaError.class)
View Full Code Here

Examples of be.klak.rhino.RhinoContext.evalJS()

        RhinoContext context = new RhinoContext();

        context.loadEnv("src/test/javascript");
        assertThat(context.evalJS("window")).isInstanceOf(Global.class);

        assertThat(context.evalJS("Object.create({ test: 'test' });")).isInstanceOf(NativeObject.class);
    }

    @Test(expected = EcmaError.class)
    public void failWithoutLoadingEnvAndManipulatingDOMStuff() {
        RhinoContext context = new RhinoContext();
View Full Code Here

Examples of be.klak.rhino.RhinoContext.evalJS()

    }

    @Test(expected = EcmaError.class)
    public void failWithoutLoadingEnvAndManipulatingDOMStuff() {
        RhinoContext context = new RhinoContext();
        context.evalJS("document.getElementById");
    }

}
View Full Code Here
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.