Mercurial > hg > openjdk > aarch64-port > nashorn
changeset 1354:411652a014ff
Merge
author | lana |
---|---|
date | Thu, 23 Apr 2015 16:05:40 -0700 |
parents | 3628ab9fdbc0 (current diff) 37de779feba1 (diff) |
children | 5ed57fe26f13 |
files | |
diffstat | 1 files changed, 0 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/test/src/jdk/nashorn/api/scripting/test/ScriptEngineTest.java Wed Apr 22 11:11:14 2015 -0700 +++ b/test/src/jdk/nashorn/api/scripting/test/ScriptEngineTest.java Thu Apr 23 16:05:40 2015 -0700 @@ -676,41 +676,6 @@ assertEquals("helloworld", inv.invokeMethod(ctx.get(), "join", "")); } - // @bug JDK-8068889: ConsString arguments to a functional interface wasn't converted to string. - @Test - public void functionalInterfaceStringTest() throws Exception { - final ScriptEngineManager manager = new ScriptEngineManager(); - final ScriptEngine e = manager.getEngineByName("nashorn"); - final AtomicBoolean invoked = new AtomicBoolean(false); - e.put("f", new Function<String, String>() { - @Override - public String apply(String t) { - invoked.set(true); - return t; - } - }); - assertEquals(e.eval("var x = 'a'; x += 'b'; f(x)"), "ab"); - assertTrue(invoked.get()); - } - - // @bug JDK-8068889: ScriptObject arguments to a functional interface wasn't converted to a mirror. - @Test - public void functionalInterfaceObjectTest() throws Exception { - final ScriptEngineManager manager = new ScriptEngineManager(); - final ScriptEngine e = manager.getEngineByName("nashorn"); - final AtomicBoolean invoked = new AtomicBoolean(false); - e.put("c", new Consumer<Object>() { - @Override - public void accept(Object t) { - assertTrue(t instanceof ScriptObjectMirror); - assertEquals(((ScriptObjectMirror)t).get("a"), "xyz"); - invoked.set(true); - } - }); - e.eval("var x = 'xy'; x += 'z';c({a:x})"); - assertTrue(invoked.get()); - } - // @bug 8068524: NashornScriptEngineFactory.getParameter() throws IAE // for an unknown key, doesn't conform to the general spec @Test