Review Request: Have RegExp.prototype.test set lastIndex like Regexp.prototype.exec
peter at pcc.me.uk
peter at pcc.me.uk
Sun Mar 21 16:52:19 GMT 2010
> On 2010-03-21 13:30:22, Maksim Orlovich wrote:
> > Looks good, thanks! Do you have an SVN account, or would you like me to commit it? Also, do you by any chance have a testcase?
Can you please commit it? I am not sure what the tests for kjs should look like but here is a small test case which prints out a pass/fail message:
var re = /x/g;
var s = "x";
if (re.test(s) && re.test(s))
println("fail");
else
println("pass");
- pcc
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/3327/#review4588
-----------------------------------------------------------
On 2010-03-20 22:35:31, pcc wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/3327/
> -----------------------------------------------------------
>
> (Updated 2010-03-20 22:35:31)
>
>
> Review request for kdelibs.
>
>
> Summary
> -------
>
> Have RegExp.prototype.test set lastIndex like Regexp.prototype.exec
>
> The EMCAScript specification states that Regexp.prototype.test
> acts exactly like Regexp.prototype.exec except for returning a
> boolean result. The kjs implementation currently does not conform
> to this because it does not set lastIndex if the global flag is set.
> This patch causes it to do so.
>
>
> Diffs
> -----
>
> trunk/KDE/kdelibs/kjs/regexp_object.cpp 1105683
>
> Diff: http://reviewboard.kde.org/r/3327/diff
>
>
> Testing
> -------
>
>
> Thanks,
>
> pcc
>
>
More information about the kde-core-devel
mailing list