X-Git-Url: http://git.megacz.com/?p=org.ibex.js.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FJSRegexp.java;h=3353b1dd7ea445f88db8168f3ad846e1e442937b;hp=40afb013b40fb17d0350d7851d6f94532eb63653;hb=7113d47d1ef227732b610026bee8c22b9ada3525;hpb=361d18aff8f32e60fb8b6c5c52744a9f1e9890be diff --git a/src/org/ibex/js/JSRegexp.java b/src/org/ibex/js/JSRegexp.java index 40afb01..3353b1d 100644 --- a/src/org/ibex/js/JSRegexp.java +++ b/src/org/ibex/js/JSRegexp.java @@ -48,7 +48,7 @@ public class JSRegexp extends JS.Immutable { case 1: { //#switch(Script.str(method)) case "exec": { - String s = Script.toString(a0); + String s = Script.toString(args[0]); int start = global ? lastIndex : 0; if(start < 0 || start >= s.length()) { lastIndex = 0; return null; } GnuRegexp.REMatch match = re.getMatch(s,start); @@ -56,13 +56,13 @@ public class JSRegexp extends JS.Immutable { return match == null ? null : matchToExecResult(match,re,s); } case "test": { - String s = Script.toString(a0); - if (!global) return B(re.getMatch(s) != null); + String s = Script.toString(args[0]); + if (!global) return Script.B(re.getMatch(s) != null); int start = global ? lastIndex : 0; if(start < 0 || start >= s.length()) { lastIndex = 0; return null; } GnuRegexp.REMatch match = re.getMatch(s,start); lastIndex = match != null ? s.length() : match.getEndIndex(); - return B(match != null); + return Script.B(match != null); } case "toString": return Script.S(args[0].coerceToString()); //#end @@ -299,7 +299,7 @@ public class JSRegexp extends JS.Immutable { if(sep != null && sep.length()==0) { int len = s.length(); for(int i=0;i