Follow Rhino conventions for JavaScript constructor naming.

This commit is contained in:
hns 2003-06-25 10:46:14 +00:00
parent 203e409bc6
commit 352f9c7fec

View file

@ -40,7 +40,7 @@ public class HopObject extends ScriptableObject {
Method[] methods = HopObject.class.getMethods(); Method[] methods = HopObject.class.getMethods();
for (int i = 0; i < methods.length; i++) { for (int i = 0; i < methods.length; i++) {
if ("hopObjectConstructor".equals(methods[i].getName())) { if ("jsConstructor".equals(methods[i].getName())) {
hopObjCtor = methods[i]; hopObjCtor = methods[i];
break; break;
@ -64,7 +64,7 @@ public class HopObject extends ScriptableObject {
* *
* @param cname ... * @param cname ...
*/ */
public HopObject(String cname) { protected HopObject(String cname) {
className = cname; className = cname;
} }
@ -72,7 +72,7 @@ public class HopObject extends ScriptableObject {
/** /**
* This method is used as HopObject constructor from JavaScript. * This method is used as HopObject constructor from JavaScript.
*/ */
public static Object hopObjectConstructor(Context cx, Object[] args, public static Object jsConstructor(Context cx, Object[] args,
Function ctorObj, boolean inNewExpr) Function ctorObj, boolean inNewExpr)
throws JavaScriptException, ScriptingException { throws JavaScriptException, ScriptingException {
RhinoEngine engine = (RhinoEngine) cx.getThreadLocal("engine"); RhinoEngine engine = (RhinoEngine) cx.getThreadLocal("engine");