mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Set ES6 compat flag for Rhino
(cherry picked from commit 849a515d4a5c02c083e5ab343db40d7eb05b2f51)
This commit is contained in:
parent
852abce989
commit
c0bfe06e4b
@ -35,6 +35,14 @@ public class RhinoContextFactory extends ContextFactory {
|
||||
@Override
|
||||
protected Context makeContext() {
|
||||
RhinoContext cx = new RhinoContext(this);
|
||||
try {
|
||||
// Try to set ES6 compat flag (since 1.7.7)
|
||||
Context.class.getDeclaredField("VERSION_ES6");
|
||||
cx.setLanguageVersion(RhinoContext.VERSION_ES6);
|
||||
} catch (NoSuchFieldException e) {
|
||||
// best we can do, compatible with 1.7R2 that many people probably use
|
||||
cx.setLanguageVersion(Context.VERSION_1_7);
|
||||
}
|
||||
cx.setInstructionObserverThreshold(10000);
|
||||
return cx;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user