X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fjs%2FRegexp.java;h=834a4250e29ef510fb37fe5d483fc3eb0d0ad0a8;hb=f11aab193c3ed2594d03d66b6adb869564686bc0;hp=81791238e8152c137565917246935a8470e81a22;hpb=83db7f387cbf85bee0cd4b9390af723d4e52e351;p=org.ibex.core.git diff --git a/src/org/xwt/js/Regexp.java b/src/org/xwt/js/Regexp.java index 8179123..834a425 100644 --- a/src/org/xwt/js/Regexp.java +++ b/src/org/xwt/js/Regexp.java @@ -7,9 +7,7 @@ public class Regexp extends JS.Obj { private RE re; private int lastIndex; - public Regexp(JS.Array args) throws JS.Exn { - if(args.length() < 1) throw new JS.Exn("Not enough args to regexp"); - Object arg0 = args.elementAt(0); + public Regexp(Object arg0, Object arg1) throws JS.Exn { if(arg0 instanceof Regexp) { Regexp r = (Regexp) arg0; this.global = r.global; @@ -19,7 +17,7 @@ public class Regexp extends JS.Obj { String pattern = arg0.toString(); String sFlags = null; int flags = 0; - if(args.length() == 2) sFlags = args.elementAt(1).toString(); + if(arg1 != null) sFlags = (String)arg1; if(sFlags == null) sFlags = ""; for(int i=0;i