diff --git a/js/rhino/src/org/mozilla/javascript/ImporterTopLevel.java b/js/rhino/src/org/mozilla/javascript/ImporterTopLevel.java index af173828f8d8..0c09d24e7640 100644 --- a/js/rhino/src/org/mozilla/javascript/ImporterTopLevel.java +++ b/js/rhino/src/org/mozilla/javascript/ImporterTopLevel.java @@ -83,14 +83,7 @@ public class ImporterTopLevel extends ScriptableObject { } private void init() { - String[] names = { "importClass", "importPackage" }; - - try { - this.defineFunctionProperties(names, ImporterTopLevel.class, - ScriptableObject.DONTENUM); - } catch (PropertyException e) { - throw new Error(); // should never happen - } + (new ImporterFunctions(this)).define(this); } public String getClassName() { @@ -138,8 +131,8 @@ public class ImporterTopLevel extends ScriptableObject { return result; } - public static void importClass(Context cx, Scriptable thisObj, - Object[] args, Function funObj) { + void importClass(Context cx, Scriptable thisObj, Object[] args) + { for (int i=0; i