test/src/jdk/nashorn/internal/runtime/ContextTest.java
Print this page
@@ -27,10 +27,11 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import java.util.Map;
+import jdk.nashorn.internal.objects.Global;
import jdk.nashorn.internal.runtime.options.Options;
import org.testng.annotations.Test;
/**
* Basic Context API tests.
@@ -43,11 +44,11 @@
@Test
public void evalTest() {
final Options options = new Options("");
final ErrorManager errors = new ErrorManager();
final Context cx = new Context(options, errors, Thread.currentThread().getContextClassLoader());
- final ScriptObject oldGlobal = Context.getGlobal();
+ final Global oldGlobal = Context.getGlobal();
Context.setGlobal(cx.createGlobal());
try {
String code = "22 + 10";
assertTrue(32.0 == ((Number)(eval(cx, "<evalTest>", code))).doubleValue());
@@ -63,11 +64,11 @@
public void reflectionTest() {
final Options options = new Options("");
final ErrorManager errors = new ErrorManager();
final Context cx = new Context(options, errors, Thread.currentThread().getContextClassLoader());
final boolean strict = cx.getEnv()._strict;
- final ScriptObject oldGlobal = Context.getGlobal();
+ final Global oldGlobal = Context.getGlobal();
Context.setGlobal(cx.createGlobal());
try {
final String code = "var obj = { x: 344, y: 42 }";
eval(cx, "<reflectionTest>", code);