diff options
author | Som Snytt <som.snytt@gmail.com> | 2013-09-14 22:11:46 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2013-09-14 22:11:46 -0700 |
commit | b4671f0103faf079b2c197c8875b484318bc6062 (patch) | |
tree | 470ab0bd109ed1a22e0c58e464c0cf58507438e4 | |
parent | 12bca51027e753763748f8456317fa03aaad6162 (diff) | |
download | scala-b4671f0103faf079b2c197c8875b484318bc6062.tar.gz scala-b4671f0103faf079b2c197c8875b484318bc6062.tar.bz2 scala-b4671f0103faf079b2c197c8875b484318bc6062.zip |
SI-7843 Restore JSR 223 service entry
The 2.10 fix to remove the ScriptEngine service entry
was inadvertently forwarded to 2.11.
This commit reverts and adds a test.
This situation was entirely foreseen by retronym,
proving beyond doubt that he is in fact a time traveler,
as hinted by his name. He brings bugs forward into the
future and returns into the past with fixes and other
alien technology like scalaz.
-rwxr-xr-x | build.xml | 3 | ||||
-rw-r--r-- | test/files/run/t7843-jsr223-service.check | 2 | ||||
-rw-r--r-- | test/files/run/t7843-jsr223-service.scala | 10 |
3 files changed, 13 insertions, 2 deletions
@@ -1358,11 +1358,10 @@ TODO: <attribute name="Class-Path" value="scala-reflect.jar scala-library.jar"/> </manifest> </pre> - <!-- script api is 2.11-only so far + <!-- JSR-223 support introduced in 2.11 --> <jar-opts> <service type="javax.script.ScriptEngineFactory" provider="scala.tools.nsc.interpreter.IMain$Factory"/> </jar-opts> - --> </staged-pack> </target> diff --git a/test/files/run/t7843-jsr223-service.check b/test/files/run/t7843-jsr223-service.check new file mode 100644 index 0000000000..a668df3567 --- /dev/null +++ b/test/files/run/t7843-jsr223-service.check @@ -0,0 +1,2 @@ +n: Object = 10 +12345678910 diff --git a/test/files/run/t7843-jsr223-service.scala b/test/files/run/t7843-jsr223-service.scala new file mode 100644 index 0000000000..0e3a9e572c --- /dev/null +++ b/test/files/run/t7843-jsr223-service.scala @@ -0,0 +1,10 @@ + +import javax.script._ +import scala.tools.nsc.interpreter.IMain + +object Test extends App { + val engine = new ScriptEngineManager getEngineByName "scala" + engine.asInstanceOf[IMain].settings.usejavacp.value = true + engine put ("n", 10) + engine eval "1 to n.asInstanceOf[Int] foreach print" +} |