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. diff --git a/mozilla/js/rhino/examples/PrimitiveWrapFactory.java b/mozilla/js/rhino/examples/PrimitiveWrapFactory.java index d0fc9097a78..be899c19587 100644 --- a/mozilla/js/rhino/examples/PrimitiveWrapFactory.java +++ b/mozilla/js/rhino/examples/PrimitiveWrapFactory.java @@ -40,8 +40,9 @@ import org.mozilla.javascript.*; * that can be converted to ECMA primitive values. * So java.lang.String is mapped to ECMA string, all java.lang.Numbers are * mapped to ECMA numbers, and java.lang.Booleans are mapped to ECMA booleans - * instead of being wrapped as objects. Additionally java.lang.Characters are - * converted to ECMA strings. Other types have the default behavior. + * instead of being wrapped as objects. Additionally java.lang.Character is + * converted to ECMA string with length 1. + * Other types have the default behavior. *

* Note that calling "new java.lang.String('foo')" in JavaScript with this * wrap factory enabled will still produce a wrapped Java object since the diff --git a/mozilla/js/rhino/examples/RunScript.java b/mozilla/js/rhino/examples/RunScript.java index a641505fd50..69084688040 100644 --- a/mozilla/js/rhino/examples/RunScript.java +++ b/mozilla/js/rhino/examples/RunScript.java @@ -53,7 +53,7 @@ public class RunScript { // Initialize the standard objects (Object, Function, etc.) // This must be done before scripts can be executed. Returns // a scope object that we use in later calls. - Scriptable scope = cx.initStandardObjects(null); + Scriptable scope = cx.initStandardObjects(); // Collect the arguments into a single string. String s = ""; diff --git a/mozilla/js/rhino/examples/RunScript2.java b/mozilla/js/rhino/examples/RunScript2.java index 76a8c37a76a..5021605ea78 100644 --- a/mozilla/js/rhino/examples/RunScript2.java +++ b/mozilla/js/rhino/examples/RunScript2.java @@ -45,7 +45,7 @@ public class RunScript2 { { Context cx = Context.enter(); try { - Scriptable scope = cx.initStandardObjects(null); + Scriptable scope = cx.initStandardObjects(); // Add a global variable "out" that is a JavaScript reflection // of System.out diff --git a/mozilla/js/rhino/examples/RunScript3.java b/mozilla/js/rhino/examples/RunScript3.java index 0af564e7823..2bfee6033ee 100644 --- a/mozilla/js/rhino/examples/RunScript3.java +++ b/mozilla/js/rhino/examples/RunScript3.java @@ -48,7 +48,7 @@ public class RunScript3 { { Context cx = Context.enter(); try { - Scriptable scope = cx.initStandardObjects(null); + Scriptable scope = cx.initStandardObjects(); // Collect the arguments into a single string. String s = ""; diff --git a/mozilla/js/rhino/examples/RunScript4.java b/mozilla/js/rhino/examples/RunScript4.java index 180b329855e..1323c22d8ac 100644 --- a/mozilla/js/rhino/examples/RunScript4.java +++ b/mozilla/js/rhino/examples/RunScript4.java @@ -46,7 +46,7 @@ public class RunScript4 { { Context cx = Context.enter(); try { - Scriptable scope = cx.initStandardObjects(null); + Scriptable scope = cx.initStandardObjects(); // Use the Counter class to define a Counter constructor // and prototype in JavaScript.