else if (name.equals("regexp")) return regexp;
else if (name.equals("sleep")) return sleep;
else if (name.equals("yield")) return yield;
+ else if (name.equals("newBrowserWindow")) return newBrowserWindow;
else if (name.equals("textwidth")) return textwidth;
else if (name.equals("textheight")) return textheight;
else if (name.equals("newBox")) return newBox;
public Scriptable construct(Context cx, Scriptable scope, java.lang.Object[] args) { return null; }
}
+ private static final JSFunction newBrowserWindow = new JSFunction() {
+ public Object call(Context cx, Scriptable thisObj, Scriptable ctorObj, Object[] args) throws JavaScriptException {
+ if (args.length != 1 || args[0] == null) return null;
+ Platform.newBrowserWindow(args[0].toString());
+ return null;
+ }
+ };
+
private static final JSFunction yield = new JSFunction() {
public Object call(Context cx, Scriptable thisObj, Scriptable ctorObj, Object[] args) throws JavaScriptException {
sleep.call(cx, null, null, null);
private static final JSFunction regexp = new JSFunction() {
public Object call(Context cx, Scriptable thisObj, Scriptable ctorObj, Object[] args) throws JavaScriptException {
- try { return Context.enter().newObject(org.xwt.util.JSObject.defaultObjects, "Regexp", args);
+ try { return Context.enter().newObject(org.xwt.util.JSObject.defaultObjects, "RegExp", args);
} catch (Exception e) {
if (Log.on) Log.log(this, "Exception in Context.newObject() -- this should never happen");
if (Log.on) Log.log(this, e);