diff --git a/js/rhino/src/org/mozilla/javascript/NativeArray.java b/js/rhino/src/org/mozilla/javascript/NativeArray.java index 36943c9a954a..27fd6b4dd47c 100644 --- a/js/rhino/src/org/mozilla/javascript/NativeArray.java +++ b/js/rhino/src/org/mozilla/javascript/NativeArray.java @@ -62,7 +62,7 @@ public class NativeArray extends IdScriptable { * always gets at least an object back, even when Array == null. */ - public static void init(Context cx, Scriptable scope, boolean sealed) { + static void init(Context cx, Scriptable scope, boolean sealed) { NativeArray obj = new NativeArray(); obj.prototypeFlag = true; obj.addAsPrototype(MAX_PROTOTYPE_ID, cx, scope, sealed); @@ -71,7 +71,7 @@ public class NativeArray extends IdScriptable { /** * Zero-parameter constructor: just used to create Array.prototype */ - public NativeArray() { + private NativeArray() { dense = null; this.length = 0; } diff --git a/js/rhino/src/org/mozilla/javascript/NativeBoolean.java b/js/rhino/src/org/mozilla/javascript/NativeBoolean.java index 1bf828a62036..ee440f7e1028 100644 --- a/js/rhino/src/org/mozilla/javascript/NativeBoolean.java +++ b/js/rhino/src/org/mozilla/javascript/NativeBoolean.java @@ -42,21 +42,15 @@ package org.mozilla.javascript; * See ECMA 15.6. * @author Norris Boyd */ -public class NativeBoolean extends IdScriptable { +final class NativeBoolean extends IdScriptable { - public static void init(Context cx, Scriptable scope, boolean sealed) { - NativeBoolean obj = new NativeBoolean(); + static void init(Context cx, Scriptable scope, boolean sealed) { + NativeBoolean obj = new NativeBoolean(false); obj.prototypeFlag = true; obj.addAsPrototype(MAX_PROTOTYPE_ID, cx, scope, sealed); } - /** - * Zero-parameter constructor: just used to create Boolean.prototype - */ - public NativeBoolean() { - } - - public NativeBoolean(boolean b) { + private NativeBoolean(boolean b) { booleanValue = b; } diff --git a/js/rhino/src/org/mozilla/javascript/NativeDate.java b/js/rhino/src/org/mozilla/javascript/NativeDate.java index 5b988ca13f79..11b27d0d5dfd 100644 --- a/js/rhino/src/org/mozilla/javascript/NativeDate.java +++ b/js/rhino/src/org/mozilla/javascript/NativeDate.java @@ -48,9 +48,9 @@ import java.text.SimpleDateFormat; * See ECMA 15.9. * @author Mike McCabe */ -public class NativeDate extends IdScriptable { +final class NativeDate extends IdScriptable { - public static void init(Context cx, Scriptable scope, boolean sealed) { + static void init(Context cx, Scriptable scope, boolean sealed) { NativeDate obj = new NativeDate(); obj.prototypeFlag = true; @@ -60,7 +60,7 @@ public class NativeDate extends IdScriptable { obj.addAsPrototype(MAX_PROTOTYPE_ID, cx, scope, sealed); } - public NativeDate() { + private NativeDate() { if (thisTimeZone == null) { // j.u.TimeZone is synchronized, so setting class statics from it // should be OK. diff --git a/js/rhino/src/org/mozilla/javascript/NativeError.java b/js/rhino/src/org/mozilla/javascript/NativeError.java index 78c0b06998f6..43097b9ee7d7 100644 --- a/js/rhino/src/org/mozilla/javascript/NativeError.java +++ b/js/rhino/src/org/mozilla/javascript/NativeError.java @@ -43,9 +43,9 @@ package org.mozilla.javascript; * * ECMA 15.11 */ -public class NativeError extends IdScriptable { +final class NativeError extends IdScriptable { - public static void init(Context cx, Scriptable scope, boolean sealed) { + static void init(Context cx, Scriptable scope, boolean sealed) { NativeError obj = new NativeError(); obj.prototypeFlag = true; obj.messageValue = ""; diff --git a/js/rhino/src/org/mozilla/javascript/NativeMath.java b/js/rhino/src/org/mozilla/javascript/NativeMath.java index cbc9cf4a2f13..a56a272cb4a4 100644 --- a/js/rhino/src/org/mozilla/javascript/NativeMath.java +++ b/js/rhino/src/org/mozilla/javascript/NativeMath.java @@ -42,9 +42,9 @@ package org.mozilla.javascript; * @author Norris Boyd */ -public class NativeMath extends IdScriptable +final class NativeMath extends IdScriptable { - public static void init(Context cx, Scriptable scope, boolean sealed) { + static void init(Context cx, Scriptable scope, boolean sealed) { NativeMath obj = new NativeMath(); obj.setSealFunctionsFlag(sealed); obj.setFunctionParametrs(cx); diff --git a/js/rhino/src/org/mozilla/javascript/NativeNumber.java b/js/rhino/src/org/mozilla/javascript/NativeNumber.java index 6884a3d12a5c..eebbec858e68 100644 --- a/js/rhino/src/org/mozilla/javascript/NativeNumber.java +++ b/js/rhino/src/org/mozilla/javascript/NativeNumber.java @@ -44,11 +44,11 @@ package org.mozilla.javascript; * * @author Norris Boyd */ -public class NativeNumber extends IdScriptable { +final class NativeNumber extends IdScriptable { private static final int MAX_PRECISION = 100; - public static void init(Context cx, Scriptable scope, boolean sealed) { + static void init(Context cx, Scriptable scope, boolean sealed) { NativeNumber obj = new NativeNumber(); obj.prototypeFlag = true; obj.addAsPrototype(MAX_PROTOTYPE_ID, cx, scope, sealed); @@ -57,11 +57,11 @@ public class NativeNumber extends IdScriptable { /** * Zero-parameter constructor: just used to create Number.prototype */ - public NativeNumber() { + private NativeNumber() { doubleValue = defaultValue; } - public NativeNumber(double number) { + private NativeNumber(double number) { doubleValue = number; } diff --git a/js/rhino/src/org/mozilla/javascript/NativeString.java b/js/rhino/src/org/mozilla/javascript/NativeString.java index 2e68d8c9f8d7..b4ebb1196e64 100644 --- a/js/rhino/src/org/mozilla/javascript/NativeString.java +++ b/js/rhino/src/org/mozilla/javascript/NativeString.java @@ -52,22 +52,15 @@ import java.util.Vector; * @author Mike McCabe * @author Norris Boyd */ -public class NativeString extends IdScriptable { +final class NativeString extends IdScriptable { - public static void init(Context cx, Scriptable scope, boolean sealed) { - NativeString obj = new NativeString(); + static void init(Context cx, Scriptable scope, boolean sealed) { + NativeString obj = new NativeString(defaultValue); obj.prototypeFlag = true; obj.addAsPrototype(MAX_PROTOTYPE_ID, cx, scope, sealed); } - /** - * Zero-parameter constructor: just used to create String.prototype - */ - public NativeString() { - string = defaultValue; - } - - public NativeString(String s) { + private NativeString(String s) { string = s; } diff --git a/js/rhino/src/org/mozilla/javascript/NativeWith.java b/js/rhino/src/org/mozilla/javascript/NativeWith.java index e0a626922b30..c1fa163904f0 100644 --- a/js/rhino/src/org/mozilla/javascript/NativeWith.java +++ b/js/rhino/src/org/mozilla/javascript/NativeWith.java @@ -43,9 +43,9 @@ import java.lang.reflect.Method; * It simply delegates every action to its prototype except * for operations on its parent. */ -public class NativeWith implements Scriptable, IdFunctionMaster { +public final class NativeWith implements Scriptable, IdFunctionMaster { - public static void init(Context cx, Scriptable scope, boolean sealed) { + static void init(Context cx, Scriptable scope, boolean sealed) { NativeWith obj = new NativeWith(); obj.prototypeFlag = true; @@ -60,10 +60,10 @@ public class NativeWith implements Scriptable, IdFunctionMaster { ScriptableObject.DONTENUM); } - public NativeWith() { + private NativeWith() { } - public NativeWith(Scriptable parent, Scriptable prototype) { + NativeWith(Scriptable parent, Scriptable prototype) { this.parent = parent; this.prototype = prototype; }