org.mozilla.javascript.regexp.NativeRegExpInstantiator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rhino Show documentation
Show all versions of rhino Show documentation
Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically
embedded into Java applications to provide scripting to end users.
package org.mozilla.javascript.regexp;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Scriptable;
public class NativeRegExpInstantiator {
private NativeRegExpInstantiator() {}
static NativeRegExp withLanguageVersion(int languageVersion) {
if (languageVersion < Context.VERSION_ES6) {
return new NativeRegExpCallable();
} else {
return new NativeRegExp();
}
}
static NativeRegExp withLanguageVersionScopeCompiled(int languageVersion, Scriptable scope, RECompiled compiled) {
if (languageVersion < Context.VERSION_ES6) {
return new NativeRegExpCallable(scope, compiled);
} else {
return new NativeRegExp(scope, compiled);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy