projects
/
org.ibex.js.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
moved ProxyAutoConfig.java from org.ibex.net.HTTP to this package
[org.ibex.js.git]
/
src
/
org
/
ibex
/
js
/
JSRegexp.java
diff --git
a/src/org/ibex/js/JSRegexp.java
b/src/org/ibex/js/JSRegexp.java
index
aa68c2f
..
e7e35f7
100644
(file)
--- a/
src/org/ibex/js/JSRegexp.java
+++ b/
src/org/ibex/js/JSRegexp.java
@@
-110,6
+110,7
@@
public class JSRegexp extends JS.Immutable {
}
private static JS matchToExecResult(GnuRegexp.REMatch match, GnuRegexp.RE re, String s) {
}
private static JS matchToExecResult(GnuRegexp.REMatch match, GnuRegexp.RE re, String s) {
+ if (match == null) return null;
try {
JS ret = new JS.Obj();
ret.put(JSU.S("index"), JSU.N(match.getStartIndex()));
try {
JS ret = new JS.Obj();
ret.put(JSU.S("index"), JSU.N(match.getStartIndex()));
@@
-222,7
+223,7
@@
public class JSRegexp extends JS.Immutable {
args[args.length - 1] = JSU.S(s);
// note: can't perform pausing operations in here
args[args.length - 1] = JSU.S(s);
// note: can't perform pausing operations in here
- sb.append(JSU.toString(replaceFunc.call(args)));
+ sb.append(JSU.toString(replaceFunc.call(null, args)));
} else {
sb.append(mySubstitute(match,replaceString,s));
} else {
sb.append(mySubstitute(match,replaceString,s));