org.mozilla.javascript.regexp.NativeRegExpCallable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rhino-runtime Show documentation
Show all versions of rhino-runtime Show documentation
Rhino JavaScript runtime jar, excludes tools & JSR-223 Script Engine wrapper.
The newest version!
package org.mozilla.javascript.regexp;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Function;
import org.mozilla.javascript.Scriptable;
/**
* Legacy implementation of RegExp was callable, this class exists to preserve this functionality
*/
class NativeRegExpCallable extends NativeRegExp implements Function {
NativeRegExpCallable(Scriptable scope, RECompiled compiled) {
super(scope, compiled);
}
NativeRegExpCallable() {
super();
}
@Override
public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) {
return execSub(cx, scope, args, MATCH);
}
@Override
public Scriptable construct(Context cx, Scriptable scope, Object[] args) {
return (Scriptable) execSub(cx, scope, args, MATCH);
}
}