assertEvaluates("hello", "var x = String.toLowerCase; x.apply('HELLO')");
assertEvaluates("hello", "String.toLowerCase('HELLO')"); // first patch proposed to #492359 was breaking this
}
private void assertEvaluates(final Object expected, final String source) {
final ContextAction action = new ContextAction() {
public Object run(Context cx) {
final Scriptable scope = cx.initStandardObjects();
final Object rep = cx.evaluateString(scope, source, "test.js",
0, null);
assertEquals(expected, rep);