nashorn/test/script/trusted/JDK-8021129.js
changeset 19093 49bb7e75b326
parent 19092 e23f2618ffde
child 19097 f544a2ea40ef
--- a/nashorn/test/script/trusted/JDK-8021129.js	Tue Jul 23 18:28:58 2013 +0200
+++ b/nashorn/test/script/trusted/JDK-8021129.js	Wed Jul 24 11:13:24 2013 +0200
@@ -29,7 +29,9 @@
  * @test
  * @run
  */
-var r1 = new (Java.type("jdk.nashorn.internal.test.models.InternalRunnable"))
+var R = Java.type("jdk.nashorn.internal.test.models.InternalRunnable")
+var r1 = R.class.newInstance()
+
 r1.run() // Can execute method from an implemented non-restricted interface
 print(r1.toString()) // Can execute public method from a superclass
 
@@ -40,4 +42,4 @@
 print(r1.canNotSeeThisField === undefined) // Can't see its own fields
 
 var r2 = new (Java.type("jdk.nashorn.test.models.InternalRunnableSuperclass"))
-print(r2.canSeeThisField) // Superclass field works fine on its own
\ No newline at end of file
+print(r2.canSeeThisField) // Superclass field works fine on its own