-
-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support useECMAScript215 option in ScalaJSModule
- Support ESModule ModuleKind - Update Scala.js 0.6 to 0.6.33 - Update Scala.js 1 to 1.3.1 - Add useECMAScript215 to test matrix just for last version - Update Scala versions it tests - Update ScalaJsUtils to use node.js instead of nashorn The initial idea was to use the NodeJSEnv from Scala.js to run the tests. But this created a problem since adding a particular NodeJSEnv to the classpath broke the other version of Scala.js linking. For example using NodeJSEnv from Scala.js 1.3.1 made fastOpt in Scala.js 0.6 break. So at the end the function is just calling "node" using `os.proc`
- Loading branch information
Showing
9 changed files
with
75 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,7 @@ | ||
package mill.scalajslib | ||
|
||
import java.io.{FileReader, StringWriter} | ||
import javax.script.{ScriptContext, ScriptEngineManager} | ||
|
||
object ScalaJsUtils { | ||
/* TODO Using Nashorn means that we do not support ECMAScript 2015, which | ||
* forces ScalaJSWorkerImpl to always use ES 5.1. We should a different | ||
* engine, perhaps Scala.js' own JSEnv, to perform these tests. | ||
*/ | ||
def runJS(path: os.Path): String = { | ||
val engineManager = new ScriptEngineManager(null) | ||
val engine = engineManager.getEngineByName("nashorn") | ||
val console = new Console | ||
val bindings = engine.getBindings(ScriptContext.ENGINE_SCOPE) | ||
bindings.put("console", console) | ||
engine.eval(new FileReader(path.toIO)) | ||
console.out.toString | ||
os.proc("node", path).call().out.text | ||
} | ||
} | ||
|
||
class Console { | ||
val out = new StringWriter() | ||
def log(s: String): Unit = out.append(s) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.