diff --git a/mozilla/js/rhino/examples/Control.java b/mozilla/js/rhino/examples/Control.java index aecb35115be..d30677c8c09 100644 --- a/mozilla/js/rhino/examples/Control.java +++ b/mozilla/js/rhino/examples/Control.java @@ -59,7 +59,7 @@ public class Control { // Initialize the standard objects (Object, Function, etc.) // This must be done before scripts can be executed. - Scriptable scope = cx.initStandardObjects(null); + Scriptable scope = cx.initStandardObjects(); // Now we can evaluate a script. Let's create a new object // using the object literal notation. diff --git a/mozilla/js/rhino/examples/CounterTest.java b/mozilla/js/rhino/examples/CounterTest.java index c403fe08d9a..1cc3b3f6e90 100644 --- a/mozilla/js/rhino/examples/CounterTest.java +++ b/mozilla/js/rhino/examples/CounterTest.java @@ -53,7 +53,7 @@ public class CounterTest { { Context cx = Context.enter(); try { - Scriptable scope = cx.initStandardObjects(null); + Scriptable scope = cx.initStandardObjects(); ScriptableObject.defineClass(scope, Counter.class); Scriptable testCounter = cx.newObject(scope, "Counter"); diff --git a/mozilla/js/rhino/examples/DynamicScopes.java b/mozilla/js/rhino/examples/DynamicScopes.java index 4a5ec4e3471..9570fa85e7c 100644 --- a/mozilla/js/rhino/examples/DynamicScopes.java +++ b/mozilla/js/rhino/examples/DynamicScopes.java @@ -79,7 +79,7 @@ public class DynamicScopes { // Initialize the standard objects (Object, Function, etc.) // This must be done before scripts can be executed. The call // returns a new scope that we will share. - Scriptable scope = cx.initStandardObjects(null); + Scriptable scope = cx.initStandardObjects(); // Now we can evaluate a script and functions will be compiled to // use dynamic scope if the Context is so initialized. @@ -159,9 +159,6 @@ public class DynamicScopes { catch (NotAFunctionException jse) { // ignore } - catch (PropertyException jse) { - // ignore - } catch (JavaScriptException jse) { // ignore } diff --git a/mozilla/js/rhino/examples/File.java b/mozilla/js/rhino/examples/File.java index 770cde11e04..52bb93d4b15 100644 --- a/mozilla/js/rhino/examples/File.java +++ b/mozilla/js/rhino/examples/File.java @@ -143,17 +143,8 @@ public class File extends ScriptableObject { v.copyInto(lines); Scriptable scope = ScriptableObject.getTopLevelScope(this); - Scriptable result; - try { - Context cx = Context.getCurrentContext(); - result = cx.newObject(scope, "Array", lines); - } catch (PropertyException e) { - throw Context.reportRuntimeError(e.getMessage()); - } catch (NotAFunctionException e) { - throw Context.reportRuntimeError(e.getMessage()); - } - - return result; + Context cx = Context.getCurrentContext(); + return cx.newObject(scope, "Array", lines); } /** diff --git a/mozilla/js/rhino/examples/NervousText.html b/mozilla/js/rhino/examples/NervousText.html index ef351c229c6..01450500bab 100644 --- a/mozilla/js/rhino/examples/NervousText.html +++ b/mozilla/js/rhino/examples/NervousText.html @@ -14,6 +14,6 @@ java -classpath js.jar org.mozilla.javascript.tools.jsc.Main \ and the resulting 2 classes, NervousText.class extending java.applet.Applet and implementing java.lang.Runnable and NervousText1.class which represents compiled JavaScript code, are placed in the same directory as NervousText.html.
-The test also assumes that js.jar from Rhino distribution is available in the same directory. +The test also assumes that js.jar from Rhino distribution is available in the same directory.