Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-09-06 16:12:51 +02:00
Set ES6 compat flag for Rhino
(cherry picked from commit 849a515d4a5c02c083e5ab343db40d7eb05b2f51)
Dieser Commit ist enthalten in:
Ursprung
852abce989
Commit
c0bfe06e4b
@ -35,6 +35,14 @@ public class RhinoContextFactory extends ContextFactory {
|
|||||||
@Override
|
@Override
|
||||||
protected Context makeContext() {
|
protected Context makeContext() {
|
||||||
RhinoContext cx = new RhinoContext(this);
|
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);
|
cx.setInstructionObserverThreshold(10000);
|
||||||
return cx;
|
return cx;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren