test/src/jdk/nashorn/internal/runtime/ContextTest.java
Print this page
@@ -62,10 +62,11 @@
@Test
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();
Context.setGlobal(cx.createGlobal());
try {
final String code = "var obj = { x: 344, y: 42 }";
@@ -93,11 +94,11 @@
}
assertEquals(count, 2);
assertEquals(sobj.size(), 2);
// add property
- sobj.put("zee", "hello");
+ sobj.put("zee", "hello", strict);
assertEquals(sobj.get("zee"), "hello");
assertEquals(sobj.size(), 3);
} finally {
Context.setGlobal(oldGlobal);