Repository: tapestry-5 Updated Branches: refs/heads/master eec9c9ae8 -> d7eb3dd70
allow to specify the language version to use for the Context Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/d7eb3dd7 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/d7eb3dd7 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/d7eb3dd7 Branch: refs/heads/master Commit: d7eb3dd701192b578c1977e26b6d99ffe221f44c Parents: eec9c9a Author: Jochen Kemnade <jochen.kemn...@eddyson.de> Authored: Tue Oct 10 09:41:11 2017 +0200 Committer: Jochen Kemnade <jochen.kemn...@eddyson.de> Committed: Tue Oct 10 09:41:11 2017 +0200 ---------------------------------------------------------------------- .../tapestry5/internal/webresources/CoffeeScriptCompiler.java | 3 ++- .../tapestry5/internal/webresources/RhinoExecutorPool.java | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d7eb3dd7/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/CoffeeScriptCompiler.java ---------------------------------------------------------------------- diff --git a/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/CoffeeScriptCompiler.java b/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/CoffeeScriptCompiler.java index cdbf504..8797f2d 100644 --- a/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/CoffeeScriptCompiler.java +++ b/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/CoffeeScriptCompiler.java @@ -22,6 +22,7 @@ import org.apache.tapestry5.ioc.internal.util.CollectionFactory; import org.apache.tapestry5.ioc.internal.util.InternalUtils; import org.apache.tapestry5.services.assets.ResourceDependencies; import org.apache.tapestry5.services.assets.ResourceTransformer; +import org.mozilla.javascript.Context; import org.mozilla.javascript.NativeObject; import java.io.IOException; @@ -48,7 +49,7 @@ public class CoffeeScriptCompiler implements ResourceTransformer OperationTracker tracker) { - executorPool = new RhinoExecutorPool(tracker, toList(mainCompiler, shim)); + executorPool = new RhinoExecutorPool(tracker, toList(mainCompiler, shim), Context.VERSION_DEFAULT); } private List<Resource> toList(Resource... resources) http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d7eb3dd7/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/RhinoExecutorPool.java ---------------------------------------------------------------------- diff --git a/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/RhinoExecutorPool.java b/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/RhinoExecutorPool.java index 80efaee..e64a2a0 100644 --- a/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/RhinoExecutorPool.java +++ b/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/RhinoExecutorPool.java @@ -46,10 +46,13 @@ public class RhinoExecutorPool private final ContextFactory contextFactory = new ContextFactory(); - public RhinoExecutorPool(OperationTracker tracker, List<Resource> scripts) + private final int languageVersion; + + public RhinoExecutorPool(OperationTracker tracker, List<Resource> scripts, int languageVersion) { this.tracker = tracker; this.scripts = scripts; + this.languageVersion = languageVersion; } /** @@ -91,6 +94,7 @@ public class RhinoExecutorPool try { context.setOptimizationLevel(-1); + context.setLanguageVersion(languageVersion); for (Resource script : scripts) {