summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore14
-rw-r--r--.idea/libraries/SBT__com_chuusai_shapeless_2_11_1_2_4.xml13
-rw-r--r--.idea/libraries/SBT__com_typesafe_akka_akka_actor_2_11_2_3_6.xml13
-rw-r--r--.idea/libraries/SBT__com_typesafe_config_1_2_1.xml14
-rw-r--r--.idea/libraries/SBT__io_spray_spray_can_2_11_1_3_2.xml14
-rw-r--r--.idea/libraries/SBT__io_spray_spray_http_2_11_1_3_2.xml14
-rw-r--r--.idea/libraries/SBT__io_spray_spray_httpx_2_11_1_3_2.xml14
-rw-r--r--.idea/libraries/SBT__io_spray_spray_io_2_11_1_3_2.xml14
-rw-r--r--.idea/libraries/SBT__io_spray_spray_routing_2_11_1_3_2.xml14
-rw-r--r--.idea/libraries/SBT__io_spray_spray_util_2_11_1_3_2.xml14
-rw-r--r--.idea/libraries/SBT__org_jvnet_mimepull_mimepull_1_9_4.xml13
-rw-r--r--.idea/libraries/SBT__org_parboiled_parboiled_core_1_1_6.xml14
-rw-r--r--.idea/libraries/SBT__org_parboiled_parboiled_scala_2_11_1_1_6.xml14
-rwxr-xr-xbook/src/main/resources/css/side-menu.css338
-rw-r--r--book/src/main/resources/favicon.pngbin0 -> 988 bytes
-rw-r--r--book/src/main/resources/favicon.svg44
-rw-r--r--book/src/main/resources/images/Dropdown.pngbin0 -> 331377 bytes
-rw-r--r--book/src/main/resources/images/Hello World Console.pngbin0 -> 345956 bytes
-rw-r--r--book/src/main/resources/images/Hello World White.pngbin0 -> 245770 bytes
-rw-r--r--book/src/main/resources/images/Hello World.pngbin0 -> 265509 bytes
-rw-r--r--book/src/main/resources/images/IntelliJ Hello.pngbin0 -> 338093 bytes
-rw-r--r--book/src/main/resources/images/Scalatags Downloads.pngbin0 -> 89779 bytes
-rw-r--r--book/src/main/resources/images/javascript-the-good-parts-the-definitive-guide.jpgbin0 -> 53631 bytes
-rw-r--r--book/src/main/scala/book/Book.scala90
-rw-r--r--book/src/main/scala/book/BookData.scala45
-rw-r--r--book/src/main/scala/book/Main.scala66
-rw-r--r--book/src/main/scala/book/Utils.scala213
-rw-r--r--book/src/main/scalatex/book/Index.scalatex83
-rw-r--r--book/src/main/scalatex/book/Intro.scalatex182
-rw-r--r--book/src/main/scalatex/book/handson/CanvasApp.scalatex210
-rw-r--r--book/src/main/scalatex/book/handson/ClientServer.scalatex244
-rw-r--r--book/src/main/scalatex/book/handson/CommandLine.scalatex173
-rw-r--r--book/src/main/scalatex/book/handson/GettingStarted.scalatex326
-rw-r--r--book/src/main/scalatex/book/handson/PublishingModules.scalatex197
-rw-r--r--book/src/main/scalatex/book/handson/WebPage.scalatex267
-rw-r--r--book/src/main/scalatex/book/indepth/AdvancedTechniques.scalatex305
-rw-r--r--book/src/main/scalatex/book/indepth/CompilationPipeline.scalatex185
-rw-r--r--book/src/main/scalatex/book/indepth/DesignSpace.scalatex239
-rw-r--r--book/src/main/scalatex/book/indepth/JavaAPIs.scalatex44
-rw-r--r--book/src/main/scalatex/book/indepth/JavascriptInterop.scalatex1
-rw-r--r--book/src/main/scalatex/book/indepth/SemanticDifferences.scalatex247
-rw-r--r--build.sbt99
-rw-r--r--examples/crossBuilds/clientserver/build.sbt36
-rw-r--r--examples/crossBuilds/clientserver/client/shared/main/scala/simple/FileData.scala3
-rw-r--r--examples/crossBuilds/clientserver/client/src/main/scala/simple/Client.scala36
-rw-r--r--examples/crossBuilds/clientserver/project/build.sbt5
l---------examples/crossBuilds/clientserver/server/shared1
-rw-r--r--examples/crossBuilds/clientserver/server/src/main/scala/simple/Page.scala21
-rw-r--r--examples/crossBuilds/clientserver/server/src/main/scala/simple/Server.scala43
-rw-r--r--examples/crossBuilds/clientserver2/build.sbt37
-rw-r--r--examples/crossBuilds/clientserver2/client/shared/main/scala/simple/Shared.scala7
-rw-r--r--examples/crossBuilds/clientserver2/client/src/main/scala/simple/Client.scala46
-rw-r--r--examples/crossBuilds/clientserver2/project/build.sbt5
l---------examples/crossBuilds/clientserver2/server/shared1
-rw-r--r--examples/crossBuilds/clientserver2/server/src/main/scala/simple/Page.scala21
-rw-r--r--examples/crossBuilds/clientserver2/server/src/main/scala/simple/Server.scala51
-rw-r--r--examples/crossBuilds/simple/build.sbt9
-rw-r--r--examples/crossBuilds/simple/js/shared/main/scala/simple/Simple.scala7
-rw-r--r--examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala17
l---------examples/crossBuilds/simple/jvm/shared1
-rw-r--r--examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala22
-rw-r--r--examples/crossBuilds/simple/project/build.sbt2
-rw-r--r--examples/crossBuilds/simple2/build.sbt13
-rw-r--r--examples/crossBuilds/simple2/js/shared/main/scala/simple/Simple.scala7
-rw-r--r--examples/crossBuilds/simple2/js/shared/test/scala/simple/SimpleTest.scala20
-rw-r--r--examples/crossBuilds/simple2/js/src/main/scala/simple/Platform.scala9
l---------examples/crossBuilds/simple2/jvm/shared1
-rw-r--r--examples/crossBuilds/simple2/jvm/src/main/scala/simple/Platform.scala14
-rw-r--r--examples/crossBuilds/simple2/project/build.sbt4
-rw-r--r--examples/demos/build.sbt21
-rw-r--r--examples/demos/src/main/resources/webpage/weather.js17
-rw-r--r--examples/demos/src/main/scala/Splash.scala43
-rw-r--r--examples/demos/src/main/scala/advanced/Async.scala120
-rw-r--r--examples/demos/src/main/scala/advanced/BasicRx.scala80
-rw-r--r--examples/demos/src/main/scala/advanced/Futures.scala107
-rw-r--r--examples/demos/src/main/scala/canvasapp/Clock.scala51
-rw-r--r--examples/demos/src/main/scala/canvasapp/FlappyLine.scala109
-rw-r--r--examples/demos/src/main/scala/canvasapp/ScratchPad.scala40
-rw-r--r--examples/demos/src/main/scala/scrollmenu/Controller.scala80
-rw-r--r--examples/demos/src/main/scala/scrollmenu/ScrollMenu.scala117
-rw-r--r--examples/demos/src/main/scala/webpage/HelloWorld0.scala19
-rw-r--r--examples/demos/src/main/scala/webpage/HelloWorld1.scala18
-rw-r--r--examples/demos/src/main/scala/webpage/Inputs.scala35
-rw-r--r--examples/demos/src/main/scala/webpage/Search0.scala50
-rw-r--r--examples/demos/src/main/scala/webpage/Search1.scala62
-rw-r--r--examples/demos/src/main/scala/webpage/Weather0.scala27
-rw-r--r--examples/demos/src/main/scala/webpage/Weather1.scala30
-rw-r--r--examples/demos/src/main/scala/webpage/Weather2.scala35
-rw-r--r--examples/demos/src/main/scala/webpage/Weather3.scala55
-rw-r--r--examples/demos/src/main/scala/webpage/WeatherSearch.scala90
-rw-r--r--examples/scala-js/.gitignore10
-rw-r--r--examples/scala-js/LICENSE (renamed from LICENSE)0
-rw-r--r--examples/scala-js/README.md (renamed from README.md)0
-rw-r--r--examples/scala-js/TESTING (renamed from TESTING)0
-rwxr-xr-xexamples/scala-js/ci/check-partest-coverage.sh (renamed from ci/check-partest-coverage.sh)0
-rwxr-xr-xexamples/scala-js/ci/checksizes.sh (renamed from ci/checksizes.sh)0
-rw-r--r--examples/scala-js/ci/matrix.xml (renamed from ci/matrix.xml)0
-rw-r--r--examples/scala-js/ci/scalajs-matrix-build.groovy (renamed from ci/scalajs-matrix-build.groovy)0
-rwxr-xr-xexamples/scala-js/cli/src/main/resources/scalajsc (renamed from cli/src/main/resources/scalajsc)0
-rw-r--r--examples/scala-js/cli/src/main/resources/scalajsc.bat (renamed from cli/src/main/resources/scalajsc.bat)0
-rwxr-xr-xexamples/scala-js/cli/src/main/resources/scalajsld (renamed from cli/src/main/resources/scalajsld)0
-rw-r--r--examples/scala-js/cli/src/main/resources/scalajsld.bat (renamed from cli/src/main/resources/scalajsld.bat)0
-rwxr-xr-xexamples/scala-js/cli/src/main/resources/scalajsp (renamed from cli/src/main/resources/scalajsp)0
-rw-r--r--examples/scala-js/cli/src/main/resources/scalajsp.bat (renamed from cli/src/main/resources/scalajsp.bat)0
-rw-r--r--examples/scala-js/cli/src/main/scala/scala/scalajs/cli/Scalajsld.scala (renamed from cli/src/main/scala/scala/scalajs/cli/Scalajsld.scala)0
-rw-r--r--examples/scala-js/cli/src/main/scala/scala/scalajs/cli/Scalajsp.scala (renamed from cli/src/main/scala/scala/scalajs/cli/Scalajsp.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/resources/scalac-plugin.xml (renamed from compiler/src/main/resources/scalac-plugin.xml)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/ClassInfos.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/ClassInfos.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/Compat210Component.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/Compat210Component.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/GenJSCode.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/GenJSCode.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/GenJSExports.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/GenJSExports.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/GenJSFiles.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/GenJSFiles.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSDefinitions.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/JSDefinitions.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSEncoding.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/JSEncoding.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSGlobalAddons.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/JSGlobalAddons.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSPrimitives.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/JSPrimitives.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSTreeExtractors.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/JSTreeExtractors.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/PrepJSExports.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/PrepJSExports.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/PrepJSInterop.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/PrepJSInterop.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/ScalaJSOptions.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/ScalaJSOptions.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/ScalaJSPlugin.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/ScalaJSPlugin.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/TypeKinds.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/TypeKinds.scala)0
-rw-r--r--examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/util/ScopedVar.scala (renamed from compiler/src/main/scala/scala/scalajs/compiler/util/ScopedVar.scala)0
-rw-r--r--examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/DiverseErrorsTest.scala (renamed from compiler/src/test/scala/scala/scalajs/compiler/test/DiverseErrorsTest.scala)0
-rw-r--r--examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/EnumerationInteropTest.scala (renamed from compiler/src/test/scala/scala/scalajs/compiler/test/EnumerationInteropTest.scala)0
-rw-r--r--examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/JSDynamicLiteralTest.scala (renamed from compiler/src/test/scala/scala/scalajs/compiler/test/JSDynamicLiteralTest.scala)0
-rw-r--r--examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/JSExportASTTest.scala (renamed from compiler/src/test/scala/scala/scalajs/compiler/test/JSExportASTTest.scala)0
-rw-r--r--examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/JSExportTest.scala (renamed from compiler/src/test/scala/scala/scalajs/compiler/test/JSExportTest.scala)0
-rw-r--r--examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/JSInteropTest.scala (renamed from compiler/src/test/scala/scala/scalajs/compiler/test/JSInteropTest.scala)0
-rw-r--r--examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/OptimizationTest.scala (renamed from compiler/src/test/scala/scala/scalajs/compiler/test/OptimizationTest.scala)0
-rw-r--r--examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/PositionTest.scala (renamed from compiler/src/test/scala/scala/scalajs/compiler/test/PositionTest.scala)0
-rw-r--r--examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/util/DirectTest.scala (renamed from compiler/src/test/scala/scala/scalajs/compiler/test/util/DirectTest.scala)0
-rw-r--r--examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/util/JSASTTest.scala (renamed from compiler/src/test/scala/scala/scalajs/compiler/test/util/JSASTTest.scala)0
-rw-r--r--examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/util/TestHelpers.scala (renamed from compiler/src/test/scala/scala/scalajs/compiler/test/util/TestHelpers.scala)0
-rw-r--r--examples/scala-js/examples/helloworld/HelloWorld.scala (renamed from examples/helloworld/HelloWorld.scala)0
-rw-r--r--examples/scala-js/examples/helloworld/helloworld-2.10-fastopt.html (renamed from examples/helloworld/helloworld-2.10-fastopt.html)0
-rw-r--r--examples/scala-js/examples/helloworld/helloworld-2.10.html (renamed from examples/helloworld/helloworld-2.10.html)0
-rw-r--r--examples/scala-js/examples/helloworld/helloworld-2.11-fastopt.html (renamed from examples/helloworld/helloworld-2.11-fastopt.html)0
-rw-r--r--examples/scala-js/examples/helloworld/helloworld-2.11.html (renamed from examples/helloworld/helloworld-2.11.html)0
-rw-r--r--examples/scala-js/examples/helloworld/startup.js (renamed from examples/helloworld/startup.js)0
-rw-r--r--examples/scala-js/examples/reversi/JSTypes.scala (renamed from examples/reversi/JSTypes.scala)0
-rw-r--r--examples/scala-js/examples/reversi/Reversi.scala (renamed from examples/reversi/Reversi.scala)0
-rw-r--r--examples/scala-js/examples/reversi/reversi-2.10-fastopt.html (renamed from examples/reversi/reversi-2.10-fastopt.html)0
-rw-r--r--examples/scala-js/examples/reversi/reversi-2.10.html (renamed from examples/reversi/reversi-2.10.html)0
-rw-r--r--examples/scala-js/examples/reversi/reversi-2.11-fastopt.html (renamed from examples/reversi/reversi-2.11-fastopt.html)0
-rw-r--r--examples/scala-js/examples/reversi/reversi-2.11.html (renamed from examples/reversi/reversi-2.11.html)0
-rw-r--r--examples/scala-js/examples/testing/src/main/scala/ElementCreator.scala (renamed from examples/testing/src/main/scala/ElementCreator.scala)0
-rw-r--r--examples/scala-js/examples/testing/src/test/scala/CollectionTest.scala (renamed from examples/testing/src/test/scala/CollectionTest.scala)0
-rw-r--r--examples/scala-js/examples/testing/src/test/scala/ElementCreatorTest.scala (renamed from examples/testing/src/test/scala/ElementCreatorTest.scala)0
-rw-r--r--examples/scala-js/examples/testing/testing-2.10-fastopt.html (renamed from examples/testing/testing-2.10-fastopt.html)0
-rw-r--r--examples/scala-js/examples/testing/testing-2.10.html (renamed from examples/testing/testing-2.10.html)0
-rw-r--r--examples/scala-js/examples/testing/testing-2.11-fastopt.html (renamed from examples/testing/testing-2.11-fastopt.html)0
-rw-r--r--examples/scala-js/examples/testing/testing-2.11.html (renamed from examples/testing/testing-2.11.html)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/ClassKind.scala (renamed from ir/src/main/scala/scala/scalajs/ir/ClassKind.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Definitions.scala (renamed from ir/src/main/scala/scala/scalajs/ir/Definitions.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Hashers.scala (renamed from ir/src/main/scala/scala/scalajs/ir/Hashers.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/InfoSerializers.scala (renamed from ir/src/main/scala/scala/scalajs/ir/InfoSerializers.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Infos.scala (renamed from ir/src/main/scala/scala/scalajs/ir/Infos.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Position.scala (renamed from ir/src/main/scala/scala/scalajs/ir/Position.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Printers.scala (renamed from ir/src/main/scala/scala/scalajs/ir/Printers.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/ScalaJSVersions.scala (renamed from ir/src/main/scala/scala/scalajs/ir/ScalaJSVersions.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Serializers.scala (renamed from ir/src/main/scala/scala/scalajs/ir/Serializers.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Tags.scala (renamed from ir/src/main/scala/scala/scalajs/ir/Tags.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Transformers.scala (renamed from ir/src/main/scala/scala/scalajs/ir/Transformers.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Traversers.scala (renamed from ir/src/main/scala/scala/scalajs/ir/Traversers.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Trees.scala (renamed from ir/src/main/scala/scala/scalajs/ir/Trees.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Types.scala (renamed from ir/src/main/scala/scala/scalajs/ir/Types.scala)0
-rw-r--r--examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Utils.scala (renamed from ir/src/main/scala/scala/scalajs/ir/Utils.scala)0
-rw-r--r--examples/scala-js/jasmine-test-framework/src/main/resources/jasmine-polyfills.js (renamed from jasmine-test-framework/src/main/resources/jasmine-polyfills.js)0
-rw-r--r--examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Jasmine.scala (renamed from jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Jasmine.scala)0
-rw-r--r--examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/JasmineEnv.scala (renamed from jasmine-test-framework/src/main/scala/org/scalajs/jasmine/JasmineEnv.scala)0
-rw-r--r--examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/JasmineExpectation.scala (renamed from jasmine-test-framework/src/main/scala/org/scalajs/jasmine/JasmineExpectation.scala)0
-rw-r--r--examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Results.scala (renamed from jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Results.scala)0
-rw-r--r--examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Spec.scala (renamed from jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Spec.scala)0
-rw-r--r--examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/SpecResults.scala (renamed from jasmine-test-framework/src/main/scala/org/scalajs/jasmine/SpecResults.scala)0
-rw-r--r--examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Suite.scala (renamed from jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Suite.scala)0
-rw-r--r--examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/SuiteResults.scala (renamed from jasmine-test-framework/src/main/scala/org/scalajs/jasmine/SuiteResults.scala)0
-rw-r--r--examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTest.scala (renamed from jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTest.scala)0
-rw-r--r--examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTestFramework.scala (renamed from jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTestFramework.scala)0
-rw-r--r--examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTestReporter.scala (renamed from jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTestReporter.scala)0
-rw-r--r--examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/TestSuiteContext.scala (renamed from jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/TestSuiteContext.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Appendable.scala (renamed from javalanglib/src/main/scala/java/lang/Appendable.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/AutoCloseable.scala (renamed from javalanglib/src/main/scala/java/lang/AutoCloseable.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Boolean.scala (renamed from javalanglib/src/main/scala/java/lang/Boolean.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Byte.scala (renamed from javalanglib/src/main/scala/java/lang/Byte.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/CharSequence.scala (renamed from javalanglib/src/main/scala/java/lang/CharSequence.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Character.scala (renamed from javalanglib/src/main/scala/java/lang/Character.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Class.scala (renamed from javalanglib/src/main/scala/java/lang/Class.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Cloneable.scala (renamed from javalanglib/src/main/scala/java/lang/Cloneable.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Comparable.scala (renamed from javalanglib/src/main/scala/java/lang/Comparable.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Double.scala (renamed from javalanglib/src/main/scala/java/lang/Double.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Float.scala (renamed from javalanglib/src/main/scala/java/lang/Float.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/InheritableThreadLocal.scala (renamed from javalanglib/src/main/scala/java/lang/InheritableThreadLocal.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Integer.scala (renamed from javalanglib/src/main/scala/java/lang/Integer.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Long.scala (renamed from javalanglib/src/main/scala/java/lang/Long.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Math.scala (renamed from javalanglib/src/main/scala/java/lang/Math.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Number.scala (renamed from javalanglib/src/main/scala/java/lang/Number.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Readable.scala (renamed from javalanglib/src/main/scala/java/lang/Readable.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Runnable.scala (renamed from javalanglib/src/main/scala/java/lang/Runnable.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Runtime.scala (renamed from javalanglib/src/main/scala/java/lang/Runtime.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Short.scala (renamed from javalanglib/src/main/scala/java/lang/Short.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/StackTraceElement.scala (renamed from javalanglib/src/main/scala/java/lang/StackTraceElement.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/StringBuffer.scala (renamed from javalanglib/src/main/scala/java/lang/StringBuffer.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/StringBuilder.scala (renamed from javalanglib/src/main/scala/java/lang/StringBuilder.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/System.scala (renamed from javalanglib/src/main/scala/java/lang/System.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Thread.scala (renamed from javalanglib/src/main/scala/java/lang/Thread.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/ThreadLocal.scala (renamed from javalanglib/src/main/scala/java/lang/ThreadLocal.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Throwables.scala (renamed from javalanglib/src/main/scala/java/lang/Throwables.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/Void.scala (renamed from javalanglib/src/main/scala/java/lang/Void.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/ref/PhantomReference.scala (renamed from javalanglib/src/main/scala/java/lang/ref/PhantomReference.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/ref/Reference.scala (renamed from javalanglib/src/main/scala/java/lang/ref/Reference.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/ref/ReferenceQueue.scala (renamed from javalanglib/src/main/scala/java/lang/ref/ReferenceQueue.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/ref/SoftReference.scala (renamed from javalanglib/src/main/scala/java/lang/ref/SoftReference.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/ref/WeakReference.scala (renamed from javalanglib/src/main/scala/java/lang/ref/WeakReference.scala)0
-rw-r--r--examples/scala-js/javalanglib/src/main/scala/java/lang/reflect/Array.scala (renamed from javalanglib/src/main/scala/java/lang/reflect/Array.scala)0
-rw-r--r--examples/scala-js/javalib-ex-test-suite/src/test/scala/scala/scalajs/testsuite/javalibex/DataInputStreamTest.scala (renamed from javalib-ex-test-suite/src/test/scala/scala/scalajs/testsuite/javalibex/DataInputStreamTest.scala)0
-rw-r--r--examples/scala-js/javalib-ex-test-suite/src/test/scala/scala/scalajs/testsuite/javalibex/ZipInputStreamTest.scala (renamed from javalib-ex-test-suite/src/test/scala/scala/scalajs/testsuite/javalibex/ZipInputStreamTest.scala)0
-rw-r--r--examples/scala-js/javalib-ex/src/main/scala/java/io/DataInputStream.scala (renamed from javalib-ex/src/main/scala/java/io/DataInputStream.scala)0
-rw-r--r--examples/scala-js/javalib-ex/src/main/scala/java/util/zip/InflaterInputStream.scala (renamed from javalib-ex/src/main/scala/java/util/zip/InflaterInputStream.scala)0
-rw-r--r--examples/scala-js/javalib-ex/src/main/scala/java/util/zip/ZipEntry.scala (renamed from javalib-ex/src/main/scala/java/util/zip/ZipEntry.scala)0
-rw-r--r--examples/scala-js/javalib-ex/src/main/scala/java/util/zip/ZipInputStream.scala (renamed from javalib-ex/src/main/scala/java/util/zip/ZipInputStream.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/BufferedReader.scala (renamed from javalib/src/main/scala/java/io/BufferedReader.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/ByteArrayInputStream.scala (renamed from javalib/src/main/scala/java/io/ByteArrayInputStream.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/ByteArrayOutputStream.scala (renamed from javalib/src/main/scala/java/io/ByteArrayOutputStream.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/Closeable.scala (renamed from javalib/src/main/scala/java/io/Closeable.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/DataInput.scala (renamed from javalib/src/main/scala/java/io/DataInput.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/FilterInputStream.scala (renamed from javalib/src/main/scala/java/io/FilterInputStream.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/FilterOutputStream.scala (renamed from javalib/src/main/scala/java/io/FilterOutputStream.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/Flushable.scala (renamed from javalib/src/main/scala/java/io/Flushable.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/InputStream.scala (renamed from javalib/src/main/scala/java/io/InputStream.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/InputStreamReader.scala (renamed from javalib/src/main/scala/java/io/InputStreamReader.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/OutputStream.scala (renamed from javalib/src/main/scala/java/io/OutputStream.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/OutputStreamWriter.scala (renamed from javalib/src/main/scala/java/io/OutputStreamWriter.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/PrintStream.scala (renamed from javalib/src/main/scala/java/io/PrintStream.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/PrintWriter.scala (renamed from javalib/src/main/scala/java/io/PrintWriter.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/Reader.scala (renamed from javalib/src/main/scala/java/io/Reader.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/Serializable.scala (renamed from javalib/src/main/scala/java/io/Serializable.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/StringReader.scala (renamed from javalib/src/main/scala/java/io/StringReader.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/StringWriter.scala (renamed from javalib/src/main/scala/java/io/StringWriter.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/Throwables.scala (renamed from javalib/src/main/scala/java/io/Throwables.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/io/Writer.scala (renamed from javalib/src/main/scala/java/io/Writer.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/net/URI.scala (renamed from javalib/src/main/scala/java/net/URI.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/net/URISyntaxException.scala (renamed from javalib/src/main/scala/java/net/URISyntaxException.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/Buffer.scala (renamed from javalib/src/main/scala/java/nio/Buffer.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/BufferOverflowException.scala (renamed from javalib/src/main/scala/java/nio/BufferOverflowException.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/BufferUnderflowException.scala (renamed from javalib/src/main/scala/java/nio/BufferUnderflowException.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/ByteBuffer.scala (renamed from javalib/src/main/scala/java/nio/ByteBuffer.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/ByteOrder.scala (renamed from javalib/src/main/scala/java/nio/ByteOrder.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/CharBuffer.scala (renamed from javalib/src/main/scala/java/nio/CharBuffer.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/HeapByteBuffer.scala (renamed from javalib/src/main/scala/java/nio/HeapByteBuffer.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/HeapCharBuffer.scala (renamed from javalib/src/main/scala/java/nio/HeapCharBuffer.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/InvalidMarkException.scala (renamed from javalib/src/main/scala/java/nio/InvalidMarkException.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/ReadOnlyBufferException.scala (renamed from javalib/src/main/scala/java/nio/ReadOnlyBufferException.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/StringCharBuffer.scala (renamed from javalib/src/main/scala/java/nio/StringCharBuffer.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/charset/CharacterCodingException.scala (renamed from javalib/src/main/scala/java/nio/charset/CharacterCodingException.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/charset/Charset.scala (renamed from javalib/src/main/scala/java/nio/charset/Charset.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/charset/CharsetDecoder.scala (renamed from javalib/src/main/scala/java/nio/charset/CharsetDecoder.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/charset/CharsetEncoder.scala (renamed from javalib/src/main/scala/java/nio/charset/CharsetEncoder.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/charset/CoderMalfunctionError.scala (renamed from javalib/src/main/scala/java/nio/charset/CoderMalfunctionError.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/charset/CoderResult.scala (renamed from javalib/src/main/scala/java/nio/charset/CoderResult.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/charset/CodingErrorAction.scala (renamed from javalib/src/main/scala/java/nio/charset/CodingErrorAction.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/charset/MalformedInputException.scala (renamed from javalib/src/main/scala/java/nio/charset/MalformedInputException.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/charset/StandardCharsets.scala (renamed from javalib/src/main/scala/java/nio/charset/StandardCharsets.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/charset/UnmappableCharacterException.scala (renamed from javalib/src/main/scala/java/nio/charset/UnmappableCharacterException.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/nio/charset/UnsupportedCharsetException.scala (renamed from javalib/src/main/scala/java/nio/charset/UnsupportedCharsetException.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/Arrays.scala (renamed from javalib/src/main/scala/java/util/Arrays.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/Comparator.scala (renamed from javalib/src/main/scala/java/util/Comparator.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/Date.scala (renamed from javalib/src/main/scala/java/util/Date.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/Formattable.scala (renamed from javalib/src/main/scala/java/util/Formattable.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/FormattableFlags.scala (renamed from javalib/src/main/scala/java/util/FormattableFlags.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/Formatter.scala (renamed from javalib/src/main/scala/java/util/Formatter.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/Random.scala (renamed from javalib/src/main/scala/java/util/Random.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/Throwables.scala (renamed from javalib/src/main/scala/java/util/Throwables.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/UUID.scala (renamed from javalib/src/main/scala/java/util/UUID.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/concurrent/ExecutionException.scala (renamed from javalib/src/main/scala/java/util/concurrent/ExecutionException.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/concurrent/Executor.scala (renamed from javalib/src/main/scala/java/util/concurrent/Executor.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/concurrent/TimeUnit.scala (renamed from javalib/src/main/scala/java/util/concurrent/TimeUnit.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicBoolean.scala (renamed from javalib/src/main/scala/java/util/concurrent/atomic/AtomicBoolean.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicInteger.scala (renamed from javalib/src/main/scala/java/util/concurrent/atomic/AtomicInteger.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicLong.scala (renamed from javalib/src/main/scala/java/util/concurrent/atomic/AtomicLong.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicReference.scala (renamed from javalib/src/main/scala/java/util/concurrent/atomic/AtomicReference.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/regex/MatchResult.scala (renamed from javalib/src/main/scala/java/util/regex/MatchResult.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/regex/Matcher.scala (renamed from javalib/src/main/scala/java/util/regex/Matcher.scala)0
-rw-r--r--examples/scala-js/javalib/src/main/scala/java/util/regex/Pattern.scala (renamed from javalib/src/main/scala/java/util/regex/Pattern.scala)0
-rw-r--r--examples/scala-js/library-aux/src/main/scala/scala/runtime/ArrayRuntime.scala (renamed from library-aux/src/main/scala/scala/runtime/ArrayRuntime.scala)0
-rw-r--r--examples/scala-js/library-aux/src/main/scala/scala/runtime/BoxedUnit.scala (renamed from library-aux/src/main/scala/scala/runtime/BoxedUnit.scala)0
-rw-r--r--examples/scala-js/library-aux/src/main/scala/scala/runtime/RefTypes.scala (renamed from library-aux/src/main/scala/scala/runtime/RefTypes.scala)0
-rw-r--r--examples/scala-js/library-aux/src/main/scala/scala/runtime/Statics.scala (renamed from library-aux/src/main/scala/scala/runtime/Statics.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/concurrent/JSExecutionContext.scala (renamed from library/src/main/scala/scala/scalajs/concurrent/JSExecutionContext.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/concurrent/QueueExecutionContext.scala (renamed from library/src/main/scala/scala/scalajs/concurrent/QueueExecutionContext.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/concurrent/RunNowExcecutionContext.scala (renamed from library/src/main/scala/scala/scalajs/concurrent/RunNowExcecutionContext.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/Array.scala (renamed from library/src/main/scala/scala/scalajs/js/Array.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/ArrayOps.scala (renamed from library/src/main/scala/scala/scalajs/js/ArrayOps.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/Date.scala (renamed from library/src/main/scala/scala/scalajs/js/Date.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/Dictionary.scala (renamed from library/src/main/scala/scala/scalajs/js/Dictionary.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/Error.scala (renamed from library/src/main/scala/scala/scalajs/js/Error.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/Function.scala (renamed from library/src/main/scala/scala/scalajs/js/Function.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/GlobalScope.scala (renamed from library/src/main/scala/scala/scalajs/js/GlobalScope.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/JSApp.scala (renamed from library/src/main/scala/scala/scalajs/js/JSApp.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/JSArrayOps.scala (renamed from library/src/main/scala/scala/scalajs/js/JSArrayOps.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/JSConverters.scala (renamed from library/src/main/scala/scala/scalajs/js/JSConverters.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/JSON.scala (renamed from library/src/main/scala/scala/scalajs/js/JSON.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/JavaScriptException.scala (renamed from library/src/main/scala/scala/scalajs/js/JavaScriptException.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/Math.scala (renamed from library/src/main/scala/scala/scalajs/js/Math.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/Primitives.scala (renamed from library/src/main/scala/scala/scalajs/js/Primitives.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/PropertyDescriptor.scala (renamed from library/src/main/scala/scala/scalajs/js/PropertyDescriptor.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/RegExp.scala (renamed from library/src/main/scala/scala/scalajs/js/RegExp.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/ThisFunction.scala (renamed from library/src/main/scala/scala/scalajs/js/ThisFunction.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/UndefOr.scala (renamed from library/src/main/scala/scala/scalajs/js/UndefOr.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/WrappedArray.scala (renamed from library/src/main/scala/scala/scalajs/js/WrappedArray.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/WrappedDictionary.scala (renamed from library/src/main/scala/scala/scalajs/js/WrappedDictionary.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSBracketAccess.scala (renamed from library/src/main/scala/scala/scalajs/js/annotation/JSBracketAccess.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExport.scala (renamed from library/src/main/scala/scala/scalajs/js/annotation/JSExport.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExportAll.scala (renamed from library/src/main/scala/scala/scalajs/js/annotation/JSExportAll.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentClasses.scala (renamed from library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentClasses.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentObjects.scala (renamed from library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentObjects.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExportNamed.scala (renamed from library/src/main/scala/scala/scalajs/js/annotation/JSExportNamed.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSName.scala (renamed from library/src/main/scala/scala/scalajs/js/annotation/JSName.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/README.md (renamed from library/src/main/scala/scala/scalajs/js/annotation/README.md)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/RawJSType.scala (renamed from library/src/main/scala/scala/scalajs/js/annotation/RawJSType.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/package.scala (renamed from library/src/main/scala/scala/scalajs/js/package.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBuffer.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/ArrayBuffer.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBufferInputStream.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/ArrayBufferInputStream.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBufferView.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/ArrayBufferView.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/DataView.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/DataView.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Float32Array.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/Float32Array.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Float64Array.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/Float64Array.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int16Array.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/Int16Array.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int32Array.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/Int32Array.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int8Array.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/Int8Array.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/TypedArray.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/TypedArray.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Uint16Array.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/Uint16Array.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Uint32Array.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/Uint32Array.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Uint8Array.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/Uint8Array.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Uint8ClampedArray.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/Uint8ClampedArray.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/package.scala (renamed from library/src/main/scala/scala/scalajs/js/typedarray/package.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/ISO_8859_1.scala (renamed from library/src/main/scala/scala/scalajs/niocharset/ISO_8859_1.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/ISO_8859_1_And_US_ASCII_Common.scala (renamed from library/src/main/scala/scala/scalajs/niocharset/ISO_8859_1_And_US_ASCII_Common.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/StandardCharsets.scala (renamed from library/src/main/scala/scala/scalajs/niocharset/StandardCharsets.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/US_ASCII.scala (renamed from library/src/main/scala/scala/scalajs/niocharset/US_ASCII.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_16.scala (renamed from library/src/main/scala/scala/scalajs/niocharset/UTF_16.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_16BE.scala (renamed from library/src/main/scala/scala/scalajs/niocharset/UTF_16BE.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_16LE.scala (renamed from library/src/main/scala/scala/scalajs/niocharset/UTF_16LE.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_16_Common.scala (renamed from library/src/main/scala/scala/scalajs/niocharset/UTF_16_Common.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_8.scala (renamed from library/src/main/scala/scala/scalajs/niocharset/UTF_8.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/runtime/AnonFunctions.scala (renamed from library/src/main/scala/scala/scalajs/runtime/AnonFunctions.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/runtime/Bits.scala (renamed from library/src/main/scala/scala/scalajs/runtime/Bits.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/runtime/BooleanReflectiveCall.scala (renamed from library/src/main/scala/scala/scalajs/runtime/BooleanReflectiveCall.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/runtime/IntegerReflectiveCall.scala (renamed from library/src/main/scala/scala/scalajs/runtime/IntegerReflectiveCall.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/runtime/NumberReflectiveCall.scala (renamed from library/src/main/scala/scala/scalajs/runtime/NumberReflectiveCall.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/runtime/RuntimeLong.scala (renamed from library/src/main/scala/scala/scalajs/runtime/RuntimeLong.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/runtime/RuntimeString.scala (renamed from library/src/main/scala/scala/scalajs/runtime/RuntimeString.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/runtime/StackTrace.scala (renamed from library/src/main/scala/scala/scalajs/runtime/StackTrace.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/runtime/UndefinedBehaviorError.scala (renamed from library/src/main/scala/scala/scalajs/runtime/UndefinedBehaviorError.scala)0
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/runtime/package.scala (renamed from library/src/main/scala/scala/scalajs/runtime/package.scala)0
-rw-r--r--examples/scala-js/no-ir-check-test/src/test/scala/scala/scalajs/testsuite/noircheck/DummyParentsTest.scala (renamed from no-ir-check-test/src/test/scala/scala/scalajs/testsuite/noircheck/DummyParentsTest.scala)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/BlacklistedTests.txt (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/BlacklistedTests.txt)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/BuglistedTests.txt (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/BuglistedTests.txt)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/NoDCEWarn.txt (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/NoDCEWarn.txt)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/WhitelistedTests.txt (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/WhitelistedTests.txt)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/neg/t7494-no-options.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/neg/t7494-no-options.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-01.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-01.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-02.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-02.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-04.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-04.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-08.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-08.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-09.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-09.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-10.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-10.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/bugs.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/bugs.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/dynamic-anyval.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/dynamic-anyval.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/impconvtimes.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/impconvtimes.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/imports.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/imports.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/issue192.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/issue192.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-static.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-static.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-toplevel.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-toplevel.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-whitebox-decl.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-whitebox-decl.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/misc.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/misc.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/promotion.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/promotion.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/runtime.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/runtime.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/spec-self.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/spec-self.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/structural.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/structural.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t0421-new.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t0421-new.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t0421-old.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t0421-old.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t1503.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t1503.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t3702.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t3702.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t4148.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t4148.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t4617.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t4617.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5552.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5552.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5568.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5568.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5629b.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5629b.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5680.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5680.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5866.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5866.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6102.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6102.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6318_primitives.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6318_primitives.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6662.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6662.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t7657.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t7657.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t7763.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t7763.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/try-catch-unify.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/try-catch-unify.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/virtpatmat_switch.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/virtpatmat_switch.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/virtpatmat_typetag.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/virtpatmat_typetag.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/BlacklistedTests.txt (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/BlacklistedTests.txt)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/BuglistedTests.txt (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/BuglistedTests.txt)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/NoDCEWarn.txt (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/NoDCEWarn.txt)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/WhitelistedTests.txt (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/WhitelistedTests.txt)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/neg/t7494-no-options.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/neg/t7494-no-options.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-01.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-01.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-02.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-02.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-04.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-04.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-08.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-08.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-09.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-09.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-10.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-10.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/bugs.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/bugs.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/dynamic-anyval.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/dynamic-anyval.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/impconvtimes.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/impconvtimes.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/imports.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/imports.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/issue192.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/issue192.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-static.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-static.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-toplevel.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-toplevel.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-whitebox-decl.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-whitebox-decl.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/misc.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/misc.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/promotion.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/promotion.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/runtime.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/runtime.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/spec-self.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/spec-self.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/structural.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/structural.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t0421-new.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t0421-new.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t0421-old.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t0421-old.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t1503.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t1503.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t3702.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t3702.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t4148.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t4148.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t4617.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t4617.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5552.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5552.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5568.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5568.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5629b.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5629b.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5680.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5680.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5866.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5866.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6102.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6102.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6318_primitives.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6318_primitives.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6662.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6662.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t7657.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t7657.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t7763.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t7763.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t8570a.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t8570a.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/try-catch-unify.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/try-catch-unify.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/virtpatmat_switch.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/virtpatmat_switch.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/virtpatmat_typetag.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/virtpatmat_typetag.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/BlacklistedTests.txt (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/BlacklistedTests.txt)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/BuglistedTests.txt (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/BuglistedTests.txt)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/NoDCEWarn.txt (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/NoDCEWarn.txt)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/WhitelistedTests.txt (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/WhitelistedTests.txt)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/neg/t7494-no-options.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/neg/t7494-no-options.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-01.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-01.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-02.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-02.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-04.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-04.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-08.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-08.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-09.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-09.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-10.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-10.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/bugs.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/bugs.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/dynamic-anyval.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/dynamic-anyval.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/impconvtimes.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/impconvtimes.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/imports.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/imports.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/issue192.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/issue192.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-static.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-static.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-toplevel.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-toplevel.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-whitebox-decl.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-whitebox-decl.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/misc.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/misc.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/promotion.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/promotion.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/runtime.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/runtime.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/spec-self.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/spec-self.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/structural.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/structural.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t0421-new.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t0421-new.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t0421-old.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t0421-old.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t1503.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t1503.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t3702.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t3702.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t4148.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t4148.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t4617.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t4617.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5552.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5552.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5568.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5568.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5629b.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5629b.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5680.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5680.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5866.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5866.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6102.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6102.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6318_primitives.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6318_primitives.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6662.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6662.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t7657.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t7657.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t7763.sem (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t7763.sem)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t8570a.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t8570a.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/try-catch-unify.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/try-catch-unify.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/virtpatmat_switch.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/virtpatmat_switch.check)0
-rw-r--r--examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/virtpatmat_typetag.check (renamed from partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/virtpatmat_typetag.check)0
-rw-r--r--examples/scala-js/partest/src/main/scala/scala/tools/nsc/MainGenericRunner.scala (renamed from partest/src/main/scala/scala/tools/nsc/MainGenericRunner.scala)0
-rw-r--r--examples/scala-js/partest/src/main/scala/scala/tools/partest/scalajs/PartestInterface.scala (renamed from partest/src/main/scala/scala/tools/partest/scalajs/PartestInterface.scala)0
-rw-r--r--examples/scala-js/partest/src/main/scala/scala/tools/partest/scalajs/ScalaJSPartest.scala (renamed from partest/src/main/scala/scala/tools/partest/scalajs/ScalaJSPartest.scala)0
-rw-r--r--examples/scala-js/partest/src/main/scala/scala/tools/partest/scalajs/ScalaJSPartestOptions.scala (renamed from partest/src/main/scala/scala/tools/partest/scalajs/ScalaJSPartestOptions.scala)0
-rw-r--r--examples/scala-js/project/ExternalCompile.scala (renamed from project/ExternalCompile.scala)0
-rw-r--r--examples/scala-js/project/JavaLangObject.scala (renamed from project/JavaLangObject.scala)0
-rw-r--r--examples/scala-js/project/JavaLangString.scala (renamed from project/JavaLangString.scala)0
-rw-r--r--examples/scala-js/project/ScalaJSBuild.scala (renamed from project/ScalaJSBuild.scala)0
-rw-r--r--examples/scala-js/project/build.properties (renamed from sbt-plugin-test/project/build.properties)0
-rw-r--r--examples/scala-js/project/build.sbt48
-rw-r--r--examples/scala-js/project/project/ScalaJSEnvGenerator.scala (renamed from project/project/ScalaJSEnvGenerator.scala)0
-rw-r--r--examples/scala-js/sbt-plugin-test/README.md (renamed from sbt-plugin-test/README.md)0
-rw-r--r--examples/scala-js/sbt-plugin-test/build.sbt (renamed from sbt-plugin-test/build.sbt)0
-rw-r--r--examples/scala-js/sbt-plugin-test/jetty9/src/main/resources/test.txt (renamed from sbt-plugin-test/jetty9/src/main/resources/test.txt)0
-rw-r--r--examples/scala-js/sbt-plugin-test/noDOM/src/main/scala/sbttest/noDOM/Lib.scala (renamed from sbt-plugin-test/noDOM/src/main/scala/sbttest/noDOM/Lib.scala)0
-rw-r--r--examples/scala-js/sbt-plugin-test/noDOM/src/main/scala/sbttest/noDOM/TestApp.scala (renamed from sbt-plugin-test/noDOM/src/main/scala/sbttest/noDOM/TestApp.scala)0
-rw-r--r--examples/scala-js/sbt-plugin-test/noDOM/src/test/scala/sbttest/noDOM/LibTest.scala (renamed from sbt-plugin-test/noDOM/src/test/scala/sbttest/noDOM/LibTest.scala)0
-rw-r--r--examples/scala-js/sbt-plugin-test/project/Jetty9Test.scala (renamed from sbt-plugin-test/project/Jetty9Test.scala)0
-rw-r--r--examples/scala-js/sbt-plugin-test/project/build.properties1
-rw-r--r--examples/scala-js/sbt-plugin-test/project/build.sbt (renamed from sbt-plugin-test/project/build.sbt)0
-rw-r--r--examples/scala-js/sbt-plugin-test/project/project/build.sbt (renamed from sbt-plugin-test/project/project/build.sbt)0
-rw-r--r--examples/scala-js/sbt-plugin-test/withDOM/src/main/scala/sbttest/withDOM/Lib.scala (renamed from sbt-plugin-test/withDOM/src/main/scala/sbttest/withDOM/Lib.scala)0
-rw-r--r--examples/scala-js/sbt-plugin-test/withDOM/src/main/scala/sbttest/withDOM/TestApp.scala (renamed from sbt-plugin-test/withDOM/src/main/scala/sbttest/withDOM/TestApp.scala)0
-rw-r--r--examples/scala-js/sbt-plugin-test/withDOM/src/test/scala/sbttest/withDOM/LibTest.scala (renamed from sbt-plugin-test/withDOM/src/test/scala/sbttest/withDOM/LibTest.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/AbstractJSDeps.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/AbstractJSDeps.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/Implicits.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/Implicits.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/JSUtils.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/JSUtils.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/LoggerJSConsole.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/LoggerJSConsole.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/OptimizerOptions.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/OptimizerOptions.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSCrossVersion.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSCrossVersion.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSPlugin.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSPlugin.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSPluginInternal.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSPluginInternal.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/Stage.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/Stage.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/ExternalJSEnv.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/ExternalJSEnv.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/VirtualFileMaterializer.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/VirtualFileMaterializer.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/nodejs/NodeJSEnv.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/nodejs/NodeJSEnv.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/JettyWebsocketManager.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/JettyWebsocketManager.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/PhantomJSEnv.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/PhantomJSEnv.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/PhantomJettyClassLoader.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/PhantomJettyClassLoader.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/WebsocketListener.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/WebsocketListener.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/WebsocketManager.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/WebsocketManager.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/LazyScalaJSScope.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/LazyScalaJSScope.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/RhinoJSEnv.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/RhinoJSEnv.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/ScalaJSCoreLib.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/ScalaJSCoreLib.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/package.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/package.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/impl/DependencyBuilders.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/impl/DependencyBuilders.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/Events.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/Events.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/JSClasspathLoader.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/JSClasspathLoader.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/SbtTestLoggerAccWrapper.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/SbtTestLoggerAccWrapper.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestException.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestException.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestFramework.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestFramework.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestOutputConsole.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestOutputConsole.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestRunner.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestRunner.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestTask.scala (renamed from sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestTask.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/AsyncTests.scala (renamed from sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/AsyncTests.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/ComTests.scala (renamed from sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/ComTests.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/JSEnvTest.scala (renamed from sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/JSEnvTest.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/NodeJSTest.scala (renamed from sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/NodeJSTest.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/PhantomJSTest.scala (renamed from sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/PhantomJSTest.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/RhinoJSEnvTest.scala (renamed from sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/RhinoJSEnvTest.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/StoreJSConsole.scala (renamed from sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/StoreJSConsole.scala)0
-rw-r--r--examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/StoreLogger.scala (renamed from sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/StoreLogger.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides-2.10/scala/Console.scala (renamed from scalalib/overrides-2.10/scala/Console.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides-2.10/scala/collection/immutable/NumericRange.scala (renamed from scalalib/overrides-2.10/scala/collection/immutable/NumericRange.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides-2.10/scala/collection/immutable/Range.scala (renamed from scalalib/overrides-2.10/scala/collection/immutable/Range.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides-2.10/scala/collection/mutable/Buffer.scala (renamed from scalalib/overrides-2.10/scala/collection/mutable/Buffer.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides-2.10/scala/compat/Platform.scala (renamed from scalalib/overrides-2.10/scala/compat/Platform.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides-2.10/scala/package.scala (renamed from scalalib/overrides-2.10/scala/package.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides-2.11/scala/Console.scala (renamed from scalalib/overrides-2.11/scala/Console.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides-2.11/scala/collection/immutable/NumericRange.scala (renamed from scalalib/overrides-2.11/scala/collection/immutable/NumericRange.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides-2.11/scala/collection/immutable/Range.scala (renamed from scalalib/overrides-2.11/scala/collection/immutable/Range.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides-2.11/scala/collection/mutable/Buffer.scala (renamed from scalalib/overrides-2.11/scala/collection/mutable/Buffer.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides-2.11/scala/compat/Platform.scala (renamed from scalalib/overrides-2.11/scala/compat/Platform.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides-2.11/scala/package.scala (renamed from scalalib/overrides-2.11/scala/package.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides/scala/App.scala (renamed from scalalib/overrides/scala/App.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides/scala/Enumeration.scala (renamed from scalalib/overrides/scala/Enumeration.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides/scala/Symbol.scala (renamed from scalalib/overrides/scala/Symbol.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides/scala/concurrent/impl/AbstractPromise.scala (renamed from scalalib/overrides/scala/concurrent/impl/AbstractPromise.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides/scala/math/ScalaNumber.scala (renamed from scalalib/overrides/scala/math/ScalaNumber.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides/scala/runtime/BoxesRunTime.scala (renamed from scalalib/overrides/scala/runtime/BoxesRunTime.scala)0
-rw-r--r--examples/scala-js/scalalib/overrides/scala/util/control/NoStackTrace.scala (renamed from scalalib/overrides/scala/util/control/NoStackTrace.scala)0
-rwxr-xr-xexamples/scala-js/scripts/assemble-cli.sh (renamed from scripts/assemble-cli.sh)0
-rwxr-xr-xexamples/scala-js/scripts/build-all-js.sh (renamed from scripts/build-all-js.sh)0
-rwxr-xr-xexamples/scala-js/scripts/publish-to-bintray.sh (renamed from scripts/publish-to-bintray.sh)0
-rw-r--r--examples/scala-js/stubs/src/main/scala/scala/scalajs/js/annotation/ExportAnnotations.scala (renamed from stubs/src/main/scala/scala/scalajs/js/annotation/ExportAnnotations.scala)0
-rw-r--r--examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/Test.scala (renamed from test-bridge/src/main/scala/scala/scalajs/testbridge/Test.scala)0
-rw-r--r--examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/TestFramework.scala (renamed from test-bridge/src/main/scala/scala/scalajs/testbridge/TestFramework.scala)0
-rw-r--r--examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/TestOutput.scala (renamed from test-bridge/src/main/scala/scala/scalajs/testbridge/TestOutput.scala)0
-rw-r--r--examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/TestOutputLog.scala (renamed from test-bridge/src/main/scala/scala/scalajs/testbridge/TestOutputLog.scala)0
-rw-r--r--examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/internal/ConsoleTestOutput.scala (renamed from test-bridge/src/main/scala/scala/scalajs/testbridge/internal/ConsoleTestOutput.scala)0
-rw-r--r--examples/scala-js/test-suite/run-jasmine-tests.js (renamed from test-suite/run-jasmine-tests.js)0
-rw-r--r--examples/scala-js/test-suite/scalajs-test-suite-2.10-fastopt.html (renamed from test-suite/scalajs-test-suite-2.10-fastopt.html)0
-rw-r--r--examples/scala-js/test-suite/scalajs-test-suite-2.10.html (renamed from test-suite/scalajs-test-suite-2.10.html)0
-rw-r--r--examples/scala-js/test-suite/scalajs-test-suite-2.11-fastopt.html (renamed from test-suite/scalajs-test-suite-2.11-fastopt.html)0
-rw-r--r--examples/scala-js/test-suite/scalajs-test-suite-2.11.html (renamed from test-suite/scalajs-test-suite-2.11.html)0
-rw-r--r--examples/scala-js/test-suite/src/test/require-sam/scala/scalajs/testsuite/jsinterop/ArraySAMTest.scala (renamed from test-suite/src/test/require-sam/scala/scalajs/testsuite/jsinterop/ArraySAMTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/resources/SourceMapTestTemplate.scala (renamed from test-suite/src/test/resources/SourceMapTestTemplate.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/BooleanTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/BooleanTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ByteTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ByteTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/CharTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/CharTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/FloatTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/FloatTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/InstanceTestsHijackedBoxedClassesTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/InstanceTestsHijackedBoxedClassesTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/IntTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/IntTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/InteroperabilityTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/InteroperabilityTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/LongTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/LongTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/OptimizerTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/OptimizerTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ReflectionTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ReflectionTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ReflectiveCallTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ReflectiveCallTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/RegressionTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/RegressionTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/RuntimeTypesTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/RuntimeTypesTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ShortTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ShortTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/UnitTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/compiler/UnitTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ArraysTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ArraysTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/AtomicTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/AtomicTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/BooleanTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/BooleanTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ByteTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ByteTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/CharacterTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/CharacterTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ClassTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ClassTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/DateTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/DateTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/DoubleTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/DoubleTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/FloatTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/FloatTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/FormatterTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/FormatterTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/IntegerTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/IntegerTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/LongTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/LongTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/MathTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/MathTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/MockByteArrayOutputStream.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/MockByteArrayOutputStream.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ObjectTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ObjectTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/OutputStreamWriterTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/OutputStreamWriterTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/PrintStreamTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/PrintStreamTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/PrintWriterTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/PrintWriterTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/RandomTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/RandomTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ReadersTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ReadersTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ReferenceTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ReferenceTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/RegexTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/RegexTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ShortTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ShortTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StackTraceElementTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StackTraceElementTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StreamsTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StreamsTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StringBufferTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StringBufferTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StringTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StringTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/SystemTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/SystemTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ThrowablesTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ThrowablesTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/TimeUnitTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/TimeUnitTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/URITest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/URITest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/UUIDTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/javalib/UUIDTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ArrayTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ArrayTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/AsyncTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/AsyncTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/DictionaryTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/DictionaryTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/DynamicTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/DynamicTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ExportsTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ExportsTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/FunctionTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/FunctionTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/MiscInteropTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/MiscInteropTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/RuntimeLongTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/RuntimeLongTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/StrangeNamedTests.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/StrangeNamedTests.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ThisFunctionTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ThisFunctionTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/UndefOrTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/UndefOrTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/library/ArrayOpsTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/library/ArrayOpsTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/library/WrappedArrayTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/library/WrappedArrayTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/library/WrappedDictionaryTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/library/WrappedDictionaryTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/BaseBufferTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/BaseBufferTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/ByteBufferTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/ByteBufferTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/CharBufferTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/CharBufferTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/BaseCharsetTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/BaseCharsetTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/CharsetTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/CharsetTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/Latin1Test.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/Latin1Test.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/USASCIITest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/USASCIITest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/UTF16Test.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/UTF16Test.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/UTF8Test.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/UTF8Test.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/EnumerationTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/EnumerationTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/RangesTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/RangesTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/SymbolTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/SymbolTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArrayBufferInputStreamTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArrayBufferInputStreamTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArrayBufferTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArrayBufferTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArraysTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArraysTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/DataViewTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/DataViewTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/TypedArrayConversionTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/TypedArrayConversionTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/TypedArrayTest.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/TypedArrayTest.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/utils/JSUtils.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/utils/JSUtils.scala)0
-rw-r--r--examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/utils/TestDetector.scala (renamed from test-suite/src/test/scala/scala/scalajs/testsuite/utils/TestDetector.scala)0
-rw-r--r--examples/scala-js/tools/js/src/main/scala/scala/scalajs/tools/classpath/builder/NodeFileSystem.scala (renamed from tools/js/src/main/scala/scala/scalajs/tools/classpath/builder/NodeFileSystem.scala)0
-rw-r--r--examples/scala-js/tools/js/src/main/scala/scala/scalajs/tools/io/NodeVirtualFiles.scala (renamed from tools/js/src/main/scala/scala/scalajs/tools/io/NodeVirtualFiles.scala)0
-rw-r--r--examples/scala-js/tools/js/src/main/scala/scala/scalajs/tools/json/Impl.scala (renamed from tools/js/src/main/scala/scala/scalajs/tools/json/Impl.scala)0
-rw-r--r--examples/scala-js/tools/js/src/test/scala/scala/scalajs/tools/js/test/JasmineReporter.scala (renamed from tools/js/src/test/scala/scala/scalajs/tools/js/test/JasmineReporter.scala)0
-rw-r--r--examples/scala-js/tools/js/src/test/scala/scala/scalajs/tools/js/test/QuickLinker.scala (renamed from tools/js/src/test/scala/scala/scalajs/tools/js/test/QuickLinker.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/JarLibClasspathBuilder.scala (renamed from tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/JarLibClasspathBuilder.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/PartialClasspathBuilder.scala (renamed from tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/PartialClasspathBuilder.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/PhysicalFileSystem.scala (renamed from tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/PhysicalFileSystem.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/io/FileVirtualFiles.scala (renamed from tools/jvm/src/main/scala/scala/scalajs/tools/io/FileVirtualFiles.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/json/Impl.scala (renamed from tools/jvm/src/main/scala/scala/scalajs/tools/json/Impl.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ClosureAstBuilder.scala (renamed from tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ClosureAstBuilder.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ClosureAstTransformer.scala (renamed from tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ClosureAstTransformer.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ConcurrencyUtils.scala (renamed from tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ConcurrencyUtils.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/LoggerErrorManager.scala (renamed from tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/LoggerErrorManager.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ParIncOptimizer.scala (renamed from tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ParIncOptimizer.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ScalaJSClosureOptimizer.scala (renamed from tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ScalaJSClosureOptimizer.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/sourcemap/SourceMapper.scala (renamed from tools/jvm/src/main/scala/scala/scalajs/tools/sourcemap/SourceMapper.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/test/resources/test.jar (renamed from tools/jvm/src/test/resources/test.jar)0
-rw-r--r--examples/scala-js/tools/jvm/src/test/scala/scala/scalajs/tools/classpath/builder/test/ClasspathElementsTraverserTest.scala (renamed from tools/jvm/src/test/scala/scala/scalajs/tools/classpath/builder/test/ClasspathElementsTraverserTest.scala)0
-rw-r--r--examples/scala-js/tools/jvm/src/test/scala/scala/scalajs/tools/classpath/builder/test/JarBuilderTest.scala (renamed from tools/jvm/src/test/scala/scala/scalajs/tools/classpath/builder/test/JarBuilderTest.scala)0
-rw-r--r--examples/scala-js/tools/scalajsenv.js (renamed from tools/scalajsenv.js)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/CompleteClasspath.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/CompleteClasspath.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/ComplianceRequirement.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/ComplianceRequirement.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/Exceptions.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/Exceptions.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/IRClasspath.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/IRClasspath.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/LinkedClasspath.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/LinkedClasspath.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/PartialClasspath.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/PartialClasspath.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/ResolvedJSDependency.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/ResolvedJSDependency.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/AbstractJarLibClasspathBuilder.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/AbstractJarLibClasspathBuilder.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/AbstractPartialClasspathBuilder.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/AbstractPartialClasspathBuilder.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/ClasspathContentHandler.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/ClasspathContentHandler.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/ClasspathElementsTraverser.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/ClasspathElementsTraverser.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/DirTraverser.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/DirTraverser.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/FileSystem.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/FileSystem.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/JarTraverser.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/JarTraverser.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/corelib/CoreJSLibs.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/corelib/CoreJSLibs.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/AsyncJSEnv.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/env/AsyncJSEnv.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/AsyncJSRunner.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/env/AsyncJSRunner.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/ComJSEnv.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/env/ComJSEnv.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/ComJSRunner.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/env/ComJSRunner.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/ConsoleJSConsole.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/env/ConsoleJSConsole.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/JSConsole.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/env/JSConsole.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/JSEnv.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/env/JSEnv.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/JSRunner.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/env/JSRunner.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/NullJSConsole.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/env/NullJSConsole.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/io/CacheUtils.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/io/CacheUtils.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/io/IO.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/io/IO.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/io/MemFiles.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/io/MemFiles.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/io/VirtualFiles.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/io/VirtualFiles.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/JSDesugaring.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/javascript/JSDesugaring.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/LongImpl.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/javascript/LongImpl.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/Printers.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/javascript/Printers.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/ScalaJSClassEmitter.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/javascript/ScalaJSClassEmitter.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/TreeDSL.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/javascript/TreeDSL.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/Trees.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/javascript/Trees.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/Exceptions.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/jsdep/Exceptions.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/FlatJSDependency.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/jsdep/FlatJSDependency.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/JSDependency.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/jsdep/JSDependency.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/JSDependencyManifest.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/jsdep/JSDependencyManifest.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/Origin.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/jsdep/Origin.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/ResolutionInfo.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/jsdep/ResolutionInfo.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/AbstractJSONImpl.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/json/AbstractJSONImpl.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONDeserializer.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/json/JSONDeserializer.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONObjBuilder.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/json/JSONObjBuilder.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONObjExtractor.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/json/JSONObjExtractor.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONSerializer.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/json/JSONSerializer.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/package.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/json/package.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/logging/Level.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/logging/Level.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/logging/Logger.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/logging/Logger.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/logging/NullLogger.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/logging/NullLogger.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/logging/ScalaConsoleLogger.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/logging/ScalaConsoleLogger.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/Analyzer.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/optimizer/Analyzer.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/GenIncOptimizer.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/optimizer/GenIncOptimizer.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/IRChecker.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/optimizer/IRChecker.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/IncOptimizer.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/optimizer/IncOptimizer.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/JSTreeBuilder.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/optimizer/JSTreeBuilder.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/OptimizerCore.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/optimizer/OptimizerCore.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/ScalaJSOptimizer.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/optimizer/ScalaJSOptimizer.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/sem/CheckedBehavior.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/sem/CheckedBehavior.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/sem/Semantics.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/sem/Semantics.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/sourcemap/JSFileBuilder.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/sourcemap/JSFileBuilder.scala)0
-rw-r--r--examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/sourcemap/SourceMapWriter.scala (renamed from tools/shared/src/main/scala/scala/scalajs/tools/sourcemap/SourceMapWriter.scala)0
-rw-r--r--examples/workbench-example-app/.gitignore5
-rw-r--r--examples/workbench-example-app/README.md39
-rw-r--r--examples/workbench-example-app/build.sbt21
-rw-r--r--examples/workbench-example-app/project/build.properties1
-rw-r--r--examples/workbench-example-app/project/build.sbt3
-rw-r--r--examples/workbench-example-app/src/main/resources/index-dev.html19
-rw-r--r--examples/workbench-example-app/src/main/resources/index-opt.html18
-rw-r--r--examples/workbench-example-app/src/main/scala/example/ScalaJSExample.scala43
-rw-r--r--project/build.properties2
-rw-r--r--project/build.sbt49
-rw-r--r--scalaParser/src/main/scala/scalaParser/ScalaSyntax.scala416
-rw-r--r--scalaParser/src/main/scala/scalaParser/syntax/Basic.scala51
-rw-r--r--scalaParser/src/main/scala/scalaParser/syntax/Identifiers.scala35
-rw-r--r--scalaParser/src/main/scala/scalaParser/syntax/Literals.scala58
-rw-r--r--scalaParser/src/test/scala/scalaParser/SyntaxTest.scala448
-rw-r--r--scalatexApi/src/main/scala/scalatex/package.scala98
-rw-r--r--scalatexApi/src/main/scala/scalatex/stages/Compiler.scala103
-rw-r--r--scalatexApi/src/main/scala/scalatex/stages/Parser.scala170
-rw-r--r--scalatexApi/src/main/scala/scalatex/stages/Trim.scala29
-rw-r--r--scalatexApi/src/test/scala/scalatex/AdvancedTests.scala120
-rw-r--r--scalatexApi/src/test/scala/scalatex/BasicTests.scala468
-rw-r--r--scalatexApi/src/test/scala/scalatex/ErrorTests.scala373
-rw-r--r--scalatexApi/src/test/scala/scalatex/ParserTests.scala424
-rw-r--r--scalatexApi/src/test/scala/scalatex/TestUtil.scala16
-rwxr-xr-xscalatexPlugin/src/main/resources/scalac-plugin.xml4
-rwxr-xr-xscalatexPlugin/src/main/scala/scalatex/ScalaTexPlugin.scala66
-rw-r--r--test.txt3
774 files changed, 8506 insertions, 57 deletions
diff --git a/.gitignore b/.gitignore
index 90977dc..4a67d33 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,6 @@
+/*/target/
target/
-.cache
-.classpath
-.project
-.settings/
-/scalalib/fetchedSources/
-/partest/fetchedSources/
-/cli/pack/
-/.idea/
-/.idea_modules/
+output/
+.DS_STORE
+*.iml
+.idea
diff --git a/.idea/libraries/SBT__com_chuusai_shapeless_2_11_1_2_4.xml b/.idea/libraries/SBT__com_chuusai_shapeless_2_11_1_2_4.xml
new file mode 100644
index 0000000..0ef1f4a
--- /dev/null
+++ b/.idea/libraries/SBT__com_chuusai_shapeless_2_11_1_2_4.xml
@@ -0,0 +1,13 @@
+<component name="libraryTable">
+ <library name="SBT: com.chuusai:shapeless_2.11:1.2.4">
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/com.chuusai/shapeless_2.11/jars/shapeless_2.11-1.2.4.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$USER_HOME$/.ivy2/cache/com.chuusai/shapeless_2.11/docs/shapeless_2.11-1.2.4-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/com.chuusai/shapeless_2.11/srcs/shapeless_2.11-1.2.4-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/.idea/libraries/SBT__com_typesafe_akka_akka_actor_2_11_2_3_6.xml b/.idea/libraries/SBT__com_typesafe_akka_akka_actor_2_11_2_3_6.xml
new file mode 100644
index 0000000..d697090
--- /dev/null
+++ b/.idea/libraries/SBT__com_typesafe_akka_akka_actor_2_11_2_3_6.xml
@@ -0,0 +1,13 @@
+<component name="libraryTable">
+ <library name="SBT: com.typesafe.akka:akka-actor_2.11:2.3.6">
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/com.typesafe.akka/akka-actor_2.11/jars/akka-actor_2.11-2.3.6.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$USER_HOME$/.ivy2/cache/com.typesafe.akka/akka-actor_2.11/docs/akka-actor_2.11-2.3.6-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/com.typesafe.akka/akka-actor_2.11/srcs/akka-actor_2.11-2.3.6-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/.idea/libraries/SBT__com_typesafe_config_1_2_1.xml b/.idea/libraries/SBT__com_typesafe_config_1_2_1.xml
new file mode 100644
index 0000000..6a5807f
--- /dev/null
+++ b/.idea/libraries/SBT__com_typesafe_config_1_2_1.xml
@@ -0,0 +1,14 @@
+<component name="libraryTable">
+ <library name="SBT: com.typesafe:config:1.2.1">
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/com.typesafe/config/bundles/config-1.2.1.jar!/" />
+ <root url="jar://$USER_HOME$/.ivy2/cache/com.typesafe/config/jars/config-1.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$USER_HOME$/.ivy2/cache/com.typesafe/config/docs/config-1.2.1-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/com.typesafe/config/srcs/config-1.2.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/.idea/libraries/SBT__io_spray_spray_can_2_11_1_3_2.xml b/.idea/libraries/SBT__io_spray_spray_can_2_11_1_3_2.xml
new file mode 100644
index 0000000..ba16743
--- /dev/null
+++ b/.idea/libraries/SBT__io_spray_spray_can_2_11_1_3_2.xml
@@ -0,0 +1,14 @@
+<component name="libraryTable">
+ <library name="SBT: io.spray:spray-can_2.11:1.3.2">
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-can_2.11/bundles/spray-can_2.11-1.3.2.jar!/" />
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-can_2.11/jars/spray-can_2.11-1.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-can_2.11/docs/spray-can_2.11-1.3.2-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-can_2.11/srcs/spray-can_2.11-1.3.2-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/.idea/libraries/SBT__io_spray_spray_http_2_11_1_3_2.xml b/.idea/libraries/SBT__io_spray_spray_http_2_11_1_3_2.xml
new file mode 100644
index 0000000..6882c9d
--- /dev/null
+++ b/.idea/libraries/SBT__io_spray_spray_http_2_11_1_3_2.xml
@@ -0,0 +1,14 @@
+<component name="libraryTable">
+ <library name="SBT: io.spray:spray-http_2.11:1.3.2">
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-http_2.11/jars/spray-http_2.11-1.3.2.jar!/" />
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-http_2.11/bundles/spray-http_2.11-1.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-http_2.11/docs/spray-http_2.11-1.3.2-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-http_2.11/srcs/spray-http_2.11-1.3.2-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/.idea/libraries/SBT__io_spray_spray_httpx_2_11_1_3_2.xml b/.idea/libraries/SBT__io_spray_spray_httpx_2_11_1_3_2.xml
new file mode 100644
index 0000000..52bd2f3
--- /dev/null
+++ b/.idea/libraries/SBT__io_spray_spray_httpx_2_11_1_3_2.xml
@@ -0,0 +1,14 @@
+<component name="libraryTable">
+ <library name="SBT: io.spray:spray-httpx_2.11:1.3.2">
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-httpx_2.11/jars/spray-httpx_2.11-1.3.2.jar!/" />
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-httpx_2.11/bundles/spray-httpx_2.11-1.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-httpx_2.11/docs/spray-httpx_2.11-1.3.2-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-httpx_2.11/srcs/spray-httpx_2.11-1.3.2-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/.idea/libraries/SBT__io_spray_spray_io_2_11_1_3_2.xml b/.idea/libraries/SBT__io_spray_spray_io_2_11_1_3_2.xml
new file mode 100644
index 0000000..5e6ac51
--- /dev/null
+++ b/.idea/libraries/SBT__io_spray_spray_io_2_11_1_3_2.xml
@@ -0,0 +1,14 @@
+<component name="libraryTable">
+ <library name="SBT: io.spray:spray-io_2.11:1.3.2">
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-io_2.11/bundles/spray-io_2.11-1.3.2.jar!/" />
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-io_2.11/jars/spray-io_2.11-1.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-io_2.11/docs/spray-io_2.11-1.3.2-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-io_2.11/srcs/spray-io_2.11-1.3.2-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/.idea/libraries/SBT__io_spray_spray_routing_2_11_1_3_2.xml b/.idea/libraries/SBT__io_spray_spray_routing_2_11_1_3_2.xml
new file mode 100644
index 0000000..070e877
--- /dev/null
+++ b/.idea/libraries/SBT__io_spray_spray_routing_2_11_1_3_2.xml
@@ -0,0 +1,14 @@
+<component name="libraryTable">
+ <library name="SBT: io.spray:spray-routing_2.11:1.3.2">
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-routing_2.11/jars/spray-routing_2.11-1.3.2.jar!/" />
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-routing_2.11/bundles/spray-routing_2.11-1.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-routing_2.11/docs/spray-routing_2.11-1.3.2-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-routing_2.11/srcs/spray-routing_2.11-1.3.2-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/.idea/libraries/SBT__io_spray_spray_util_2_11_1_3_2.xml b/.idea/libraries/SBT__io_spray_spray_util_2_11_1_3_2.xml
new file mode 100644
index 0000000..4eb7798
--- /dev/null
+++ b/.idea/libraries/SBT__io_spray_spray_util_2_11_1_3_2.xml
@@ -0,0 +1,14 @@
+<component name="libraryTable">
+ <library name="SBT: io.spray:spray-util_2.11:1.3.2">
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-util_2.11/bundles/spray-util_2.11-1.3.2.jar!/" />
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-util_2.11/jars/spray-util_2.11-1.3.2.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-util_2.11/docs/spray-util_2.11-1.3.2-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/io.spray/spray-util_2.11/srcs/spray-util_2.11-1.3.2-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/.idea/libraries/SBT__org_jvnet_mimepull_mimepull_1_9_4.xml b/.idea/libraries/SBT__org_jvnet_mimepull_mimepull_1_9_4.xml
new file mode 100644
index 0000000..7fcd3a6
--- /dev/null
+++ b/.idea/libraries/SBT__org_jvnet_mimepull_mimepull_1_9_4.xml
@@ -0,0 +1,13 @@
+<component name="libraryTable">
+ <library name="SBT: org.jvnet.mimepull:mimepull:1.9.4">
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/org.jvnet.mimepull/mimepull/jars/mimepull-1.9.4.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$USER_HOME$/.ivy2/cache/org.jvnet.mimepull/mimepull/docs/mimepull-1.9.4-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/org.jvnet.mimepull/mimepull/srcs/mimepull-1.9.4-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/.idea/libraries/SBT__org_parboiled_parboiled_core_1_1_6.xml b/.idea/libraries/SBT__org_parboiled_parboiled_core_1_1_6.xml
new file mode 100644
index 0000000..8cf44a6
--- /dev/null
+++ b/.idea/libraries/SBT__org_parboiled_parboiled_core_1_1_6.xml
@@ -0,0 +1,14 @@
+<component name="libraryTable">
+ <library name="SBT: org.parboiled:parboiled-core:1.1.6">
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/org.parboiled/parboiled-core/jars/parboiled-core-1.1.6.jar!/" />
+ <root url="jar://$USER_HOME$/.ivy2/cache/org.parboiled/parboiled-core/bundles/parboiled-core-1.1.6.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$USER_HOME$/.ivy2/cache/org.parboiled/parboiled-core/docs/parboiled-core-1.1.6-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/org.parboiled/parboiled-core/srcs/parboiled-core-1.1.6-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/.idea/libraries/SBT__org_parboiled_parboiled_scala_2_11_1_1_6.xml b/.idea/libraries/SBT__org_parboiled_parboiled_scala_2_11_1_1_6.xml
new file mode 100644
index 0000000..fd53a7a
--- /dev/null
+++ b/.idea/libraries/SBT__org_parboiled_parboiled_scala_2_11_1_1_6.xml
@@ -0,0 +1,14 @@
+<component name="libraryTable">
+ <library name="SBT: org.parboiled:parboiled-scala_2.11:1.1.6">
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/org.parboiled/parboiled-scala_2.11/bundles/parboiled-scala_2.11-1.1.6.jar!/" />
+ <root url="jar://$USER_HOME$/.ivy2/cache/org.parboiled/parboiled-scala_2.11/jars/parboiled-scala_2.11-1.1.6.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$USER_HOME$/.ivy2/cache/org.parboiled/parboiled-scala_2.11/docs/parboiled-scala_2.11-1.1.6-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.ivy2/cache/org.parboiled/parboiled-scala_2.11/srcs/parboiled-scala_2.11-1.1.6-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/book/src/main/resources/css/side-menu.css b/book/src/main/resources/css/side-menu.css
new file mode 100755
index 0000000..b8e36c6
--- /dev/null
+++ b/book/src/main/resources/css/side-menu.css
@@ -0,0 +1,338 @@
+body {
+ color: #777;
+}
+*{
+ position: relative;
+}
+p{
+ text-align: justify;
+}
+#main{
+ position: fixed;
+ max-width: 100%;
+ right: 0px;
+ left: 0px;
+ height: 100%;
+ overflow-y: scroll
+}
+.pure-img-responsive {
+ max-width: 100%;
+ height: auto;
+}
+
+/*
+Add transition to containers so they can push in and out.
+*/
+#layout,
+#menu,
+.menu-link,{
+ -webkit-transition: all 0.2s ease-out;
+ -moz-transition: all 0.2s ease-out;
+ -ms-transition: all 0.2s ease-out;
+ -o-transition: all 0.2s ease-out;
+ transition: all 0.2s ease-out;
+}
+
+/*
+This is the parent `<div>` that contains the menu and the content area.
+*/
+#layout {
+ position: relative;
+ padding-left: 0;
+}
+ #layout.active {
+ position: relative;
+ left: 250px;
+ }
+ #layout.active #menu {
+ left: 250px;
+ width: 250px;
+ }
+
+ #layout.active .menu-link {
+ left: 250px;
+ }
+/*
+The content `<div>` is where all your content goes.
+*/
+.content {
+ margin: 0 auto;
+ padding: 0 2em;
+ max-width: 800px;
+ margin-bottom: 50px;
+ line-height: 1.6em;
+}
+
+.header {
+ margin: 0;
+ color: #333;
+ text-align: center;
+ padding: 2.5em 2em 0;
+ border-bottom: 1px solid #eee;
+ }
+ .header h1 {
+ margin: 0.2em 0;
+ font-size: 3em;
+ font-weight: 300;
+ }
+ .header h2 {
+ font-weight: 300;
+ color: #ccc;
+ padding: 0;
+ margin-top: 0;
+ }
+
+.content-subhead {
+ margin: 50px 0 20px 0;
+ font-weight: 300;
+ color: #888;
+}
+
+
+
+/*
+The `#menu` `<div>` is the parent `<div>` that contains the `.pure-menu` that
+appears on the left side of the page.
+*/
+
+#menu {
+ margin-left: -250px; /* "#menu" width */
+ width: 250px;
+ position: fixed;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ z-index: 1000; /* so the menu or its navicon stays above all content */
+ background: #191818;
+ overflow-y: auto;
+ overflow-x: hidden;
+ -webkit-overflow-scrolling: touch;
+}
+ /*
+ All anchors inside the menu should be styled like this.
+ */
+ #menu a {
+ color: #999;
+ border: none;
+ padding: 0.6em 0 0.6em 0.6em;
+ }
+
+ /*
+ Remove all background/borders, since we are applying them to #menu.
+ */
+ #menu .pure-menu,
+ #menu .pure-menu ul {
+ border: none;
+ background: transparent;
+ }
+
+ /*
+ Add that light border to separate items into groups.
+ */
+ #menu .pure-menu ul,
+ #menu .pure-menu .menu-item-divided {
+ border-top: 1px solid #333;
+ }
+ /*
+ Change color of the anchor links on hover/focus.
+ */
+ #menu .pure-menu li a:hover,
+ #menu .pure-menu li a:focus {
+ background: #333;
+ }
+
+ /*
+ This styles the selected menu item `<li>`.
+ */
+ #menu .pure-menu-selected,
+ #menu .pure-menu-heading {
+ background: #1f8dd6;
+ }
+ /*
+ This styles a link within a selected menu item `<li>`.
+ */
+ #menu .pure-menu-selected {
+ color: #fff;
+ }
+
+ /*
+ This styles the menu heading.
+ */
+ #menu .pure-menu-heading {
+ font-size: 110%;
+ color: #fff;
+ margin: 0;
+ }
+
+/* -- Dynamic Button For Responsive Menu -------------------------------------*/
+
+/*
+The button to open/close the Menu is custom-made and not part of Pure. Here's
+how it works:
+*/
+
+/*
+`.menu-link` represents the responsive menu toggle that shows/hides on
+small screens.
+*/
+.menu-link {
+ position: fixed;
+ display: block; /* show this only on small screens */
+ top: 0;
+ left: 0; /* "#menu width" */
+ background: #000;
+ background: rgba(0,0,0,0.7);
+ font-size: 10px; /* change this value to increase/decrease button size */
+ z-index: 10;
+ width: 2em;
+ height: auto;
+ padding: 2.1em 1.6em;
+}
+
+ .menu-link:hover,
+ .menu-link:focus {
+ background: #000;
+ }
+
+ .menu-link span {
+ position: relative;
+ display: block;
+ }
+
+ .menu-link span,
+ .menu-link span:before,
+ .menu-link span:after {
+ background-color: #fff;
+ width: 100%;
+ height: 0.2em;
+ }
+
+ .menu-link span:before,
+ .menu-link span:after {
+ position: absolute;
+ margin-top: -0.6em;
+ content: " ";
+ }
+
+ .menu-link span:after {
+ margin-top: 0.6em;
+ }
+
+
+/* -- Responsive Styles (Media Queries) ------------------------------------- */
+
+/*
+Hides the menu at `48em`, but modify this based on your app's needs.
+*/
+@media (min-width: 72em) {
+
+ .header,
+ .content {
+ padding-left: 2em;
+ padding-right: 2em;
+ }
+
+ #layout {
+ padding-left: 250px; /* left col width "#menu" */
+ left: 0;
+ }
+ #main{
+ left: 250px;
+ }
+ #menu {
+ left: 250px;
+ }
+
+ .menu-link {
+ position: fixed;
+ left: 250px;
+ display: none;
+ }
+
+ #layout.active .menu-link {
+ left: 250px;
+ }
+}
+/* Custom Stuff */
+a:link {
+ color: #479;
+ text-decoration: none;
+}
+a:visited {
+ color: #858;
+ text-decoration: none;
+}
+a:hover {
+ text-decoration: underline;
+}
+a:active {
+ color: #000;
+ text-decoration: underline;
+}
+code{
+ color: #000;
+}
+.half-table{
+ width: 100%;
+}
+.half-table td{
+ width: 50%;
+}
+.half-table th{
+ width: 50%;
+}
+.header-link{
+ position: absolute;
+ right: 0px;
+}
+*:hover > .header-link:hover{
+ opacity: 1.0;
+}
+*:hover > .header-link:active{
+ opacity: 0.75;
+}
+*:hover > .header-link{
+ text-align: right;
+ text-decoration: none;
+ opacity: 0.5;
+}
+.header-link > i{
+ color: #777;
+}
+.header-link{
+ opacity: 0.05;
+}
+.collapsed.menu-item-list li.hide > ul{
+ opacity: 1;
+ overflow: hidden;
+ height: 0px;
+}
+.collapsed.menu-item-list li > ul{
+ opacity: 1;
+ overflow: hidden;
+}
+
+#menu .collapsed.menu-item-list li.selected > a{
+ border-left: 2px solid white;
+}
+
+.menu-item-list li > a{
+ -webkit-transition: background-color 0.2s ease-out;
+ -moz-transition: background-color 0.2s ease-out;
+ -ms-transition: background-color 0.2s ease-out;
+ -o-transition: background-color 0.2s ease-out;
+ transition: background-color 0.2s ease-out;
+}
+
+/*Override stuff from pure =/ it's not doing what I want*/
+.pure-menu li > ul{
+ position:relative;
+ visibility:visible;
+ left: 0px;
+ top: 0px;
+}
+
+/*Workaround for bug in highlight.js IDEA theme*/
+span.hljs-tag, span.hljs-symbol{
+ background: none;
+}
diff --git a/book/src/main/resources/favicon.png b/book/src/main/resources/favicon.png
new file mode 100644
index 0000000..ba64ad2
--- /dev/null
+++ b/book/src/main/resources/favicon.png
Binary files differ
diff --git a/book/src/main/resources/favicon.svg b/book/src/main/resources/favicon.svg
new file mode 100644
index 0000000..2f1181f
--- /dev/null
+++ b/book/src/main/resources/favicon.svg
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 17.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="64px" height="64px" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve">
+<line fill="none" stroke="#006400" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="34.833" y1="26.833" x2="41.833" y2="36"/>
+<line fill="none" stroke="#006400" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="48.833" y1="26.833" x2="41.833" y2="36"/>
+<line fill="none" stroke="#006400" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="48.833" y1="26.833" x2="55.833" y2="36"/>
+<line fill="none" stroke="#006400" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="62.833" y1="26.833" x2="55.833" y2="36"/>
+<line fill="none" stroke="#FF0000" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="34.833" y1="7.833" x2="41.833" y2="17"/>
+<line fill="none" stroke="#FF0000" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="48.833" y1="7.833" x2="41.833" y2="17"/>
+<line fill="none" stroke="#FF0000" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="48.833" y1="7.833" x2="55.833" y2="17"/>
+<line fill="none" stroke="#FF0000" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="62.833" y1="7.833" x2="55.833" y2="17"/>
+<line fill="none" stroke="#0000FF" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="34.833" y1="46.833" x2="41.833" y2="56"/>
+<line fill="none" stroke="#0000FF" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="48.833" y1="46.833" x2="41.833" y2="56"/>
+<line fill="none" stroke="#0000FF" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="48.833" y1="46.833" x2="55.833" y2="56"/>
+<line fill="none" stroke="#0000FF" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="62.833" y1="46.833" x2="55.833" y2="56"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="0" y1="9.5" x2="3" y2="9.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="0" y1="18.5" x2="3" y2="18.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="0" y1="36.5" x2="3" y2="36.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="0" y1="45.5" x2="3" y2="45.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="0" y1="54.5" x2="3" y2="54.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="7" y1="54.5" x2="10" y2="54.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="15" y1="54.5" x2="18" y2="54.5"/>
+<line fill="none" stroke="#0000FF" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="24" y1="54.5" x2="27" y2="54.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="5" y1="45.5" x2="8" y2="45.5"/>
+<line fill="none" stroke="#0000FF" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="5" y1="36.5" x2="8" y2="36.5"/>
+<line fill="none" stroke="#0000FF" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="18" y1="36.5" x2="20" y2="36.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="12" y1="36.5" x2="16" y2="36.5"/>
+<line fill="none" stroke="#0000FF" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="20" y1="9.5" x2="23" y2="9.5"/>
+<line fill="none" stroke="#0000FF" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="4" y1="9.5" x2="6" y2="9.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="7" y1="9.5" x2="10" y2="9.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="12" y1="9.5" x2="16" y2="9.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="18" y1="9.5" x2="20" y2="9.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="7" y1="18.5" x2="10" y2="18.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="7" y1="27.5" x2="10" y2="27.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="12" y1="45.5" x2="15" y2="45.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="22" y1="36.5" x2="25" y2="36.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="16" y1="45.5" x2="19" y2="45.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="15" y1="27.5" x2="18" y2="27.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="19" y1="27.5" x2="22" y2="27.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="0" y1="27.5" x2="3" y2="27.5"/>
+<line fill="none" stroke="#000000" stroke-width="3" stroke-linejoin="round" stroke-miterlimit="10" x1="24" y1="9.5" x2="27" y2="9.5"/>
+</svg>
diff --git a/book/src/main/resources/images/Dropdown.png b/book/src/main/resources/images/Dropdown.png
new file mode 100644
index 0000000..c28a60d
--- /dev/null
+++ b/book/src/main/resources/images/Dropdown.png
Binary files differ
diff --git a/book/src/main/resources/images/Hello World Console.png b/book/src/main/resources/images/Hello World Console.png
new file mode 100644
index 0000000..3b83de3
--- /dev/null
+++ b/book/src/main/resources/images/Hello World Console.png
Binary files differ
diff --git a/book/src/main/resources/images/Hello World White.png b/book/src/main/resources/images/Hello World White.png
new file mode 100644
index 0000000..f4d3774
--- /dev/null
+++ b/book/src/main/resources/images/Hello World White.png
Binary files differ
diff --git a/book/src/main/resources/images/Hello World.png b/book/src/main/resources/images/Hello World.png
new file mode 100644
index 0000000..d333b5f
--- /dev/null
+++ b/book/src/main/resources/images/Hello World.png
Binary files differ
diff --git a/book/src/main/resources/images/IntelliJ Hello.png b/book/src/main/resources/images/IntelliJ Hello.png
new file mode 100644
index 0000000..766df74
--- /dev/null
+++ b/book/src/main/resources/images/IntelliJ Hello.png
Binary files differ
diff --git a/book/src/main/resources/images/Scalatags Downloads.png b/book/src/main/resources/images/Scalatags Downloads.png
new file mode 100644
index 0000000..4ff118c
--- /dev/null
+++ b/book/src/main/resources/images/Scalatags Downloads.png
Binary files differ
diff --git a/book/src/main/resources/images/javascript-the-good-parts-the-definitive-guide.jpg b/book/src/main/resources/images/javascript-the-good-parts-the-definitive-guide.jpg
new file mode 100644
index 0000000..3c1a1c5
--- /dev/null
+++ b/book/src/main/resources/images/javascript-the-good-parts-the-definitive-guide.jpg
Binary files differ
diff --git a/book/src/main/scala/book/Book.scala b/book/src/main/scala/book/Book.scala
new file mode 100644
index 0000000..09be8ee
--- /dev/null
+++ b/book/src/main/scala/book/Book.scala
@@ -0,0 +1,90 @@
+package book
+import acyclic.file
+
+import scalatags.Text.tags2
+import scalatags.Text.all._
+
+/**
+ * Created by haoyi on 10/26/14.
+ */
+object Book {
+ val autoResources = Set(
+ "META-INF/resources/webjars/highlightjs/8.2-1/highlight.min.js",
+ "META-INF/resources/webjars/highlightjs/8.2-1/styles/idea.min.css",
+ "META-INF/resources/webjars/highlightjs/8.2-1/languages/scala.min.js",
+ "META-INF/resources/webjars/highlightjs/8.2-1/languages/javascript.min.js",
+ "META-INF/resources/webjars/highlightjs/8.2-1/languages/bash.min.js",
+ "META-INF/resources/webjars/highlightjs/8.2-1/languages/diff.min.js",
+ "META-INF/resources/webjars/highlightjs/8.2-1/languages/xml.min.js",
+ "META-INF/resources/webjars/pure/0.5.0/pure-min.css",
+ "META-INF/resources/webjars/pure/0.5.0/grids-responsive-min.css",
+ "META-INF/resources/webjars/font-awesome/4.2.0/fonts/FontAwesome.otf",
+ "META-INF/resources/webjars/font-awesome/4.2.0/fonts/fontawesome-webfont.eot",
+ "META-INF/resources/webjars/font-awesome/4.2.0/fonts/fontawesome-webfont.svg",
+ "META-INF/resources/webjars/font-awesome/4.2.0/fonts/fontawesome-webfont.ttf",
+ "META-INF/resources/webjars/font-awesome/4.2.0/fonts/fontawesome-webfont.woff",
+ "css/side-menu.css",
+ "example-opt.js",
+ "webpage/weather.js",
+ "favicon.svg",
+ "favicon.png"
+ )
+
+ val fontAwesomeCss =
+ "META-INF/resources/webjars/font-awesome/4.2.0/css/font-awesome.min.css"
+
+ val manualResources = Set(
+ "images/javascript-the-good-parts-the-definitive-guide.jpg",
+ "images/Hello World.png",
+ "images/Hello World White.png",
+ "images/Hello World Console.png",
+ "images/IntelliJ Hello.png",
+ "images/Dropdown.png",
+ "images/Scalatags Downloads.png",
+ fontAwesomeCss
+ )
+
+
+ val txt = Index()
+ val data = upickle.write(sect.structure)
+ val googleAnalytics =
+ """
+ |(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ | })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+ |
+ | ga('create', 'UA-27464920-4', 'auto');
+ | ga('send', 'pageview');
+ """.stripMargin
+ val site = Seq(
+ raw("<!doctype html>"),
+ html(
+ head(
+ meta(charset:="utf-8"),
+ meta(name:="viewport", content:="width=device-width, initial-scale=1.0"),
+ link(rel:="shortcut icon", `type`:="image/png", href:="favicon.png"),
+ link(rel:="stylesheet", href:=fontAwesomeCss),
+ link(rel:="stylesheet", href:="styles.css"),
+ tags2.title("Hands-on Scala.js"),
+ script(src:="scripts.js"),
+ script(raw(googleAnalytics))
+ ),
+ body(
+ onload:=s"Controller().main($data)",
+ div(id:="layout")(
+ a(href:="#menu", id:="menuLink", cls:="menu-link")(
+ span
+ ),
+ div(id:="menu")
+
+ ),
+ div(id:="main",
+ div(id:="main-box")(
+ txt
+ )
+ )
+ )
+ )
+ ).render
+}
diff --git a/book/src/main/scala/book/BookData.scala b/book/src/main/scala/book/BookData.scala
new file mode 100644
index 0000000..d927b5f
--- /dev/null
+++ b/book/src/main/scala/book/BookData.scala
@@ -0,0 +1,45 @@
+package book
+
+import acyclic.file
+import scalatags.Text.TypedTag
+import scalatags.Text.all._
+object BookData {
+ lazy val javaAPIs = {
+ import java.io.File
+ def recursiveListFiles(f: File): Array[File] = {
+ val these = f.listFiles
+ these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles)
+ }
+
+ val roots = Seq(
+ "output/scala-js/javalanglib/src/main/scala",
+ "output/scala-js/javalib/src/main/scala"
+ )
+ for{
+ root <- roots
+ file <- recursiveListFiles(new File(root))
+ if file != null
+ if file.isFile
+ } yield{
+ val path = file.getPath
+ .drop(root.length + 1)
+ .dropRight(".scala".length)
+ val filename = path.replace('/', '.')
+ val docpath = s"https://docs.oracle.com/javase/7/docs/api/$path.html"
+ filename -> docpath
+ }
+ }
+ var counter = 0
+ def example(t: TypedTag[String], main: String) = {
+ val tagId = "example"+counter
+ counter += 1
+ Seq(
+ t(id:=tagId, display.block),
+ script(s"$main(document.getElementById('$tagId'))")
+ )
+ }
+ def split = div(cls:="pure-g")
+ def more = div(cls:="pure-u-1 pure-u-md-13-24")
+ def less = div(cls:="pure-u-1 pure-u-md-11-24")
+ def half = div(cls:="pure-u-1 pure-u-md-1-2")
+}
diff --git a/book/src/main/scala/book/Main.scala b/book/src/main/scala/book/Main.scala
new file mode 100644
index 0000000..cb8ef99
--- /dev/null
+++ b/book/src/main/scala/book/Main.scala
@@ -0,0 +1,66 @@
+package book
+import acyclic.file
+import java.io.InputStream
+import java.nio.file.{Paths, Files}
+
+
+
+object Main {
+ def write(txt: String, dest: String) = {
+ Paths.get(dest).toFile.getParentFile.mkdirs()
+ Files.deleteIfExists(Paths.get(dest))
+ Files.write(Paths.get(dest), txt.getBytes)
+ }
+ def copy(src: InputStream, dest: String) = {
+ Paths.get(dest).toFile.getParentFile.mkdirs()
+ Files.deleteIfExists(Paths.get(dest))
+ Files.copy(src, Paths.get(dest))
+ }
+
+ def main(args: Array[String]): Unit = {
+ println("Writing Book")
+
+ write(Book.site, "output/index.html")
+
+ val jsFiles = Book.autoResources.filter(_.endsWith(".js")).toSet
+ val cssFiles = Book.autoResources.filter(_.endsWith(".css")).toSet
+ val miscFiles = Book.autoResources -- cssFiles -- jsFiles
+
+ for(res <- Book.manualResources ++ miscFiles) {
+ copy(getClass.getResourceAsStream("/" + res), "output/" + res)
+ }
+
+ for((resources, dest) <- Seq(jsFiles -> "scripts.js", cssFiles -> "styles.css")) {
+ val blobs = for(res <- resources.iterator) yield {
+ io.Source.fromInputStream(getClass.getResourceAsStream("/"+res)).mkString
+ }
+
+ write(blobs.mkString("\n"), "output/"+dest)
+ }
+
+ val allNames = {
+ def rec(n: Tree[String]): Seq[String] = {
+ n.value +: n.children.flatMap(rec)
+ }
+ rec(sect.structure).toSet
+ }
+ val dupes = allNames.groupBy(x => x)
+ .values
+ .filter(_.size > 1)
+ .map(_.head)
+ .toSet
+
+ assert(dupes.size == 0, s"Duplicate names: $dupes")
+
+ val dangling = sect.usedRefs -- allNames
+
+ assert(dangling.size == 0, s"Dangling Refs: $dangling")
+
+ println("Writing Done")
+
+ // can be used to verify that no links are broken
+ // lnk.usedLinks
+ }
+
+
+}
diff --git a/book/src/main/scala/book/Utils.scala b/book/src/main/scala/book/Utils.scala
new file mode 100644
index 0000000..8c5c920
--- /dev/null
+++ b/book/src/main/scala/book/Utils.scala
@@ -0,0 +1,213 @@
+package book
+
+import acyclic.file
+import scala.collection.mutable
+import scalatags.Text.all._
+import scalatags.text.Builder
+
+case class pureTable(header: Frag*){
+ def apply(content: Frag*) = {
+ table(cls:="pure-table pure-table-horizontal half-table")(
+ thead(header),
+ tbody(content)
+ )
+ }
+}
+object sect{
+
+ var indent = 0
+
+ val headers = Seq[((String, String, Frag) => scalatags.Text.Tag, Option[Frag => Frag])](
+ ((h, s, l) => div(cls:="header")(
+ h1(h, l),
+ h2(s)
+ ), Some(f => div(cls:="content", f))),
+ ((h, s, l) => div(cls:="header")(
+ h1(id:=munge(h), h, l),
+ br
+ ), None),
+ (h1(_, _, _), None),
+ (h2(_, _, _), None),
+ (h3(_, _, _), None),
+ (h4(_, _, _), None),
+ (h5(_, _, _), None),
+ (h6(_, _, _), None)
+ )
+
+ var structure = Tree[String]("root", mutable.Buffer.empty)
+
+ val usedRefs = mutable.Set.empty[String]
+
+ def ref(s: String, txt: String = "") = {
+ usedRefs += s
+ a(if (txt == "") s else txt, href:=s"#${munge(s)}")
+ }
+
+ def munge(name: String) = {
+ name.replace(" ", "")
+ }
+}
+case class sect(name: String, subname: String = ""){
+ sect.indent += 1
+ val newNode = Tree[String](name, mutable.Buffer.empty)
+ val (headerWrap, contentWrap) = sect.headers(sect.indent-1)
+ sect.structure.children.append(newNode)
+ val prev = sect.structure
+ sect.structure = newNode
+ def apply(args: Frag*) = {
+ val wrappedContents = contentWrap.getOrElse((x: Frag) => x)(args)
+
+ val headingAnchor = a(
+ cls:="header-link",
+ href:=s"#${sect.munge(name)}",
+ " ",
+ i(cls:="fa fa-link")
+ )
+ val res = Seq[Frag](
+ headerWrap(name, subname, headingAnchor)(
+ cls:="content-subhead",
+ id:=sect.munge(name)
+ ),
+ wrappedContents
+ )
+ sect.indent -= 1
+ sect.structure = prev
+ res
+ }
+}
+case class Tree[T](value: T, children: mutable.Buffer[Tree[T]])
+object lnk{
+ val usedLinks = mutable.Set.empty[String]
+ def apply(name: String, url: String) = {
+ usedLinks.add(url)
+ a(name, href:=url)
+ }
+ object dom{
+ def mdnThing(name: String) = lnk(name, "https://developer.mozilla.org/en-US/docs/Web/API/" + name)
+ def mdnEvent(name: String) = lnk(name, "https://developer.mozilla.org/en-US/docs/Web/Events/" + name)
+ val CanvasRenderingContext2D = mdnThing("CanvasRenderingContext2D")
+ val HTMLCanvasElement = mdnThing("HTMLCanvasElement")
+ val Element = mdnThing("Element")
+ val HTMLElement = mdnThing("HTMLElement")
+ val HTMLInputElement = mdnThing("HTMLInputElement")
+ val HTMLSpanElement = mdnThing("HTMLSpanElement")
+ val XMLHttpRequest = mdnThing("XMLHttpRequest")
+ val getElementById = mdnThing("document.getElementById")
+ val setInterval = mdnThing("WindowTimers.setInterval")
+ val mousedown = mdnEvent("mousedown")
+ val mouseup = mdnEvent("mouseup")
+ val onclick = mdnEvent("onclick")
+ val onkeyup = mdnEvent("onkeyup")
+ val JSONparse = lnk("Json.parse", "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse")
+ }
+ object scala{
+ def apply(s: String) = {
+ lnk(s, "http://www.scala-lang.org/files/archive/nightly/docs/library/index.html#" + s)
+ }
+ }
+ object misc{
+ val IntelliJ = lnk("IntelliJ", "http://blog.jetbrains.com/scala/")
+ val Eclipse = lnk("Eclipse", "http://scala-ide.org/")
+ val Rhino = lnk("Rhino", "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino")
+ val Nodejs = lnk("Node.js", "http://nodejs.org/")
+ val PhantomJS = lnk("PhantomJS", "http://phantomjs.org/")
+ val Play = lnk("Play", "https://www.playframework.com/")
+ val Scalatra = lnk("Scalatra", "http://www.scalatra.org/")
+ val ScalaTest = lnk("ScalaTest", "http://www.scalatest.org/")
+ val Scalate = lnk("Scalate", "https://github.com/scalate/scalate")
+ }
+ object github{
+ val Scalatags = lnk("Scalatags", "https://github.com/lihaoyi/scalatags")
+ val uPickle= lnk("uPickle", "https://github.com/lihaoyi/upickle")
+ val scalaPickling = lnk("scala-pickling", "https://github.com/scala/pickling")
+ }
+}
+
+object hl{
+ def highlight(snippet: Seq[String], lang: String) = {
+ val string = snippet.mkString
+ val lines = string.split("\n", -1)
+ if (lines.length == 1){
+ code(cls:=lang + " highlight-me", lines(0), padding:=0, display:="inline")
+ }else{
+ val minIndent = lines.map(_.takeWhile(_ == ' ').length)
+ .filter(_ > 0)
+ .min
+ val stripped = lines.map(_.drop(minIndent))
+ .dropWhile(_ == "")
+ .mkString("\n")
+
+ pre(code(cls:=lang + " highlight-me hljs", stripped))
+ }
+ }
+
+ def javascript(code: String*) = highlight(code, "javascript")
+ def scala(code: String*) = highlight(code, "scala")
+ def bash(code: String*) = highlight(code, "bash")
+ def diff(code: String*) = highlight(code, "diff")
+ def html(code: String*) = highlight(code, "xml")
+
+ val mappings = Seq(
+ "output/scala-js" -> "https://github.com/scala-js/scala-js",
+ "output/workbench-example-app" -> "https://github.com/lihaoyi/workbench-example-app",
+ "" -> "https://github.com/lihaoyi/hands-on-scala-js"
+ )
+ def ref(filepath: String, start: String = "", end: String = "\n") = {
+
+ val lang = filepath.split('.').last match {
+ case "js" => "javascript"
+ case "scala" => "scala"
+ case "sbt" => "scala"
+ case "sh" => "bash"
+ case "html" => "xml"
+ case x =>
+ println("??? " + x)
+ ???
+ }
+
+ val lines = io.Source.fromFile(filepath).getLines().toVector
+
+ def indent(line: String) = line.takeWhile(_.isWhitespace).length
+
+ val startLine = lines.indexWhere(_.contains(start))
+ if (startLine == -1){
+ throw new Exception("Can't find marker: " + start)
+ }
+ val whitespace = indent(lines(startLine))
+ val endLine = lines.indexWhere(
+ line => line.contains(end) || (indent(line) < whitespace && line.trim != ""),
+ startLine + 1
+ )
+ val sliced =
+ if (endLine == -1) lines.drop(startLine)
+ else lines.slice(startLine, endLine)
+
+ val blob = sliced.map(_.drop(whitespace)).mkString("\n")
+
+ val (prefix, url) =
+ mappings.iterator
+ .find{case (prefix, path) => filepath.startsWith(prefix)}
+ .get
+
+ val hash =
+ if (endLine == -1) ""
+ else s"#L$startLine-L$endLine"
+
+ val linkUrl =
+ s"$url/tree/master/${filepath.drop(prefix.length)}$hash"
+ pre(
+ code(cls:=lang + " highlight-me hljs", blob),
+ a(
+ cls:="header-link",
+ i(cls:="fa fa-link "),
+ position.absolute,
+ right:="0.5em",
+ bottom:="0.5em",
+ display.block,
+ fontSize:="24px",
+ href:=linkUrl,
+ target:="_blank"
+ )
+ )
+ }
+} \ No newline at end of file
diff --git a/book/src/main/scalatex/book/Index.scalatex b/book/src/main/scalatex/book/Index.scalatex
new file mode 100644
index 0000000..7a7e2b8
--- /dev/null
+++ b/book/src/main/scalatex/book/Index.scalatex
@@ -0,0 +1,83 @@
+@import BookData._
+
+@val firstHalfDescription = """
+is a set of tutorials that walks you through getting started with Scala.js. You'll build a range of small projects, from Making a Canvas App to Interactive Web Pages to Integrating Client-Server, and in the process will get a good overview of both Scala.js's use cases as well as the development experience
+"""
+@val secondHalfDescription = """
+is a set of detailed expositions on various parts of the Scala.js platform. Nothing in here is necessary for you to make your first demos, but as you dig deeper into the platform, you will likely need or want to care about these things so you can properly understand what's going on "under the hood"
+"""
+@sect("Hands-on Scala.js", "Writing client-side web applications in Scala")
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/Splash.scala", "var x")
+
+ @less
+ @BookData.example(canvas, "Splash().main")
+
+ @p
+ @lnk("Scala.js", "http://www.scala-js.org/") is a compiler that compiles Scala source code to equivalent Javascript code. That lets you write Scala code that you can run in a web browser, or other environments (Chrome plugins, Node.js, etc.) where Javascript is supported. This book is an introduction to Scala.js, which aims to get you from knowing-nothing about it to being relatively proficient.
+
+ @p
+ This book contains something for all levels of experience with Scala.js: absolute beginners can get started with the @sect.ref{Intro to Scala.js} and @sect.ref{Hands On} tutorial, people who have used it before can skip ahead to the later parts of the tutorial: @sect.ref{Making a Canvas App} or @sect.ref{Interactive Web Pages}. Intermediate users will find interest in the chapters on @sect.ref{Cross Publishing Libraries} with Scala.js or @sect.ref{Integrating Client-Server}, and even experienced users will find the @sect.ref{In Depth} documention useful. Feel free to explore the navigation bar on the left to find chapters of interest.
+
+ @p
+ Even if we do not require any familiarity of Scala.js, this book nonetheless assumes a good amount of background knowledge: of Scala, of Javascript, and of web development as a whole. In general, you will not need deep knowledge of any of these subjects, though if you are coming in entirely without knowledge of any one of them, you'll have to be willing to spend time Google-ing things and picking things up as we go along. Someone who comes in without previous web-dev experience may miss or not-notice many of the nice touches and benefits that Scala.js brings to the table, having never done web-dev any other way,
+
+ @p
+ Many of the code samples are taken from examples available on the book's @lnk("Github Page", "https://github.com/lihaoyi/scala-js-book"); for those code samples (e.g. the animation above), there is a @i(cls:="fa fa-link ") link in the bottom-right corner of the snippet that you can click on to go to the original code. These come in handy if you find you need additional context around the snippet, e.g. what imports you need for the code to work, or what the complete executable example looks like.
+
+ @p
+ This book is roughly divided into two sections:
+
+ @ul
+ @li
+ @sect.ref{Hands On} @firstHalfDescription
+ @li
+ @sect.ref{In Depth} @secondHalfDescription
+
+ @p
+ Feel free to jump ahead to either of them if you have some prior exposure to Scala.js. If not, it is best to start with the introduction...
+
+@sect{Intro to Scala.js}
+ @Intro()
+
+@sect("Hands On", "Writing your first Scala.js programs")
+ @p
+ This half of the book @firstHalfDescription
+
+ @sect{Getting Started}
+ @handson.GettingStarted()
+
+ @sect{Making a Canvas App}
+ @handson.CanvasApp()
+
+ @sect{Interactive Web Pages}
+ @handson.WebPage()
+
+ @sect{The Command Line}
+ @handson.CommandLine()
+
+ @sect{Cross Publishing Libraries}
+ @handson.PublishingModules()
+
+ @sect{Integrating Client-Server}
+ @handson.ClientServer()
+
+@sect("In Depth", "Exploring Scala.js")
+ @p
+ This half of the book @secondHalfDescription
+
+ @sect{Advanced Techniques}
+ @indepth.AdvancedTechniques()
+
+ @sect{Deviations from Scala-JVM}
+ @indepth.SemanticDifferences()
+
+ @sect{The Compilation Pipeline}
+ @indepth.CompilationPipeline()
+
+ @sect{Scala.js' Design Space}
+ @indepth.DesignSpace()
+
+ @sect{Java APIs}
+ @indepth.JavaAPIs() \ No newline at end of file
diff --git a/book/src/main/scalatex/book/Intro.scalatex b/book/src/main/scalatex/book/Intro.scalatex
new file mode 100644
index 0000000..5438cfb
--- /dev/null
+++ b/book/src/main/scalatex/book/Intro.scalatex
@@ -0,0 +1,182 @@
+@import BookData._
+@p
+ Scala.js compiles Scala code to equivalent, executable Javascript. Here's the compilation of a trivial hello-world example:
+
+@split
+ @half
+ @hl.scala
+ object Example extends js.JSApp{
+ def main() = {
+ var x = 0
+ while(x < 10) x += 3
+ println(x)
+ // 12
+ }
+ }
+
+ @half
+ @hl.javascript
+ ScalaJS.c.LExample$.prototype.main__V = (function() {
+ var x = 0;
+ while ((x < 10)) {
+ x = ((x + 3) | 0)
+ };
+ ScalaJS.m.s_Predef().println__O__V(x)
+ // 12
+ });
+
+@p
+ As you can see, both of the above programs do identical things: they'll count the variable @hl.scala{x} from @hl.scala{0}, @hl.scala{3}, @hl.scala{9}, and @hl.scala{12} before finally printing it out. It's just that the first is written in Scala and the second is in Javascript.
+
+@p
+ Traditionally, Scala has been a language which runs on the JVM. This eliminates it from consideration in many cases, e.g. when you need to build interactive web apps, the browser-client only runs Javascript. Even if your back-end is all written in Scala, you need to fall back to Javascript to run your client-side code, at a great loss in terms of toolability and maintainability. Scala.js lets you to develop web applications with the safety and toolability that comes with a statically typed language:
+
+@ul
+ @li
+ Typo-safety due to its compiler which catches many silly errors before the code is run
+ @li
+ In-editor support for autocomplete, error-highlighting, refactors, and intelligent navigation
+ @li
+ Moderate sized compiled executables, in the 100-400kb range
+ @li
+ Source-maps for ease of debugging
+
+@p
+ The value proposition is that due to the superior language and tooling, writing a web application in Scala.js will result in a codebase that is more flexible and robust than an equivalent application written in Javascript. The hope is that the benefits of using Scala.js will outweigh the additional (non-trivial) messiness of adding a whole new toolchain, as compared to directly writing raw Javascript.
+
+@p
+ I won't spend time on a detailed discussion on why Scala is good or why Javascript is bad; people's opinions on both sides can be found on the internet. The assumption is, going in, that you either already know and like Scala, or you are familiar with Javascript and are willing to try something new.
+
+@sect{About Javascript}
+ @p
+ Javascript is the language supported by web browsers, and is the only language available if you wish to write interactive web applications. As more and more activity moves online, the importance of web apps will only increase over time. Adobe Flash, Java Applets and Silverlight (which have historically allowed browser-client development in other languages) are all but dead: historically they have been the source of security vulnerabilities, none of them are available on the mobile browsers of Android or iOS or Windows8+. That leaves Javascript.
+
+ @sect{Javascript-the-language}
+ @p
+ Javascript is an OK language to do small-scale development: an animation here, an on-click transition there. There are a number of warts in the language, e.g. its verbosity, and a large amount of surprising behavior, but while your code-base doesn't extend past a few hundred lines of code, you often will not mind or care.
+
+ @p
+ However, Javascript is not an easy language to work in at scale: when your code-base extends to thousands, tens or hundreds of thousands of lines of code. The un-typed nature of the language, which is fine for small applications, becomes an issue when you are mainly working with code that you did not write.
+
+ @p
+ In a large code-base, finding out what methods or properties a variable has is often a long chase through dozens of files to see how it ended up being passed to the current function. Refactorings, which are OK when you can just test the code to see if it works, become dangerous when your code base is large enough that "just test all the code" would take hours. Language-warts which are slightly annoying in small programs become a minefield in large ones: it's only a matter of time before you hit one, often in code you did-not/cannot test, resulting in breakages in production.
+
+ @p
+ Apart from the inherent danger of the language, Javascript has another major problem: the language has left many things unspecified, yet at the same time provides the ability to emulate these things in a variety of ways. This means that rather than having a single way of e.g. defining a class and instantiating an object, there is a decade-long debate between a dozen different and equally-bad, hand-crafted alternatives. Large code-bases use third-party libraries, and most are guaranteed (purely due to how stastistics work) to do these basic things differently from your own code, making understanding these disparate code-bases (e.g. when something goes wrong) very difficult.
+
+ @p
+ To work in Javascript, you need the discipline to limit yourself to the sane subset of the language, avoiding all the pitfalls along the way:
+
+ @img(src:="images/javascript-the-good-parts-the-definitive-guide.jpg")
+
+ @p
+ Even if you manage to do so, what constitutes a pitfall and what constitutes a clever-language-feature changes yearly, making it difficult to maintain cohesiveness over time. This is compounded by the fact that refactoring is difficult, and so removing "unwanted" patterns from a large code-base a difficult (often multi-year) process.
+
+ @sect{Javascript-the-platform}
+ @p
+ However, even as Javascript-the-language sucks, Javascript-the-platform has some very nice properties that make it a good target for application developers:
+
+ @ul
+ @li
+ Zero-install distribution: just go to a URL and have the application downloaded and ready to use.
+ @li
+ Hyperlinks: being able to link to a particular page or item within a web app is a feature other platforms lack, and makes it much easier to cross-reference between different systems
+ @li
+ Sandboxed security: web applications are secure by default. No matter how sketchy the websites you visit, you can be sure that once you close the page, they're gone
+
+ @p
+ These features are all very nice to have, and together have made the web platform the success it is today. When you compare it to traditional applications, you can see the draw:
+ @ul
+ @li
+ Installing traditional desktop applications is usually a several-minute-long process. If something goes wrong in the installation, that often leaves a botched half-install on your computer which makes installing, uninstalling, or running the program impossible without manual surgery to excise the broken files.
+ @li
+ Desktop applications generally do not talk to each other at all. While on the web you can easily link a page to someone, trying to get someone to a particular screen in desktop software often involves a chain of screenshots with detailed instructions of which buttons to click at each stage.
+ @li
+ Desktop application security is non-existent. Install one rogue application and it can take over your computer, steal your credit card number, use your email for sending spam, and all sorts of other nasty things. Removing these for-good sometimes involves re-installing your entire operating system. Hence people are much more wary about only installing desktop software from people they "trust".
+
+ @p
+ In many ways, mobile App platforms like Android and iOS have closed the gap between "native" and "web" applications. Installing a new App may take 30 seconds, you can often deep-link to certain pages within an App, and Apps have a much tighter security model than desktop software does. Nevertheless, 30 seconds is still much longer than the 0.5 seconds it takes to open a web page, deep-linking in apps is not very prevalent, and the security model still often leaves space for rogue Apps to misbehave and steal data.
+
+ @hr
+ @p
+ Despite the problems with Javascript (and other tools like HTML an CSS, which have their own problems) the Web platform got a lot of things right, and the Desktop and Mobile platforms have a lot of catching up to do. If only we could improve upon the parts that aren't so great. This is where Scala.js comes in.
+
+@sect{About Scala.js}
+
+ @p
+ With Scala.js, you can cross compile your Scala code to a Javascript executable that can run on all major web browsers. You get all the benefits of the web platform in terms of deployability, security, and hyperlinking, with none of the problems of writing your software in Javascript. Scala.js provides a @sect.ref("The Language", "better language") to do your work in, but also provides some other goodies that have in-so-far never been seen in mainstream web development: @sect.ref("Sharing Code", "shared-code") and @sect.ref("Client-Server Integration", "client-server integration").
+
+ @sect{The Language}
+ @p
+ At a first approximation, Scala.js provides you a sane language to do development in the web browser. This saves you from an endless stream of Javascript warts like this one:
+
+ @hl.javascript
+ javascript> ["10", "10", "10", "10"].map(parseInt)
+ [10, NaN, 2, 3] // WTF
+
+ @hl.scala
+ scala> List("10", "10", "10", "10").map(parseInt)
+ List(10, 10, 10, 10) // Yay!
+
+
+ @p
+ Not only do you have an expressive language with static types, you also have great tooling with IDEs like IntelliJ and Eclipse, a rich library of standard collections, and many other modern conveniences that we take for granted but are curiously missing when working in the wild west of web development: the browser! You get all of the upside of developing for the web platform.
+
+ @p
+ While not useful for small applications, where most of the logic is gluing together external APIs, this comes in very useful in large applications where a lot of the complexity and room-for-error is entirely internal. With larger apps, you can no longer blame browser vendors for confusing APIs that make your code terrible: these confusing APIs only lurk in the peripherals around a larger, complex application. One thing you learn working in large-ish web client-side code-bases is that the bulk of the confusion and complexity is no-one's fault but your own, as a team.
+
+ @p
+ At this point, all of Google, Facebook, and Microsoft have all announced work on a typed variant of Javascript. These are not academic exercises: @lnk("Dart", "https://www.dartlang.org/")/@lnk("AtScript", "https://docs.google.com/document/d/11YUzC-1d0V1-Q3V0fQ7KSit97HnZoKVygDxpWzEYW0U/edit")/@lnk("Flow", "https://lobste.rs/s/fp9ibi/flow_facebook_s_new_javascript_type_checker")/@lnk("Typescript", "http://www.typescriptlang.org/") are all problems that solve a real need, that these large companies have all faced once they've grown beyond a certain size. Clearly, Javascript isn't cutting it anymore, and the convenience and "native-ness" of the language is more than made up for in the constant barrage of self-inflicted problems. Scala.js takes this idea and runs with it!
+
+ @sect{Sharing Code}
+ @p
+ Shared code is one of the holy-grails of web development. Traditionally the client-side code and server-side code has been written in separate languages: PHP or Perl or Python or Ruby or Java on the server, with only Javascript on the client. This means that algorithms were often implemented twice, constants copied-&-pasted, or awkward Ajax calls are made in an attempt to centralize the logic in one place (the server). With the advent of Node.js in the last few years, you can finally re-use the same code on the server as you can on the client, but with the cost of having all the previously client-only @sect.ref("Javascript-the-language", "problems with Javascript") now inflicted upon your server code base. Node.js expanded your range-of-options for writing shared client/server logic from "Write everything twice" to "Write everything twice, or write everything in Javascript". More options is always good, but it's not clear which of the two choices is more painful!
+
+ @p
+ Scala.js provides an alternative to this dilemma. With Scala.js, you can utilize the same libraries you use writing your Scala servers when writing your Scala web clients! On one end, you are sharing your templating language with @lnk("Scalatags", "https://github.com/lihaoyi/scalatags") or sharing your serialization logic with @lnk("uPickle", "https://github.com/lihaoyi/upickle"). At the other, you are sharing large, abstract libraries like @lnk("Scalaz", "https://github.com/japgolly/scalaz") or @lnk("Shapeless", "https://groups.google.com/forum/#!searchin/scala-js/shapeless/scala-js/5Sf2up0z3PU/9F9SYB0qHEcJ").
+
+ @p
+ Sharing code means several things:
+
+ @ul
+ @li
+ Not having to find two libraries to do a particular common task
+ @li
+ Not having to re-learn two different ways of doing the exact same thing
+ @li
+ Not needing to implement the same algorithms twice, for the times you can't find a good library to do what you want
+ @li
+ Not having to debug problems caused by subtle differences in the two implementations
+ @li
+ Not having to resort to awkward Ajax-calls or pre-computation to avoid duplicating logic between the client and server
+
+ @p
+ Shared code doesn't just mean sharing pre-made libraries between the client and server. You can easily @sect.ref("Cross Publishing Libraries", "publish your own libraries") that can be used on both Scala-JVM and Scala.js. This means that as a library author, you can at once target two completely different platforms, and (with some work) take advantage of the intricacies of each platform to optimize your library for each one. Take Scalatags as an example: as the first client-server Scala.js-ScalaJVM shared libraries, it enjoys a roughly even split of downloads from people using it on both platforms:
+
+ @img(src:="images/Scalatags Downloads.png", width:="100%")
+
+ @p
+ Shared code means that if you, as an application writer, want some logic to be available on both the client and server, you simply @sect.ref("A Client-Server Setup", "put it in a shared/ folder"), and that's the end of the discussion. No architectural patterns to follow, no clever techniques need to be involved. Shared logic, whether that means constants, functions, data structures, all the way to algorithms and entire libraries, can simply be placed in @code{shared/} and be instantly accessible from both your client-side web code and your server.
+
+ @p
+ Shared code has long been the holy-grail of web development. Even now, people speak of shared code as if it were a myth. With Scala.js, shared code is the simple, boring reality. And all this while, just as importantly, you don't need to re-write your large enterprise back-end systems in a language that doesn't scale well beyond 100s of lines of code.
+
+ @sect{Client-Server Integration}
+ @p
+ There is an endless supply of new platforms which have promised to change-the-way-we-do-web-development-forever. From old-timers like @lnk("Ur-Web", "http://www.impredicative.com/ur/"), to @lnk("GWT", "http://www.gwtproject.org/"), to Asana's @lnk("LunaScript", "https://asana.com/luna"), to more recently things like @lnk("Meteor.js", "https://www.meteor.com/").
+ @p
+ One common theme in all these platforms is that their main selling point is their tight, seamless client-server integration, to the point where you can just make method calls across the client-server boundary and the platform/language/compiler figures out what to do.
+ @p
+ With Scala.js and Scala-JVM, such conveniences like making method calls across the client-server boundary is the @sect.ref("Integrating Client-Server", "boring reality"). Not only are the calls transparent, they are also statically checked, so any mistake in the route name or the parameters it expects, or the result type it returns to you, will be caught by the compiler long before even manual testing. It becomes @sect.ref("What's Left?", "impossible to make a malformed Ajax call").
+ @p
+ There's a lot to be said for automating things using a computer. The entire field of software engineering is basically about automating tasks that were previously done manually: accounting, banking, making travel arrangements, and all that. However, in the world of web-development, there has always been one set of tasks that has traditionally be done manually: the task of ensuring the web-clients are properly synchronized with the web-servers. Communication between the two has always been a manual, tedious, error-prone process, and mistakes often end un-noticed until something breaks in production.
+ @p
+ With Scala.js, like the other experimental platforms that have come before us, we attempt to provide a way forward from this manual-tedium.
+
+ @hr
+
+ @p
+ In many ways, Scala.js all-at-once provides many of the traditional holy-grails of web development: People have always dreamed about doing web development in a sane, best-of-breed language that compiles to both client and server. Of not having to worry too hard about whether code goes on the client or on the server, and being able to move or share it if necessary. Of having a compiler that will verify and check that your entire system is correct.
+
+ @p
+ Scala.js provides all these things, and much more. If you're interested enough to want to make use of Scala.js, read on!
diff --git a/book/src/main/scalatex/book/handson/CanvasApp.scalatex b/book/src/main/scalatex/book/handson/CanvasApp.scalatex
new file mode 100644
index 0000000..230ae67
--- /dev/null
+++ b/book/src/main/scalatex/book/handson/CanvasApp.scalatex
@@ -0,0 +1,210 @@
+@import BookData._
+@p
+ By this point, you've already cloned and got your hands dirty fiddling around with the toy @lnk("workbench-example-app", "https://github.com/lihaoyi/workbench-example-app"). You have your editor set up, SBT installed, and have published the example application in a way you can host online for other people to see. Maybe you've even made some changes to the application to see what happens. Hopefully you're curious, and want to learn more.
+
+@p
+ In this section of the book, we will walk through making a small canvas application. This will expose you to important concepts like:
+
+@ul
+ @li
+ Taking input with Javascript event handlers
+ @li
+ Writing your application logic in Scala
+ @li
+ Using a timer to drive periodic actions
+
+@p
+ In general, while the previous chapter was mostly set-up and exploring the Scala.js project, this chapter will walk you through actually writing a non-trivial, self-contained Scala.js application. Throughout this chapter, we will only be making modifications to @code{ScalaJSExample.scala}; the rest of the project will remain unchanged.
+
+@sect{Making a Sketchpad using Mouse Input}
+
+ @p
+ To begin with, lets remove all the existing stuff in our @code{.scala} file and leave only the @hl.scala{object} and the @hl.scala{main} method. Let's start off with some necessary boilerplate:
+
+ @hl.ref("examples/demos/src/main/scala/canvasapp/ScratchPad.scala", "/*setup*/", end = "/*code*/")
+
+ @p
+ As described earlier, this code uses the @lnk.dom.getElementById} function to fish out the @code{canvas} element that we interested in from the DOM. It then gets a rendering context from that @code{canvas}, and sets the height and width of the canvas to completely fill its containing element. Lastly, it fills out the canvas light-gray, so that we can see it on the page.
+
+ @p
+ Next, let's set some event handlers on the canvas:
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/canvasapp/ScratchPad.scala", "/*code*/")
+
+ @less
+ @BookData.example(canvas, "ScratchPad().main")
+
+ @p
+ This code sets up the @lnk.dom.mousedown and @lnk.dom.mouseup events to keep track of whether or not the mouse has currently been clicked. It then draws black squares any time you move the mouse while the button is down. This lets you basically click-and-drag to draw pictures on the canvas. Try it out!
+
+ @p
+ In general, you have access to all the DOM APIs through the @hl.scala{dom} package as well as through Javascript objects such as the @lnk.dom.HTMLCanvasElement. Setting the @code{onmouseXXX} callbacks is just one way of interacting with the DOM. With Scala.js, you also get a very handy autocomplete in the editor, which you can use to browse the various other APIs that are available for use:
+
+ @img(src:="images/Dropdown.png", maxWidth:="100%")
+
+ @p
+ Apart from mouse events, keyboard events, scroll events, input events, etc. are all usable from Scala.js as you'd expect. If you have problems getting this to work, feel free to click on the link @i(cls:="fa fa-link ") icon below the code snippet to see what the full code for the example looks like
+
+@sect{Making a Clock using setInterval}
+
+ @p
+ You've already seen this in the previous example, but @lnk.dom.setInterval can be used to schedule recurring, periodic events in your program. Common use cases include running the @lnk("event loop for a game", "http://gameprogrammingpatterns.com/game-loop.html"), making smooth animations, and other tasks of that sort which require some work to happen over a period of time.
+
+ @p
+ Again, we need roughly the same boilerplate as just now to set up the canvas:
+
+ @hl.ref("examples/demos/src/main/scala/canvasapp/Clock.scala", "/*setup*/", "/*code*/")
+
+ @p
+ The only thing unusual here is that I'm going to create a @hl.scala{linearGradient} in order to make the stopwatch look pretty. This is by no means necessary, and you could simply make the @hl.scala{fillStyle} @hl.scala{"black"} if you want to keep things simple.
+
+ @p
+ Once that's done, it's only a few lines of code to set up a nice, live clock:
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/canvasapp/Clock.scala", "/*code*/")
+
+ @less
+ @BookData.example(canvas, "Clock().main")
+
+ @p
+ As you can see, we're using more @lnk("Canvas APIs", "https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D"), in this case dealing with rendering text on the canvas. Another thing we're using is the Javascript @lnk("Date", "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date") class, in Scala.js under the full name @hl.scala{scala.scalajs.js.Date}, here imported as @hl.scala{js.Date}. Again, click on the link @i(cls:="fa fa-link ") icon to view the full-code if you're having trouble here.
+
+@sect{Tying it together: Flappy Box}
+
+ @p
+ You've just seen two examples of how to use Scala.js, together with the Javascript DOM APIs, to make simple applications. However, we've only used the "Scala" in Scala.js in the most rudimentary fashion: setting a few primitives here and there, defining some methods, mainly just gluing together a few Javascript APIs
+
+ @p
+ In this example we will make a spiritual clone of the popular @lnk("Flappy Bird", "http://en.wikipedia.org/wiki/Flappy_Bird") video game. This game involves a few simple rules
+
+ @ul
+ @li
+ Your character starts in the middle of the screen
+ @li
+ Gravity pulls your character down
+ @li
+ Clicking/tapping the screen makes your character jump up
+ @li
+ There are obstacles that approach your character from the right side of the screen, and you have to make sure you go through the hole in each obstacle to avoid hitting it
+ @li
+ Don't go out of bounds!
+
+ @p
+ It's a relatively simple game, but there should be enough "business logic" in here that we won't be simply gluing together APIs. Let's start!
+
+ @sect{Setting Up the Canvas}
+ @hl.ref("examples/demos/src/main/scala/canvasapp/FlappyLine.scala", "/*setup*/", end="/*variables*/")
+
+ @p
+ This section of the code is peripherally necessary, but not core to the implementation or logic of Flappy Box. We see the same @hl.scala{canvas}/@hl.scala{renderer} logic we've seen in all our examples, along with some logic to make the canvas a reasonable size, and some configuration of how we will render text to the canvas.
+
+ @p
+ In general, code like this will usually end up being necessary in a Scala.js program: the Javascript APIs that the browser provides to do things often ends up being somewhat roundabout and verbose. It's somewhat annoying to have to do for a small program such as this one, but in a larger application, the cost is both spread out over thousands of lines of code and also typically hidden away in helper functions, so the verbosity and non-idiomatic-scala-ness doesn't bother you much.
+
+ @sect{Defining our State}
+ @hl.ref("examples/demos/src/main/scala/canvasapp/FlappyLine.scala", "/*variables*/", end="def runLive")
+
+ @p
+ This is where we start defining things that are relevant to Flappy Box. There are roughly two groups of values here: immutable constants in the top group, and mutable variables in the bottom. The rough meaning of each variable is documented in the comments, and we'll see exactly how we use them later.
+
+ @p
+ One notable thing is that we're using a @lnk("collection.mutable.Queue", "http://docs.scala-lang.org/overviews/collections/concrete-mutable-collection-classes.html") to store the list of obstacles. This is defined in the Scala standard library; in general, all the collections in the Scala standard library can be used without issue in Scala.js.
+
+ @sect{Game Logic}
+ @hl.ref("examples/demos/src/main/scala/canvasapp/FlappyLine.scala", "def runLive", "def runDead")
+
+ @p
+ The @hl.scala{runLive} function is the meat of Flappy Box. In it, we
+
+ @ul
+ @li
+ Clear the canvas
+ @li
+ Generate new obstacles
+ @li
+ Apply velocity and acceleration to the player
+ @li
+ Check for collisions or out-of-bounds, killing the player if it happens
+ @li
+ Rendering everything, including the player as the namesake box
+
+ @p
+ This function basically contains all the game logic, from motion, to collision-detection, to rendering, so it's pretty large. Not that large though! And entirely understandable, even if it takes a few moments to read through.
+
+ @hl.ref("examples/demos/src/main/scala/canvasapp/FlappyLine.scala", "def runDead", "def run()")
+
+ @p
+ This is the function that handles what happens when you're dead. Essentially, we reset all the mutable variables to their initial state, and just count down the @hl.scala{dead} counter until it reaches zero and we're considered alive again.
+
+ @sect{A Working Product}
+ @hl.ref("examples/demos/src/main/scala/canvasapp/FlappyLine.scala", "def run()")
+
+ @p
+ And finally, this is the code that kicks everything off: we define the @hl.scala{run} function to swap between @hl.scala{runLive} and @hl.scala{runDead}, register an @lnk.dom.onclick handler to make the player jump by tweaking his velocity, and we call @lnk.dom.setInterval to run the @hl.scala{run} function every 20 milliseconds.
+
+ @p
+ At almost 100 lines of code, this is quite a meaty example! Nonetheless, when all is said and done, you will find that the example actually works! Try it out!
+
+ @div
+ @BookData.example(canvas, "FlappyLine().main")
+
+@sect{Canvas Recap}
+ @p
+ We've now gone through the workings of building a handful of toy applications using Scala.js. What have we learnt in the process?
+
+ @sect{Development Speed}
+ @p
+ We've by now written a good chunk of Scala.js code, and perhaps debugged some mysterious errors, and tried some new things. One thing you've probably noticed is the efficiency of the process: you make a change in your editor, the browser reloads itself, and life goes on. There is a compile cycle, but after a few runs the compiler warms up and the compilation cycle drops to less than a second.
+ @p
+ Apart from the compilation/reload speed, you've probably noticed the benefit of tooling around Scala.js. Unlike Javascript editors, your existin Scala IDEs like @lnk.misc.IntelliJ or @lnk.misc.Eclipse can give very useful help when you're working with Scala.js. Autocomplete, error-highlighting, jump-to-definition, and a myriad other modern conveniences that are missing when working in dynamically-typed languages are present when working in Scala.js. This makes the code much less mysterious: you're no longer trying to guess what methods a value has, or what a method returns: it's all laid out in front of you in plain sight.
+
+ @sect{Full Scala}
+ @p
+ All of the examples so far have been very self-contained: they do not touch the HTML DOM, they do not make Ajax calls, or try to access web services. They don't push the limits of the browser's API.
+
+ @p
+ Nevertheless, these examples have exercised a good amount of the Scala language. List comprehensions, collections, the math library, and more. In general, most of the Scala standard library works under Scala.js, as well as a large number of third-party libraries. Unlike many other compile-to-Javascript languages out there, this isn't a language-that-looks-like-Scala: it is Scala through and through, with a tiny number of semantic differences.
+
+ @sect{Seamless Javascript Interop}
+ @p
+ Even if we take some time to read through the code we've written, it is not immediately obvious which bits of code are Scala and which bits are Javascript! It all kind of meshes together, for example if we take the Flappy Box source code:
+
+ @ul
+ @li
+ @hl.scala{obstacles} is a Scala @lnk("mutable.Queue", "http://docs.scala-lang.org/overviews/collections/concrete-mutable-collection-classes.html"), as we defined it earlier, and all the methods on it are Scala method calls
+ @li
+ @hl.scala{renderer} is a Javascript @lnk.dom.CanvasRenderingContext2D, and all the methods on it are Javascript method calls directly on the Javascript object
+ @li
+ @hl.scala{frame} is a Scala @hl.scala{Int}, and obeys Scala semantics, though it is implemented as a Javascript @hl.javascript{Number} under the hood.
+ @li
+ @hl.scala{playerY} and @hl.scala{playerV} are Scala @hl.scala{Double}s, implemented directly as Javascript @hl.javascript{Number}s
+
+ @p
+ This reveals something pretty interesting about Scala.js: even though Scala at-first-glance is a very different language from Javascript, the interoperation with Javascript is so seamless that you can't even tell from the code which values/methods are defined in Scala and which values/methods come from Javascript!
+ @p
+ These two classes of values/methods are treated very differently by the compiler when it comes to emitting the executable Javascript blob, but the compiler does not need extra syntax telling it which things belong to Scala and which to Javascript: the types are sufficient. @hl.scala{renderer}, for example is of type @lnk.dom.CanvasRenderingContext2D which is a subtype of @hl.scala{scalajs.js.Object}, indicating to the compiler that it needs special treatment. Primitives like @hl.scala{Double}s and @hl.scala{Int}s have similar treatment
+
+ @p
+ Overall, this seamless mix of Scala and Javascript values/methods/functions is a common theme in Scala.js applications, so you should expect to see more of it in later chapters of the book.
+
+ @hr
+
+ @p
+ You've now had some experience building small canvas applications in Scala.js. Why not try exercising your new-found skills? Here are some possibilities:
+
+ @ul
+ @li
+ Make more video games! I have a set of @lnk("retro-games ported to Scala.js", "http://lihaoyi.github.io/scala-js-games/"). Maybe re-make one of them without looking at the source, or maybe port some other game you're familiar with and enjoy playing. Even just drawing things on canvas, games can get @lnk("pretty elaborate", "http://lihaoyi.github.io/roll/").
+
+ @li
+ Explore the APIs! We've touched on a small number of Javascript APIs here, mainly for dealign with the canvas, but modern browsers offer a whole @lnk("zoo of functionality", "https://developer.mozilla.org/en-US/docs/Web/API"). Try making an application that uses @lnk("localStorage", "https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage") to save state even when you close the tab, or an application that works with the HTML DOM.
+
+ @li
+ Draw something pretty! We have a working canvas, a nice programming language, and a way to easily publish the results online. @lnk("Various", "http://www.scala-js-fiddle.com/gist/77a3840678d154257ca1/KochSnowflake.scala") @lnk("fractals", "http://www.scala-js-fiddle.com/gist/77a3840678d154257ca1/KochCurve.scala"), or @lnk("colorful visualizations", "http://www.scala-js-fiddle.com/gist/9443f8e0ecc68d1058ad/RayTracer.scala") are all possibilities.
+
+ @p
+ By this point you've some experience building stand-alone, single-canvas Scala.js applications, which has hopefully given you a feel for how Scala.js works. The problem is that few web applications satisfy the criteria of being stand-alone single-page canvas applications! Most web applications need to deal with the DOM of the HTML page, need to fetch data from web services, and generally need to do a lot of other messy things. We'll go into that in the next chapter
diff --git a/book/src/main/scalatex/book/handson/ClientServer.scalatex b/book/src/main/scalatex/book/handson/ClientServer.scalatex
new file mode 100644
index 0000000..0a41dae
--- /dev/null
+++ b/book/src/main/scalatex/book/handson/ClientServer.scalatex
@@ -0,0 +1,244 @@
+
+@p
+ Historically, sharing code across client & server has been a holy-grail for web development. There are many things which have made it hard in the past:
+
+@ul
+ @li
+ Javascript on the client v.s. PHP/Perl/Python/Ruby/Java on the client
+ @li
+ Most back-ends make heavy use of C extensions, and front-end code was tightly coupled to the DOM. Even if you manage to port the main language
+@p
+ There have been some attempts in recent years with more traction: Node.js, for example, has been very successful at running Javascript on the server, the Clojure/Clojurescript community has their own version of cross-built code, and there are a number of smaller, more esoteric platforms.
+
+@p
+ Scala.js lets you share code between client and server relatively straightforwardly. As we saw in the previous chapter, where we made a shared module. Let's work to turn that shared module into a working client-server application!
+
+@sect{A Client-Server Setup}
+ @p
+ Getting started with client-server integration, let's go with the simplest configuration possible: a Spray server and a Scala.js client. Most of the other web-frameworks (@lnk.misc.Play, @lnk.misc.Scalatra, etc.) will have more complex configurations, but the basic mechanism of wiring up Scala.js to your web framework will be the same. Our project will look like this:
+
+ @hl.bash
+ $ tree
+ .
+ ├── build.sbt
+ ├── client
+ │   ├── shared/main/scala/simple/FileData.scala
+ │   └── src/main/scala/simple/Client.scala
+ ├── project
+ │   └── build.sbt
+ └── server
+ ├── shared -> ../client/shared
+ └── src/main/scala/simple
+ ├── Page.scala
+ └── Server.scala
+
+ @p
+ First, let's do the wiring in @code{build.sbt}:
+
+ @hl.ref("examples/crossBuilds/clientserver/build.sbt")
+
+ @p
+ We have two projects: @code{client} and @code{server}, one of which is a Scala.js project (indicated by the presence of @hl.scala{scalaJSSettings}). Both projects share a number of settings: the presence of the @code{shared/} folder, which shared code can live in (similar to what we saw in @sect.ref{Cross Publishing Libraries}) and the settings to add @lnk.github.Scalatags and @lnk.github.uPickle to the build. Note that those two dependencies use the triple @code{%%%} instead of the double @code{%%} to declare: this means that for each dependency, we will pull in the Scala-JVM or Scala.js version depending on whether it's being used in a Scala.js project.
+ @p
+ The @code{client} subproject is uneventful, with a dependency on the by-now-familiar @code{scalajs-dom} library. The @code{server} project, on the other hand, is interesting: it contains the dependencies required for us to set up out Spray server, and one additional thing: we add the output of @code{fastOptJS} from the client to the @code{resources} on the server. This will allow the @code{server} to serve the compiled-javascript from our @code{client} project from its resources.
+
+ @p
+ Next, let's kick off the Spray server in our Scala-JVM main method:
+
+ @hl.ref("examples/crossBuilds/clientserver/server/src/main/scala/simple/Server.scala")
+
+ @p
+ This is a not-very-interesting @lnk("spray-routing", "http://spray.io/documentation/1.2.2/spray-routing/") application: we set up a server on @code{localhost:8080}, have the root URL serve the main page on GET, and have other GET URLs serve resources. This includes the @code{js-fastopt.js} file that is now in our resources because of our @code{build.sbt} config earlier! We also add a POST route to allow the client ask the server to list files various directories.
+
+ @p
+ The HTML template @hl.scala{Page.skeleton} is not shown above; I put it in a separate file for neatness:
+
+ @hl.ref("examples/crossBuilds/clientserver/server/src/main/scala/simple/Page.scala")
+
+ @p
+ This is a typical @lnk.github.Scalatags HTML snippet. Note that since we're serving it directly from the server in Scala code, we do not need to leave a @code{.html} file somewhere on the filesystem! We can declare all HTML, including the skeleton of the page, in Scalatags. Otherwise it's the same as what we saw in earlier chapters: A simple HTML page which includes a script tag to run our Scala.js application.
+ @p
+ Lastly, we'll set up the Scala.js main method, which we are calling in the @hl.html{<script>} tag above to kick off the client-side application.
+
+ @hl.ref("examples/crossBuilds/clientserver/client/src/main/scala/simple/Client.scala")
+
+ @p
+ Again this is a simple Scala.js application, not unlike what we saw in earlier chapters. However, there is one difference: earlier, we made our Ajax calls to @code{api.openweathermap.org/...}. Here, we're making it to @code{/ajax}: the same server the page is served from!
+
+ @p
+ You may have noticed in both client and server, we have made reference to a mysterious @hl.scala{FileData} type which holds the name and size of each file. @hl.scala{FileData} is defined in the @code{shared/} folder, so it can be accessed from both Scala-JVM and Scala.js:
+
+ @hl.ref("examples/crossBuilds/clientserver/client/shared/main/scala/simple/FileData.scala")
+
+ @p
+ Now, if we go to the browser at @code{localhost:8080}, we should see our web-page!
+
+@sect{Client-Server Reflections}
+ @p
+ By now you've already set up your first client-server application. However, it might not be immediately clear what we've done and why it's interesting! Here are some points to consider.
+
+ @sect{Shared Templating}
+
+ @p
+ In both the client code and the server code, we made use of the same Scalatags HTML generation library. This is pretty neat: transferring rendering logic between client and server no longer means an annoying/messy rewrite! You can simply C&P the Scalatags snippet over. That means it's easy if you want to e.g. shift the logic from one side to the other in order to optimize for performance or time-to-load or other things.
+ @p
+ One thing to take note of is that we're actually using subtly @i{different} implementations of Scalatags on both sides: on the server, we're importing from @hl.scala{scalatags.Text}, while on the client we're using @hl.scala{scalatags.JsDom}. The @hl.scala{Text} backend renders directly to Strings, and is available on both Scala-JVM and Scala.js. The @hl.scala{JsDom} backend, on the other hand, renders to @lnk.dom.HTMLElement-s which only exist on Scala.js. Thus while on the client you can do things like attach event listeners to the rendered @lnk.dom.HTMLElement objects, or checking their runtime @code{.value}, on the server you can't. And that's exactly what you want!
+
+ @sect{Shared Code}
+ @p
+ One thing that we skimmed over is the fact that we could easily define our @hl.scala{case class FileData(name: String, size: Long)} in the @code{shared/} folder, and have it instantly and consistently available on both client and server. This perhaps does not seem so amazing: we've already done many similar things earlier when we were building Cross-platform Modules. Nevertheless, in the context of web development, it is a relatively novel idea to be able to ad-hoc share bits of code between client and server.
+ @p
+ Sharing code is not limited to class definitions: @i{anything} can be shared. Objects, classes, interfaces/traits, functions and algorithms, constants: all of these are things that you will likely want to share at some point or another. Traditionally, people have simply re-implemented the same code twice in two languages, or have resorted to awkward Ajax calls to push the logic to the server. With Scala.js, you no longer need to do so: you can easily, create ad-hoc bits of code which are available on both platforms.
+
+ @sect{Boilerplate-free Serialization}
+ @p
+ The Ajax/RPC layer is one of the more fragile parts of web applications. Often, you have your various Ajax endpoints written once on the server, have a set of routes written to connect those Ajax endpoints to URLs, and client code (traditionally Javascript) made calls to those URLs with "raw" data: basically whatever you wanted, packed in an ad-hoc mix of CSV and JSON and raw-strings.
+
+ @p
+ This has always been annoying boilerplate, and Scala.js removes it. With @lnk.github.uPickle, you can simply call @hl.scala{upickle.write(...)} and @hl.scala{upickle.read[T](...)} to convert your collections, primitives or case-classes to and from JSON. This means you do not need to constantly re-invent different ways of making Ajax calls: you can just fling the data right across the network from client to server and back again.
+
+@sect{What's Left?}
+ @p
+ We've built a small client-server web application with a Scala.js web-client that makes Ajax calls to a Scala-JVM web-server running on Spray. We performed these Ajax calls using uPickle to serialize the data back and forth, so serializing the arguments and return-value was boilerplate-free and correct.
+
+ @p
+ However, there is still some amount of duplication in the code. In particular, the definition of the endpoint name "list" is duplicated 4 times:
+
+ @hl.ref("examples/crossBuilds/clientserver/server/src/main/scala/simple/Server.scala", """path("ajax" / "list")""", "")
+ @hl.ref("examples/crossBuilds/clientserver/server/src/main/scala/simple/Server.scala", "list(", "")
+ @hl.ref("examples/crossBuilds/clientserver/server/src/main/scala/simple/Server.scala", "def list", "")
+ @hl.ref("examples/crossBuilds/clientserver/client/src/main/scala/simple/Client.scala", "ajax/list", "")
+
+ @p
+ Three times on the server and once on the client! What's worse, two of the appearances of @hl.scala{"list"} are in string literals, which are not checked by the compiler to match up with themselves or the name of the method @hl.scala{list}. Apart from this, there is one other piece of duplication that is unchecked: the type being returned from @hl.scala{list} (@hl.scala{Seq[FileData]}) is being repeated on the client in @hl.scala{upickle.read[Seq[FileData]]} in order to de-serialize the serialized data. This leaves three opportunities for error wide-open:
+
+ @ul
+ @li
+ You could change the string literals @hl.scala{"list"} and forget to change the method-name @hl.scala{list}, thus confusing future maintainers of the code.
+ @li
+ You could change one of literal @hl.scala{"list"}s but forget to change the other, thus causing an error at run-time (e.g. a 404 NOT FOUND response)
+ @li
+ You could update the return type of the @hl.scala{list} method and forget to update the @hl.scala{upickle.read} deserialization call on the client, resulting in a deserialization failure at runtime.
+
+ @p
+
+ @p
+ Neither of these scenarios is great! Although we've already made great progress in making our client-server application type-safe (via Scala.js on the client) and DRY (via shared code in @code{shared/}) we still have this tiny bit of annoying, un-checked duplication and danger lurking in the code-base. The basic problem is that what is normally called the "routing layer" in the web application is still unsafe, and so these silly errors can go un-caught and blow up on unsuspecting developers at run-time. Let's see how we can fix it.
+
+@sect{Autowire}
+
+ @p
+ @lnk("Autowire", "https://github.com/lihaoyi/autowire") is a library that turns your request routing layer from a fragile, hand-crafted mess into a solid, type-checked, boilerplate-free experience. Autowire basically turns what was previously a stringly-typed, hand-crafted Ajax call and route:
+
+ @hl.ref("examples/crossBuilds/clientserver/client/src/main/scala/simple/Client.scala", "ajax/list", "")
+
+ @p
+ Into a safe, type-checked function call:
+
+ @hl.ref("examples/crossBuilds/clientserver2/client/src/main/scala/simple/Client.scala", ".call()", "")
+
+ @p
+ Let's see how we can do that.
+
+ @sect{Setting up Autowire}
+
+ @p
+ To begin with, Autowire requires you to provide three things:
+
+ @ul
+ @li
+ An @hl.scala{autowire.Server} on the Server, set up to feed the incoming request into Autowire's routing logic
+ @li
+ An @hl.scala{autowire.Client} on the Client, set up to take a serialized request and send it across the network to the server.
+ @li
+ An interface (A Scala @hl.scala{trait}) which defines the interface between these two
+
+ @p
+ Let's start with our client-server interface definition
+
+ @hl.ref("examples/crossBuilds/clientserver2/client/shared/main/scala/simple/Shared.scala")
+
+ @p
+ Here, you can see that in addition to sharing the @hl.scala{FileData} class, we are also creating an @hl.scala{Api} trait which contains the signature of our @hl.scala{list} method. The exact name of the trait doesn't matter. We need it to be in @code{shared/} so that the code in both client and server can reference it.
+
+ @p
+ Next, let's look at modifying our server code to make use of Autowire:
+
+ @hl.ref("examples/crossBuilds/clientserver2/server/src/main/scala/simple/Server.scala")
+
+ @p
+ Now, instead of hard-coding the route @hl.scala{"ajax" / "list"}, we now take in any route matching @hl.scala{"ajax" / Segments}, feeding the resultant path segments into the @hl.scala{Router} object:
+
+ @hl.ref("examples/crossBuilds/clientserver2/server/src/main/scala/simple/Server.scala", "path(")
+ @p
+ The @hl.scala{Router} object in turn simply defines how you intend the objects to be serialized and deserialized:
+
+ @hl.ref("examples/crossBuilds/clientserver2/server/src/main/scala/simple/Server.scala", "object Router", "object Server")
+
+ @p
+ In this case using uPickle. Note how the @hl.scala{route} call explicitly states the type (here @hl.scala{Api}) that it is to generate routes against; this ensures that only methods which you explicitly put in your public interface @hl.scala{Api} are publically reachable.
+
+ @p
+ Next, let's look at the modified client code:
+
+ @hl.ref("examples/crossBuilds/clientserver2/client/src/main/scala/simple/Client.scala")
+
+ @p
+ There are two main modifications here: the existence of the new @hl.scala{Ajaxer} object, and the modification to the Ajax call-site. Let's first look at @hl.scala{Ajaxer}:
+
+ @hl.ref("examples/crossBuilds/clientserver2/client/src/main/scala/simple/Client.scala", "object Ajaxer", "@JSExport")
+
+ @p
+ Like the @hl.scala{Router} object, @hl.scala{Ajaxer} also defines how you perform the serialization and deserialization of data-structures, again using uPickle. Unlike the @hl.scala{Router} object, @hl.scala{Ajaxer} also defines how the out-going Ajax call gets sent over the network. Here we're doing it using the @hl.scala{Ajax.post} method.
+
+ @p
+ Lastly, let's look at the modified callsite for the ajax call itself:
+
+ @hl.ref("examples/crossBuilds/clientserver2/client/src/main/scala/simple/Client.scala", "def update", "")
+
+ @p
+ There are a few things of note here:
+
+ @ul
+ @li
+ The previous call to @hl.scala{Ajax.post} with the path as a string has been replaced by calling @hl.scala{Ajaxer[Api].list(...).call()}, since the logic of actually performing the POST is specified once-and-only-once in the @hl.scala{Ajaxer} object.
+ @li
+ While @hl.scala{Ajax.post} returned a @hl.scala{Future[dom.XMLHttpRequest]} and left us to call @hl.scala{upickle.read} and deserialize the data ourselves, @hl.scala{Ajaxer[Api].list(...).call()} now returns a @hl.scala{Future[Seq[FileData]]}! Thus we don't need to worry about making a mistake in the deserialization logic when we write it by hand.
+
+ @p
+ Other than that, nothing much has changed. If you've done this correctly, the web application will look and behave exactly as it did earlier! So why did we do this in the first place?
+
+ @sect{Why Autowire?}
+ @p
+ Overall, this set up requires some boilerplate to define the @hl.scala{Ajaxer} and @hl.scala{Router} objects, as well as the @hl.scala{Api} trait. However, these can be defined just once and used over and over; while it might be wasteful/unnecessary for making a single Ajax call, the cost is much less amortized over a number of Ajax calls. In a non-trivial web application with dozens of routes being called all over the place, spending a dozen lines setting up things up-front isn't a huge cost.
+
+ @p
+ What have we gotten in exchange? It turns out that by using Autowire, we have eliminated the three failure modes described earlier, that could:
+
+ @ul
+ @li
+ It is impossible for the route and the endpoint method-name to diverge accidentally: if the endpoint is called @hl.scala{list}, the requests will go through the @code{/list} URL. No room for discussion, or to make a mistake
+ @li
+ You cannot accidentally rename the route on the server without changing the client, or vice versa. Attempts to do so will cause a compilation error, and even your IDE should highlight it as red. Try it out!
+
+ @li
+ There is no chance of messing up the serialization/deserialization code, e.g. writing a response of type A on the server and trying to read a data-structure of type B on the client. You have no opportunity to make an error: you pass arguments to the Ajax call, and they are serialized/deserialized automatically, such that by the time you get access to the value on the server, it is already of the correct type! The same applies to serializing/deserializing the return-value on the client. There is simply no place for you as a developer to accidentally make a mistake!
+
+ @p
+ Although the functionality of the web application is the same, it is mostly in terms of @i{safety} that we have made the biggest gains. All of the common failure modes described earlier have been guarded against, and you as a developer will have a hard time trying to make a mal-formed Ajax call. It's worth taking some time to poke at the source code to see the boundaries of the type-safety provided by autowire, as it is a very different experience from the traditional "route it manually" approach to making interactive client-server applications.
+
+@hr
+
+@p
+ Hopefully this chapter has given you a glimpse of how a basic client-server application works using Scala.js. Although it is specific to a Spray server, there isn't any reason why you couldn't set up an equivalent thing for your Play, Scalatra or whichever other web framework that you're using.
+
+@p
+ It's probably worth taking a moment to play around with the existing client-server system you have set up. Ideas for improvement include:
+
+@ul
+ @li
+ Try adding additional functionality to the client-server interface: what about making it show the contents of a file if you've entered its full path? This can be added as a separate Ajax call or as part of the existing one.
+ @li
+ How about setting up the build.sbt so it serves the fully-optimized Scala.js blob, @code{client-opt.js}? This is probably what you want before deployment into production, and the same technique as we used to serve the fast-optimized version applies here too.
+ @li
+ What if you wanted to use another server rather than Spray? How about trying to set up a Play or Scalatra server to serve our Scala.js application code? \ No newline at end of file
diff --git a/book/src/main/scalatex/book/handson/CommandLine.scalatex b/book/src/main/scalatex/book/handson/CommandLine.scalatex
new file mode 100644
index 0000000..0663378
--- /dev/null
+++ b/book/src/main/scalatex/book/handson/CommandLine.scalatex
@@ -0,0 +1,173 @@
+
+@p
+ We've by this point done a bunch of work in the browser: we've made a small game that runs in the web browser on the HTML5 canvas, and we've made a number of small web-apps that interact with HTML and 3rd party web-services. However, there's a whole other side to the Scala.js ecosystem: the command line interace, or CLI.
+
+@p
+ Even though the goal of Scala.js is to get your code running in peoples' browsers, it still is useful to be familiar with the things that you can do in the command-line. It is much easier to write-code-print-results in the command line without having to set up a HTML page and opening a browser to test it, and this extends to things like unit test suites, which are almost exclusively run in the command-line using @code{sbt ~test} to keep re-running them when the code changes.
+
+@p
+ The Scala.js command line is where you go to do things to your Scala.js code. Although Scala.js comes with @lnk("standalone executables", "http://www.scala-js.org/downloads.html") that can be used from any shell (sh, bash, zsh, etc.) the primary supported way of setting up, compiling and testing your Scala.js applications is through @lnk("SBT", "http://www.scala-sbt.org/"): Scala's primary build tool.
+
+@p
+ You've already used fragments of the Scala.js CLI in earlier chapters of this book: @code{~fastOptJS} is what you used for development, @code{fullOptJS} for publishing. Apart from these, Scala.js allows you to execute code via @lnk.misc.Rhino/@lnk.misc.Nodejs/@lnk.misc.PhantomJS from the command-line, as well as running test-suites under the same conditions. This chapter will go deeper into the various things you can do with the Scala.js command line:
+
+@ul
+ @li
+ @code{compile}: converting code from Scala source into not-yet-executable Scala.js IR
+ @li
+ @code{package}: bundling up our Scala.js IR into a @code{.jar} file, for publishing or distribution as a library
+ @li
+ @code{fastOptJS}: aggregating our Scala.js IR and converting it to a @code{.js} executable.
+ @li
+ @code{fullOptJS}: aggregating our Scala.js IR and converting it to a smaller, faster @code{.js} executable.
+ @li
+ @code{run}: run your compiled Scala.js code as Javascript in Rhino, Node.js or Phantom.js
+ @li
+ @code{test}: run your compiled Scala.js code as a test suite in Rhino, Node.js or Phantom.js
+
+@p
+ Now, let's open up your SBT console in your Scala.js app
+
+@hl.bash
+ >
+
+@p
+ And let's get started!
+
+@sect{Commands}
+ @p
+ The most fundamental thing you can do in the Scala.js CLI is to compile your code. Let's go through the various mechanisms of "compiling" things:
+
+ @sect{The compile Command}
+ @hl.bash
+ > compile
+
+ @p
+ Just as you can @code{compile} Scala-JVM projects, you can also @code{compile} Scala.js projects. Like compiling Scala-JVM projects, this leaves a bunch of @code{.class} files in your @code{target} directory. Unlike Scala-JVM projects, this also leaves a bunch of @code{.sjsir} files, which correspond to your Scala.js output files:
+
+ @hl.bash
+ classes
+ └── example
+ ├── Point$.class
+ ├── Point$.sjsir
+ ├── Point.class
+ ├── Point.sjsir
+ ├── ScalaJSExample$$anonfun$main$1.class
+ ├── ScalaJSExample$$anonfun$run$1.class
+ ├── ScalaJSExample$.class
+ ├── ScalaJSExample$.sjsir
+ └── ScalaJSExample.class
+
+ @p
+ However, unlike on Scala-JVM, you cannot directly run the @code{.sjsir} files spat out by the Scala.js compiler. These files are an Intermediate Representation, which needs to go through the next step in the compilation pipeline before being turned into Javascript.
+
+ @sect{The package Command}
+ @hl.bash
+ > package
+ @p
+ Also like on Scala-JVM, Scala.js also supports the @code{package} command. This command generates a @code{.jar} like it does in Scala-JVM, except this version appends this weird @code{_sjs0.5} suffix.
+
+ @hl.bash
+ target/scala-2.11/
+ └── example_sjs0.5_2.11-0.1-SNAPSHOT.jar
+
+ @p
+ The purpose of this suffix is to link the compiled @code{.jar} file to the version of Scala.js used to compile it. This allows you to make sure that you don't accidentally depend on a version of a jar that is incompatible with your current version.
+
+ @p
+ Again, unlike Scala-JVM, these @code{.jar} files are not directly executable: the @code{.sjsir} files need further processing to turn into runnable Javascript. Instead, their sole purpose is to hold bundles of @code{.sjsir} files to be published and depended-upon: they can be @code{publishLocal}ed to be used by other projects on your computer, or @code{publishSigned}ed to @lnk("Maven Central", "http://search.maven.org/"), just like any Scala-JVM project.
+
+ @sect{The fastOptJS Command}
+ @hl.bash
+ > fastOptJS
+ @p
+ @code{fastOptJS} is a command we've used in earlier chapters. It basically runs the @sect.ref{Fast Optimization} stage of the compilation pipeline. This results in a moderately-sized executable, which you can then load in the browser with a @hl.html{<script>} tag and run.
+
+ @p
+ This is the first phase which actually results in an executable blob of Javascript. I won't go into much detail about this command: you've used it before, and more details about the particular kind of optimization and how it fits into the large process is available in the chapter on The Compilation Pipeline. Nonetheless, it's fast, produces not-too-huge output code, and is what you typically use for iterative development in the browser.
+
+ @sect{The fullOptJS Command}
+ @hl.bash
+ > fullOptJS
+ @p
+ @code{fullOptJS} is another command that we've seen before: it performs an aggressive, somewhat slower @sect.ref{Full Optimization} pass on the generated Javascript. This results in a much smaller executable Javascript blob, which you can also load via a @hl.html{<script>} tag and run.
+ @p
+ Again, I won't go into much details, as exactly what this optimization does is described in the chapter on the Compilation Pipeline. This command is somewhat too-slow to be running during iterative development, and is instead typically used just before deployment to minimize the size of the file your users have to download.
+
+ @sect{The run Command}
+ @hl.bash
+ > run
+ @p
+ Here's something you haven't seen before: the @code{run} command gives you the ability to run a Scala.js program from the command line. This prints its output to standard output (i.e. the terminal). Like Scala-JVM, you need a @code{main} method to run to kick off your program. Unlike Scala-JVM, the main method is marked on an @hl.scala{object} which @hl.scala{extends scala.scalajs.js.JSApp}, e.g.
+
+ @hl.scala
+ // src/main/scala/RunMe.scala
+ object RunMe extends scala.scalajs.js.JSApp{
+ def main(): Unit = {
+ println("Hello World!")
+ println("In Scala.js, 1/0 is ${1/0}!")
+ }
+ }
+
+ @p
+ Running @code{sbt run} with the above Scala.js code will print out
+
+ @hl.bash
+ Hello World!
+ In Scala.js, 1/0 is 0!
+
+ @p
+ This exhibits the weirdness of integer divide-by-zero in Scala.js, which is one of the few ways in which @sect.ref("Deviations from Scala-JVM", "Scala.js deviates from Scala-JVM"). This also shows us we're really running on Scala.js: on Scala-JVM, integer divide-by-zero throws an exception rather than returning zero!
+
+ @p
+ One thing you may be wondering is: when you run a Scala.js program in the terminal, how does it execute the output Javascript? What about the DOM? and Ajax calls? Can it access the filesystem? The answer to all these questions is "it depends": it turns out there are multiple ways you can run Scala.js from the command-line:
+
+ @ul
+ @li
+ @b{Rhino} using @code{sbt run}
+ @li
+ @b{Node.js} using @code{sbt fastOptStage::run} or @code{sbt fullOptStage::run}, having installed Node.js separately
+ @li
+ @b{PhantomJS} using @code{sbt fastOptStage::run} or @code{sbt fullOptStage::run}, having installed PhantomJS separately, and turned on @hl.scala{requiresDOM := true} in SBT
+
+ @p
+ Typically, the best way to get started is using Rhino and @code{sbt run}, since it's setup-free, and setting up Node.js or PhantomJS later as necessary. The next two sections elaborate on the differences between these ways of running your code. Check out the later sections on @sect.ref{Headless Runtimes} and @sect.ref{Run Configurations} to learn more about the other settings and why you would want to use them.
+
+ @sect{The test Command}
+ @hl.bash
+ > test
+
+ @p
+ The @code{sbt test} command behaves very similar to @code{sbt run}. It can also be prefixed e.g. @code{sbt fastOptStage::run} or @code{sbt fullOptStage::run}, or run in either Rhino, Node.js or PhantomJS.
+ @p
+ The difference is that instead of simply running your @code{main} method, @code{sbt test} runs whatever test-suite you have set-up, which will look through your @code{tests/} folder to find suites of tests it has to run, and aggregate the results formatted nicely for you to see. The exact operation of this depends on which testing library you're using
+ @p
+ We won't spend much time talking about @code{sbt test} here. Not because it's not important: it most certainly is! Rather, we will be spending a good amount of time setting up tests in @sect.ref("Cross Publishing Libraries", "the next chapter"), so feel free to jump ahead if you want to see an example usage of @code{sbt test}.
+
+@sect{Headless Runtimes}
+ @ul
+ @li
+ @lnk.misc.Rhino is the default way of running Scala.js applications, and occurs when you hit @code{sbt run} from the terminal. The upside of using Rhino is that it is pure-Java, and doesn't need any additional binaries or installation. The downside of using Rhino is that it is slow: maybe a hundred times slower than the alternatives, making it not suitable for running long-running, compute-intensive programs. Furthermore, it's a very sparse runtime environment, with no DOM access or similar.
+ @li
+ @lnk.misc.Nodejs, a relatively new Javascript runtime based on Google's V8 Javascript engine, Node.js lets you run your Scala.js application from the command line much faster than in Rhino, with performance that matches that of modern browsers. However, you need to separately @lnk("install Node.js", "http://nodejs.org/download/") in order to use it. Like Rhino, it comes with a bare-minimal runtime environment, with no DOM or browser-related functionality. You need to run @code{sbt fastOptStage::run} to run using Node.js.
+ @li
+ @lnk.misc.PhantomJS is a headless Webkit browser. This means that unlike Node.js or Rhino, PhantomJS provides you with a full DOM and all its APIs to use in your tests, if you wish to e.g. test interactions with the HTML of the web page. On the other hand, it is somewhat slower than Node.js, though still much faster than Rhino. Like Node.js, it needs to be installed separately. You need to run You need to run @code{sbt fastOptStage::run}, as well as setting the @hl.scala{requiresDOM := true} flag in your SBT configuration, to use PhantomJS.
+ @p
+ These are your three options to run your Scala.js code via the command-line. Generally, it's easiest to get started with Rhino since it's the default and requires no setup, though you may find it worthwhile to setup Node or Phantom if you need additional speed or DOM-integration in your runs.
+
+@sect{Run Configurations}
+ @p
+ You may have noticed that in Rhino we use @code{sbt run}, whereas for Node.js or PhantomJS we use @code{sbt fastOptStage::run}. It turns out that similar to the split between @code{fastOptJS}/@code{fullOptJS}, you have a range of options of how you want to prepare your Scala.js code for execution from the command line:
+
+ @ul
+ @li
+ @code{sbt run}: this does not perform any optimization of the output Scala.js files, and does lazy-loading to minimize the amount of files being loading into the interpreter. This is necessary for Rhino because it can't handle large blobs of Javascript, but doesn't map to any compilation mode you'd use for the browser.
+ @li
+ @code{sbt fastOptStage::run}: this performs the same compilation and optimization as @code{sbt fastOptJS}, as described under Fast Optimizations. It then takes the entire output executable (which probably weighs around 1mb) and hands it to Node.js or PhantomJS, which then run it.
+ @li
+ @code{sbt fullOptStage::run}: this performs the same compilation and optimization as @code{sbt fullOptJS}, as described under Full Optimizations. This takes longer to run than @code{sbt fastOptStage::run}, and results in a smaller/faster executable. Practically speaking, this size/speed advantage does not matter from the command line, but @code{fullOptStage::run} is still useful to verify that the behavior does not change (it shouldn't!) under the aggressive full optimization.
+
+@hr
+
+@p
+ Hopefully by this point you more-or-less know your way around the Scala.js command-line tools. As mentioned earlier, command line tools make it much easier to run a bunch of Scala.js code, e.g. unit tests, without having to muck around with HTML pages or refreshing the browser. That will come in handy soon, as we're next going to learn to publish a standalone, distributable Scala.js module. And what's a module without tests... \ No newline at end of file
diff --git a/book/src/main/scalatex/book/handson/GettingStarted.scalatex b/book/src/main/scalatex/book/handson/GettingStarted.scalatex
new file mode 100644
index 0000000..5d9bf7b
--- /dev/null
+++ b/book/src/main/scalatex/book/handson/GettingStarted.scalatex
@@ -0,0 +1,326 @@
+
+@p
+ To get started with Scala.js, you will need to prepare a few things:
+
+@ul
+ @li
+ @lnk("sbt", "http://www.scala-sbt.org/"): SBT is the most common build-tool in the Scala community, and is what we will use for building our Scala.js application. Their home page has a link to download and install it. (If you are already using Typesafe Activator, that is effectively sbt.)
+ @li
+ An editor for Scala: @lnk("IntelliJ Scala", "http://blog.jetbrains.com/scala/") and @lnk("Eclipse ScalaIDE", "http://scala-ide.org/") are the most popular choices and work on all platforms, though there are others.
+ @li
+ @lnk("Git", "http://git-scm.com/"): This is a version-control system that we will use to download and manage our Scala.js projects.
+ @li
+ A terminal: on OSX you have @lnk("Terminal.app", "http://guides.macrumors.com/Terminal") already installed, in Linux you have @lnk("Terminal", "https://help.ubuntu.com/community/UsingTheTerminal"), and on Windows you have @lnk("PowerShell", "http://en.wikipedia.org/wiki/Windows_PowerShell").
+ @li
+ Your favorite web browser: @lnk("Chrome", "https://www.google.com/chrome") and @lnk("Firefox", "https://www.mozilla.org/en-US/firefox") are the most popular.
+
+@p
+ If you've worked with Scala before, you probably already have most of these installed. Otherwise, take a moment to download them before we get to work.
+
+@p
+ The quickest way to get started with Scala.js is to @code{git clone} @lnk("workbench-example-app", "https://github.com/lihaoyi/workbench-example-app"), go into the repository root, and run @code{~fastOptJS}
+
+@hl.bash
+ git clone https://github.com/lihaoyi/workbench-example-app
+ cd workbench-example-app
+ sbt ~fastOptJS
+
+@p
+ This should result in a bunch of spam to the console, and may take a few minutes the first time as SBT resolves and downloads all necessary dependencies. A successful run looks like this
+
+@pre
+ haoyi-mbp:Workspace haoyi$ git clone https://github.com/lihaoyi/workbench-example-app
+ Cloning into 'workbench-example-app'...
+ remote: Counting objects: 876, done.
+ remote: Total 876 (delta 0), reused 0 (delta 0)
+ Receiving objects: 100% (876/876), 676.59 KiB | 317.00 KiB/s, done.
+ Resolving deltas: 100% (308/308), done.
+ Checking connectivity... done.
+ haoyi-mbp:Workspace haoyi$ cd workbench-example-app/
+ haoyi-mbp:workbench-example-app haoyi$ sbt ~fastOptJS
+ [info] Loading global plugins from /Users/haoyi/.sbt/0.13/plugins
+ [info] Updating {file:/Users/haoyi/.sbt/0.13/plugins/}global-plugins...
+ [info] Resolving org.fusesource.jansi#jansi;1.4 ...
+ [info] Done updating.
+ [info] Loading project definition from /Users/haoyi/Dropbox (Personal)/Workspace/workbench-example-app/project
+ [info] Updating {file:/Users/haoyi/Dropbox%20(Personal)/Workspace/workbench-example-app/project/}workbench-example-app-build...
+ [info] Resolving org.fusesource.jansi#jansi;1.4 ...
+ [info] Done updating.
+ [info] Set current project to Example (in build file:/Users/haoyi/Dropbox%20(Personal)/Workspace/workbench-example-app/)
+ [INFO] [10/26/2014 15:42:09.791] [SystemLol-akka.actor.default-dispatcher-2] [akka://SystemLol/user/IO-HTTP/listener-0] Bound to localhost/127.0.0.1:12345
+ [info] Updating {file:/Users/haoyi/Dropbox%20(Personal)/Workspace/workbench-example-app/}workbench-example-app...
+ [info] Resolving jline#jline;2.12 ...
+ [info] Done updating.
+ [info] Compiling 1 Scala source to /Users/haoyi/Dropbox (Personal)/Workspace/workbench-example-app/target/scala-2.11/classes...
+ [info] Fast optimizing /Users/haoyi/Dropbox (Personal)/Workspace/workbench-example-app/target/scala-2.11/example-fastopt.js
+ [info] workbench: Checking example-fastopt.js
+ [info] workbench: Refreshing http://localhost:12345/target/scala-2.11/example-fastopt.js
+ [success] Total time: 11 s, completed Oct 26, 2014 3:42:21 PM
+ 1. Waiting for source changes... (press enter to interrupt)
+
+@p
+ The line @code{Waiting for source changes...} is telling you that your Scala.js program is ready! Now, when you go to the web URL @code{http://localhost:12345/target/scala-2.11/classes/index-dev.html} in your browser, you should see the following:
+
+ @img(src:="images/Hello World.png", maxWidth:="100%")
+
+@p
+ Congratulations, you just built and ran your first Scala.js application! If something here does not happen as expected, it means that one of the steps did not complete successfully. Make sure you can get this working before you proceed onward.
+
+@sect{Opening up the Project}
+
+ @p
+ The next thing to do once you have the project built and running in your browser is to load it into your editor. Both IntelliJ and Eclipse should let you import the Scala.js project without any hassle. Opening it and navigating to @code{ScalaJSExample.scala} would look like this:
+
+ @img(src:="images/IntelliJ Hello.png", maxWidth:="100%")
+
+ @p
+ Let's try changing one line to change the background fill from black to white:
+
+ @hl.diff
+ - ctx.fillStyle = "black"
+ + ctx.fillStyle = "white"
+
+ @p
+ Because we started @code{sbt ~fastOptJS} with the @code{~} prefix earlier, it should pick up the change and automatically recompile. The example project is set up to automatically refresh the page when recompilation is complete.
+
+ @img(src:="images/Hello World White.png", maxWidth:="100%")
+
+ @p
+ If you open up your browser's developer console, you'll see that the SBT log output is being mirrored there:
+
+ @img(src:="images/Hello World Console.png", maxWidth:="100%")
+
+ @p
+ Apart from the SBT log output (which is handled by Workbench) any @hl.scala{println}s in your Scala.js code will also end up in the browser console (the @code{main} you see in the console is printed inside the Scala.js application, see if you can find it!) and so will the stack traces for any thrown exceptions.
+
+@sect{The Application Code}
+
+ @p
+ We've downloaded, compiled, ran, and made changes to our first Scala.js application. Let's now take a closer look at the code that we just ran:
+
+ @hl.ref("output/workbench-example-app/src/main/scala/example/ScalaJSExample.scala")
+
+ @p
+ It's a good chunk of code, though not a huge amount. To someone who didn't know about Scala.js, they would just think it's normal Scala, albeit with this unusual @hl.scala{dom} library and a few weird annotations. Let's pick it apart starting from the top:
+
+ @hl.ref("output/workbench-example-app/src/main/scala/example/ScalaJSExample.scala", "case class Point", "@JSExport")
+
+ @p
+ Here we are defining a @hl.scala{Point} case class which represents a X/Y position, with some basic operators defined on it. This is done mostly for convenience later on, when we want to manipulate these two-dimensional points. Scala.js is Scala, and supports the entirety of the Scala language. @hl.scala{Point} here behaves identically as it would if you had run Scala on the JVM.
+
+ @hl.ref("output/workbench-example-app/src/main/scala/example/ScalaJSExample.scala", "@JSExport", "val ctx")
+
+ @p
+ This @hl.scala("@JSExport") annotation is used to tell Scala.js that you want this method to be visible and callable from Javascript. By default, Scala.js does @sect.ref("Fast Optimization", "dead code elimination") and removes any methods or classes which are not used. This is done to keep the compiled executables a reasonable size, since most projects use only a small fraction of e.g. the standard library. @hl.scala("@JSExport") is used to tell Scala.js that the @hl.scala{ScalaJSExample} object and its @hl.scala{def main} method are entry points to the program. Even if they aren't called anywhere internally, they are called externally by Javascript that the Scala.js compiler is not aware of, and should not be removed. In this case, we are going to call this method from Javascript to start the Scala.js program.
+
+ @p
+ Apart from this annotation, @hl.scala{ScalaJSExample} is just a normal Scala @hl.scala{object}, and behaves like one in every way. Note that the main-method in this case takes a @lnk.dom.HTMLCanvasElement: your exported methods can have any signature, with arbitrary arity or types for parameters or the return value. This is in contrast to the main method on the JVM which always takes an @hl.scala{Array[String]} and returns @hl.scala{Unit}. In fact, there's nothing special about this method at all! It's like any other exported method, we just happen to attribute it the "main" entry point. It is entirely possible to define multiple exported classes and methods, and build a "library" using Scala.js of methods that are intended for external Javascript to use.
+
+ @hl.ref("output/workbench-example-app/src/main/scala/example/ScalaJSExample.scala", "val ctx", "var count")
+
+ @p
+ Here we are retrieving a handle to the canvas we will draw on using @hl.scala{document.getElementById}, and from it we can get a @lnk.dom.CanvasRenderingContext2D which we actually use to draw on it.
+
+ @p
+ @hl.scala{document.getElementById} is the exact same API that's used in normal Javascript, as documented @lnk("here", "https://developer.mozilla.org/en-US/docs/Web/API/document.getElementById"). In fact, the entire @hl.scala{org.scalajs.dom} namespace (imported at the top of the file) comprises statically typed facades for the javascript APIs provided by the browser.
+
+ @p
+ We need to perform the @hl.scala{asInstanceOf} call because depending on what you pass to @hl.scala{getElementById} and @hl.scala{getContext}, you could be returned elements and contexts of different types. Hence we need to tell the compiler explicitly that we're expecting a @lnk.dom.HTMLCanvasElement and @lnk.dom.CanvasRenderingContext2D back from these methods for the strings we passed in.
+
+ @hl.ref("output/workbench-example-app/src/main/scala/example/ScalaJSExample.scala", "def run", "dom.setInterval")
+
+ @p
+ This is the part of the Scala.js program which does the real work. It runs 10 iterations of a @lnk("small algorithm", "http://en.wikipedia.org/wiki/Sierpinski_triangle#Chaos_game") that generates a Sierpinski Triangle point-by-point. The steps, as described by the linked article, are roughly:
+
+ @ul
+ @li
+ Pick a random corner of the large-triangle
+ @li
+ Move your current-position @hl.scala{p} halfway between its current location and that corner
+ @li
+ Draw a dot
+ @li
+ Repeat
+
+ @p
+ In this example, the triangle is hard-coded to be 255 pixels high by 255 pixels wide, and some math is done to pick a color for each dot which will give the triangle a pretty gradient.
+
+ @hl.ref("output/workbench-example-app/src/main/scala/example/ScalaJSExample.scala", "dom.setInterval")
+
+ @p
+ Now this is the call that actually does the useful work. All this method does is call @hl.scala{dom.setInterval}, which tells the browser to run the @hl.scala{run} method every 50 milliseconds. As mentioned earlier, the @hl.scala{dom.*} methods are simply facades to their native Javascript equivalents, and @hl.scala{dom.setInterval} is @lnk("no different", "https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers.setInterval"). Note how you can pass a Scala lambda to @hl.scala{setInterval} to have it called by the browser, where in Javascript you'd need to pass a Javascript @hl.javascript{function(){...}}
+
+@sect{The Project Code}
+
+ @p
+ We've already taken a look at the application code for a simple, self-contained Scala.js application, but this application is not @i{entirely} self contained. It's wrapped in a small SBT project that sets up the necessary dependencies and infrastructure for this application to work.
+
+ @sect{project/build.sbt}
+ @hl.ref("output/workbench-example-app/project/build.sbt")
+
+ @p
+ This is the list of SBT plugins used by this small example application. There are two of them: the Scala.js plugin (which contains the Scala.js compiler and other things, e.g. tasks such as @code{fastOptJS}) and the @lnk("Workbench", "https://github.com/lihaoyi/workbench") plugin, which is used to provide the auto-reload-on-change behavior and the forwarding of SBT logspam to the browser console.
+
+ @p
+ Of the two, only the Scala.js plugin is really necessary. The Workbench plugin is a convenience that makes development easier. Without it you'd need to keep a terminal open to view the SBT logspam, and manually refresh the page when compilation finished. Not the end of the world.
+
+
+ @sect{build.sbt}
+ @hl.ref("output/workbench-example-app/build.sbt")
+
+ @p
+ The @code{build.sbt} project file for this application is similarly unremarkable: It includes the settings for the two SBT plugins we saw earlier, as well as boilerplate @hl.scala{name}/@hl.scala{version}/@hl.scala{scalaVersion} values common to all projects.
+
+ @p
+ Of interest is the @hl.scala{libraryDependencies}. In Scala-JVM, this key is used to declare dependencies on libraries from Maven Central, so you can use them in your Scala-JVM projects. In Scala.js, the same key is used to declare dependencies on libraries so you can use them in your Scala.js projects! Re-usable libraries can be built and published with Scala.js just as you do on Scala-JVM, and here we make use of one which provides the typed facades with which we used to access the DOM in the application code.
+
+ @p
+ Lastly, we have two Workbench related settings: @hl.scala{bootSnippet} basically tells Workbench how to restart your application when a new compilation run finishes, and @hl.scala{updateBrowsers} actually tells it to perform this application-restarting.
+
+ @sect{src/main/resources/index-dev.html}
+ @hl.ref("output/workbench-example-app/src/main/resources/index-dev.html")
+
+ @p
+ This is the HTML page which our toy app lives in, and the same page that we have so far been using to view the app in the browser. To anyone who has used HTML, most of it is probably familiar. Things of note are the @hl.html{<script>} tags: @hl.scala{"../example-fastopt.js"} Is the executable blob spat out by the compiler, which we need to include in the HTML page for anything to happen. This is where the results of your compiled Scala code appear. @hl.scala{"workbench.js"} is the client for the Workbench plugin that connects to SBT, reloads the browser and forwards logspam to the browser console.
+
+ @p
+ The @hl.scala{ScalaJSExample().main()} call is what kicks off the Scala.js application and starts its execution. Scala.js follows Scala semantics in that @hl.scala{object}s are evaluated lazily, with no top-level code allowed. This is in contrast to Javascript, where you can include top-level statements and object-literals in your code which execute immediately. In Scala.js, nothing happens when @code{../example-fastopt.js} is imported! We have to call the main-method first. In this case, we're passing the canvas object (attained using @hl.javascript{getElementById}) to it so it knows where to do its thing.
+
+ @p
+ Lastly, only @hl.scala("@JSExport")ed objects and methods can be called from Javascript. Also, although this example only exports the @hl.scala{main} method which is called once, there is nothing stopping you from exporting any number of objects and methods and calling them whenever you need to. In this way, you can easily make a Scala.js "library" which is available to external Javascript as an API.
+
+@sect{Publishing}
+ @p
+ The last thing that we'll do with our toy application is to publish it. If you look in the @code{target/scala2.11} folder, you'll see the output of everything we've done so far:
+
+ @hl.bash
+ target/scala-2.11
+ ├── classes
+ │   ├── JS_DEPENDENCIES
+ │   ├── example
+ │   │   ├── Point$.class
+ │   │   ├── Point$.sjsir
+ │   │   ├── Point.class
+ │   │   ├── Point.sjsir
+ │   │   ├── ScalaJSExample$$anonfun$main$1.class
+ │   │   ├── ScalaJSExample$$anonfun$run$1.class
+ │   │   ├── ScalaJSExample$.class
+ │   │   ├── ScalaJSExample$.sjsir
+ │   │   └── ScalaJSExample.class
+ │   ├── index-dev.html
+ │   └── index-opt.html
+ ├── example-fastopt.js
+ └── example-fastopt.js.map
+
+ @p
+ All the @code{.class} and @code{.sjsir} files are the direct output of the Scala.js compiler, and aren't necessary to actually run the application. The only two files necessary are @code{index-dev.html} and @code{example-fastopt.js}. You may recognize @code{index-dev.html} as the file that we were navigating to in the browser earlier.
+
+ @p
+ These two files can be extracted and published as-is: you can put them on @lnk("Github-Pages", "https://pages.github.com/"), @lnk("Amazon Web Services", "http://docs.aws.amazon.com/gettingstarted/latest/swh/website-hosting-intro.html"), or a hundred other places. However, one thing of note is the fact that the generated Javascript file is quite large:
+
+ @hl.bash
+ haoyi-mbp:temp haoyi$ du -h target/scala-2.11/example-fastopt.js
+ 856K target/scala-2.11/example-fastopt.js
+
+ @p
+ 856 Kilobytes for a hello world app! That is clearly too large. If you examine the contents of the file, you'll see that your code has been translated into something like this:
+
+ @hl.javascript
+ var i$2 = i;
+ if (((ScalaJS.m.Lexample_ScalaJSExample().count$1 % 30000) === 0)) {
+ ScalaJS.m.Lexample_ScalaJSExample().clear__V()
+ };
+ ScalaJS.m.Lexample_ScalaJSExample().count$1 = ((ScalaJS.m.Lexample_ScalaJSExample().count$1 + 1) | 0);
+ var jsx$3 = ScalaJS.m.Lexample_ScalaJSExample();
+ var jsx$2 = ScalaJS.m.Lexample_ScalaJSExample().p$1;
+ var jsx$1 = ScalaJS.m.Lexample_ScalaJSExample().corners$1;
+ var this$5 = ScalaJS.m.s_util_Random();
+ jsx$3.p$1 = jsx$2.$$plus__Lexample_Point__Lexample_Point(ScalaJS.as.Lexample_Point(jsx$1.apply__I__O(this$5.self$1.nextInt__I__I(3)))).$$div__I__Lexample_Point(2);
+ var height = (512.0 / ((255 + ScalaJS.m.Lexample_ScalaJSExample().p$1.y$1) | 0));
+ var r = ((ScalaJS.m.Lexample_ScalaJSExample().p$1.x$1 * height) | 0);
+ var g = ((((255 - ScalaJS.m.Lexample_ScalaJSExample().p$1.x$1) | 0) * height) | 0);
+
+ @p
+ As you can see, this code is still very verbose, with lots of unnecessarily long identifiers such as @hl.javascript{Lexample_ScalaJSExample} in it. This is because we've only performed the @sect.ref{Fast Optimization} on this file, to try and keep the time taken to edit -> compile while developing reasonably short.
+
+ @sect{Optimization}
+ @p
+ If we're planning on publishing the app for real, we can run the @sect.ref{Full Optimization}. This takes several seconds longer than the @sect.ref{Fast Optimization}, but results in a significantly smaller and leaner output file @code{example-opt.js}.
+
+ @hl.bash
+ haoyi-mbp:temp haoyi$ du -h target/scala-2.11/example-opt.js
+ 144K target/scala-2.11/example-opt.js
+
+ @p
+ 144 Kilobytes! Better. Not great, though! In general, Scala.js does not produce tiny executables, although the output size of the compiled executables is dropping all the time. If you look inside that file, you'll see all of the long identifiers have been replaced by short ones by the @lnk("Google Closure Compiler", "https://developers.google.com/closure/compiler/").
+
+ @hl.javascript("""
+ Rb(P(),N(r(L(Ea),["rgb(",", ",", ",")"])))),Sb(P(),r(L(K),[n,s,C])));fe().te.fillRect(fe().Oc.jc,fe().Oc.kc,1,1);e=e+1|0;c=c+k|0}},50))}ae.prototype.Zf=function(){this.te.fillStyle="black";this.te.fillRect(0,0,255,255)};ae.prototype.main=function(){return ee(),void 0};ae.prototype.a=new I({lj:0},!1,"example.ScalaJSExample$",K,{lj:1,b:1});var be=void 0;function fe(){be||(be=(new ae).c());return be}ba.ScalaJSExample=fe;function le(){}le.prototype=new J;function me(){}me.prototype=le.prototype;
+ """)
+
+ @p
+ These files are basically unreadable, but nonetheless behave the same as the @code{-fastopt} versions. Try it out by opening the @code{index-opt.html} file in the @code{target/scala-2.11/classes} directory with your browser: you should see the thing as when opening @code{index-dev}, except it will be pulling in the fully-optmized version of your application.
+
+ @p
+ This means you can develop and debug using @code{fastOptJS}, and only spend the extra time (and increased debugging-difficulty) on the @code{fullOptJS} version just as you're going to publish it, with the assurance that although the code is much more compact, its behavior will not change.
+
+ @sect{Blob Size}
+ @p
+ Even the fully-optimized version of our toy Scala.js app are pretty large. There are some factors that mitigate the large size of these executables:
+
+ @ul
+ @li
+ A large portion of this 144k is the Scala standard library, and so the size of the compiled blob does not grow that fast as your program grows. For example, while this ~50 line application is 144k, a @lnk("much larger ~2000 line application", "https://github.com/lihaoyi/roll") is only 288k.
+ @li
+ This size is pre-@lnk("gzip", "http://en.wikipedia.org/wiki/Gzip"), and most webservers serve their contents compressed via gzip to reduce the download size. Gzip cuts the actual download size down to 43k, which is more acceptable.
+ @li
+ You will likely have other portions of the page that are of similar size: e.g. @lnk("JQuery", "http://jquery.com/") is extremely popular, and weights in at a comparable 32kb minified and gzipped, while @lnk("React.js", "http://facebook.github.io/react/downloads.html") weighs in at a cool 150kb gzipped. Scala.js arguably provides more than either of these libraries.
+
+ @p
+ Regardless, there is ongoing work to shrink the size of these executables. If you want to read more about this, check out the section on @sect.ref("The Compilation Pipeline") to learn about what we currently do to crunch the executables down.
+
+ @hr
+
+ @p
+ In general, all the output of the Scala.js compiler is bundled up into the @code{example-fastopt.js} and @code{example-opt.js} files. As a first approximation, these files can be included directly on a HTML page (as we have here, with @code{index-dev.html} and @code{index-opt.html}) and published together as a working web app. Even zipping them up and emailing them to a friend is sufficient to give someone a working, live version of your hard work!
+
+ @p
+ More advanced users would want to integrate them into their build process or serve them from a web server, all of which is entirely possible. You just need to run the Scala.js compiler and place the output @code{.js} file somewhere your web server can pick it up, e.g. in some static-resource folder. We cover an example setup of this with a Scala webserver in our chapter @sect.ref("Integrating Client-Server").
+
+@sect{Recap}
+
+ @p
+ If you've made it this far, you've downloaded, made modifications to, and published a toy Scala.js application. At the same time, we've gone over many of the key concepts in the Scala.js development process:
+
+ @ul
+ @li
+ Getting a Scala.js application
+ @li
+ Building it and seeing it work in the browser
+ @li
+ Made modifications to it to see it update
+ @li
+ Examined the source code to try and understand what it's doing
+ @li
+ Examined the output code, at two levels of optimization, to see how the Scala.js compiler works
+ @li
+ Packaged the application in a form that can be easily published online
+
+ @p
+ Hopefully this gives a good sense of the workflow involved in developing a Scala.js application end-to-end, as well as a feel for the magic involved in the compilation process. Nevertheless, we have barely written any Scala.js code itself!
+
+ @p
+ Since you have a working development environment set up, you should take this time to poke around what you can do with our small Sierpinski-Triangle drawing app. Possible exercises include:
+
+ @ul
+ @li
+ Javascript includes APIs for @lnk("getting the size of the window", "http://stackoverflow.com/questions/1248081/get-the-browser-viewport-dimensions-with-javascript") and @lnk("changing the size of a canvas", "http://stackoverflow.com/questions/9251480/set-canvas-size-using-javascript"). These Javascript APIs are available in Scala.js, and we've already used some of them in the course of this example. Try making the Canvas full-screen, and re-positioning the corners of the triangle to match.
+ @li
+ The @lnk.dom.CanvasRenderingContext2D has a bunch of methods on it that can be used to draw things. Here we only draw 1x1 rectangles to put points on the canvas; try modifying the code to make it draw something else.
+ @li
+ We've look at the @code{master} branch of @code{workbench-example-app}, but this project also has several other branches showing off different facets of Scala.js: @lnk("dodge-the-dots", "https://github.com/lihaoyi/workbench-example-app/tree/dodge-the-dots") and @lnk("space-invaders", "https://github.com/lihaoyi/workbench-example-app/tree/space-invaders") are both interesting branches worth playing with as a beginner. Check them out!
+ @li
+ Try publishing the output code somewhere. You only need @code{example-opt.js} and @code{index-opt.html}; try putting them somewhere online where the world can see it.
+
+ @p
+ When you're done poking around our toy web application, read on to the next chapter, where we will explore making something more meaty using the Scala.js toolchain!
diff --git a/book/src/main/scalatex/book/handson/PublishingModules.scalatex b/book/src/main/scalatex/book/handson/PublishingModules.scalatex
new file mode 100644
index 0000000..9e742e2
--- /dev/null
+++ b/book/src/main/scalatex/book/handson/PublishingModules.scalatex
@@ -0,0 +1,197 @@
+@import BookData._
+@p
+ We've spent several chapters exploring the experience of making web apps using Scala.js, but any large application (web or not!) likely relies on a host of libraries in order to implement large chunks of its functionality. Ideally these libraries would be re-usable, and can be shared among different projects, teams or even companies.
+
+@p
+ Not all code is developed in the browser. Maybe you want to run simple snippets of Scala.js which don't interact with the browser at all, and having to keep a browser open is an overkill. Maybe you want to write unit tests for your browser-destined code, so you can verify that it works without firing up Chrome. Maybe it's not a simple script but a re-distributable library, and you want to run the same command-line unit tests on both Scala.js and Scala-JVM to verify that the behavior is identical. This chapter will go through all these cases.
+
+
+@sect{A Simple Cross-Built Module}
+
+ @p
+ As always, we will start with an example: in this case a toy library whose sole purpose in life is to take a series of timestamps (milliseconds UTC) and format them into a single, newline-delimited string. This is what the project layout looks like:
+
+ @hl.bash
+ $ tree
+ .
+ ├── build.sbt
+ ├── js
+ │   ├── shared/main/scala/simple/Simple.scala
+ │   └── src/main/scala/simple/Platform.scala
+ ├── jvm
+ │   ├── shared -> ../js/shared
+ │   └── src/main/scala/simple/Platform.scala
+ └── project/ build.sbt
+ @p
+ In this case the two @code{shared/} folders are symlinked together to keep them in sync. This can be done by first creating @code{js/shared}, and then running
+
+ @hl.bash
+ $ ln -s ../js/shared jvm/shared
+
+ @sect{Build Configuration}
+ @p
+ From the bash shell in the project root. Let's take a look at the various files that make up this project. First, the @code{build.sbt} files:
+
+ @hl.ref("examples/crossBuilds/simple/project/build.sbt")
+
+ @p
+ The @code{project/build.sbt} file is uneventful: it simply includes the Scala.js SBT plugin. However, the @code{build.sbt} file is a bit more interesting:
+
+ @hl.ref("examples/crossBuilds/simple/build.sbt")
+
+ @p
+ Unlike the equivalent @code{build.sbt} files you saw in earlier chapters, this does not simply add @hl.scala{scalaJSSettings} to the root project. Rather, it sets up two projects: one in the @code{js/} folder and one in the @code{jvm/} folder, with the @code{js/} version getting the settings from the Scala.js plugin. To both of these, we add @code{shared/main/scala} to the list of source directories. This means that both projects will pick up the sources we symlinked between @code{js/shared/} and @code{jvm/shared/}.
+
+ @sect{Source Files}
+
+ @p
+ Now, let's look at the contents of the @code{.scala} files that make up the meat of this project:
+
+ @hl.ref("examples/crossBuilds/simple/js/shared/main/scala/simple/Simple.scala")
+
+ @p
+ In @code{Simple.scala} we have the shared, cross-platform API of our library: a single @hl.scala{object} with a single method @hl.scala{def} which does what we want, which can then be used in either Scala.js or Scala-JVM. In general, you can put as much shared logic here as you want: classes, objects, methods, anything that can run on both Javascript and on the JVM. We're chopping off the last 5 characters (the milliseconds) to keep the formatted dates slightly less verbose.
+
+ @p
+ However, when it comes to actually formatting the date, we have a problem: Javascript and Java provide different utilities for formatting dates! They both let you format them, but they provide different APIs. Thus, to do the formatting of each individual date, we call out to the @hl.scala{Platform.format} function, which is implemented twice: once in @code{js/} and once in @code{jvm/}:
+
+ @split
+ @half
+ @hl.ref("examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala")
+
+ @half
+ @hl.ref("examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala")
+
+ @p
+ In the @code{js/} version, we are using the Javascript @hl.javascript{Date} object to take the millis and do what we want. In the @code{jvm/} version, we instead use @hl.scala{java.text.SimpleDateFormat} with a custom formatter (The syntax is defined @lnk("here", "http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html")).
+
+ @p
+ Again, you can put as much platform-specific logic in these files as you want, to account for differences in the available APIs. Maybe you want to use @lnk.dom.JSONparse for parsing JSON blobs in @code{js/}, but @lnk("Jackson", "http://jackson.codehaus.org/") or @lnk("GSON", "https://code.google.com/p/google-gson/") for parsing them in @code{jvm/}.
+ @p
+ Lastly, you'll also have noticed the two identical @hl.scala{main} methods in the platform-specific code. This is an implementation detail around the fact that Scala.js picks up the main method differently from Scala-JVM, using @hl.scala{js.JSApp} instead of looking for a @hl.scala{main(args: Array[String]): Unit} method. These two main methods allow us to test our implementations
+ @sect{Running the Module}
+ @hl.bash
+ > ; js/run; jvm/run
+ [info] Running simple.Platform
+ Running on JS! 1
+ November 2, 2014 2:58:48 PM PST
+ November 2, 2014 2:58:49 PM PST
+ [success] Total time: 4 s, completed Nov 2, 2014 2:58:48 PM
+ [info] Running simple.Platform
+ Running on JVM! 1.0
+ November 2, 2014 2:58:49 PM PST
+ November 2, 2014 2:58:50 PM PST
+ [success] Total time: 0 s, completed Nov 2, 2014 2:58:49 PM
+
+ @p
+ As you can see, both runs printed the same results, modulo three things:
+
+ @ul
+ @li
+ The "Running on XXX!" statement which shows us we're actually running on two platforms.
+ @li
+ The other hint is the time taken: the second run is instant while the first takes three seconds! This is because by default we run on @lnk.misc.Rhino, which is a simple interpreter hundreds of times slower than running code natively on the JVM.
+ @li
+ In Scala-JVM the double 1.0 is printed as @code{1.0}, while in Scala.js it's printed as @code{1}. This is one of a small number of differences between Scala.js and Scala-JVM, and verifies that we are indeed running on both platforms!
+
+ @p
+ You've by this point set up a basic cross-building Scala.js/Scala-JVM project!
+
+ @hr
+
+ @p
+ If you wish, you can do more things with this project you've set up:
+
+ @ul
+ @li
+ Flesh it out! Currently this module only does a single, trivial thing. If you've done any web development before, I'm sure you can find some code snippet, function or algorithm that you'd like to share between client and server. Try implementing it in the @code{shared/} folder to be usable in both Scala.js and Scala-JVM
+ @li
+ Publish it! Both @code{sbt publishLocal} and @code{sbt publishSigned} work on this module, for publishing either locally, Maven Central via Sonatype, or Bintray. Running the command bare should be sufficient to publish both the @code{js} or @code{jvm} projects, or you can also specify which one e.g. @code{jvm/publishLocal} to publish only one subproject.
+
+ @p
+ This @code{jvm} project works identically to any other Scala-JVM project, and the @code{js} project works identically to the Command Line API described earlier. Thus you can do things like @code{fastOptStage::run} to run the code on Node.js, setting @hl.scala{requiresDOM := true}, run @code{fullOptStage::run} to run the code with full, aggressive optimizations. And of course, things that work in both Scala.js and Scala-JVM can be run on both, basic commands such as @code{run} or @code{test}.
+
+ @p
+ You can also run tests using this code, if you have a testing library set up. The next section will go into detail as to how to set that up.
+
+@sect{Cross-Testing with uTest}
+ @p
+ @lnk("uTest", "https://github.com/lihaoyi.utest") is a small unit-testing library for Scala programs, that works on both Scala-JVM and Scala.js. At the time it was written, it was the first one out there, though now there are others such as @lnk("little-spec", "https://github.com/eecolor/little-spec") or @lnk("otest", "https://github.com/cgta/otest"). Notably, Scala's traditional testing libraries such as @lnk("Scalatest", "http://www.scalatest.org/") or @lnk("Specs2", "http://etorreborre.github.io/specs2/") do not work with Scala.js, as they make use of Reflection or other things not supported on Scala.js
+
+ @sect{uTest Configuration}
+ @p
+ To make your code use uTest, there are a few changes you need to make. First, you need to add the uTest SBT plugin:
+
+ @hl.ref("examples/crossBuilds/simple2/project/build.sbt")
+
+ @p
+ Here, in @code{project/build.sbt}, we see it used next to the Scala.js SBT plugin. Next, we need to modify our @code{build.sbt} file
+
+ @hl.ref("examples/crossBuilds/simple2/build.sbt")
+
+ @p
+ The main thing we've done is make use of uTest's @hl.scala{JsCrossBuild}: this does the work we've previously done to setup the shared-source-directory in SBT, as well as doing the neccessary configuration for uTest itself, providing you with ready-made @hl.scala{js} and @hl.scala{jvm} projects you can work with.
+
+ @sect{Your First Tests!}
+ @p
+ Lastly, we need to start writing tests! @lnk("uTest", "https://github.com/lihaoyi.utest") is well documented, but to get started here's a simple test suite for our @hl.scala{formatDates} function:
+
+ @hl.ref("examples/crossBuilds/simple2/js/shared/test/scala/simple/SimpleTest.scala")
+
+ @p
+ Since this is in @code{shared/}, it is automatically symlinked and is picked up by both @code{js} and @code{jvm} subprojects. With that done, you just need to run the @code{test} commands:
+
+ @hl.bash
+ > ; js/test; jvm/test
+ [info] 1/4 simple.SimpleTest.format.nil Success
+ [info] 2/4 simple.SimpleTest.format.timeZero Success
+ [info] 3/4 simple.SimpleTest.format Success
+ [info] 4/4 simple.SimpleTest Success
+ [info] -----------------------------------Results-----------------------------------
+ [info] simple.SimpleTest Success
+ [info] format Success
+ [info] nil Success
+ [info] timeZero Success
+ [info] Failures:
+ [info]
+ [info] Tests: 4
+ [info] Passed: 4
+ [info] Failed: 0
+ [success] Total time: 4 s, completed Nov 8, 2014 7:42:39 PM
+ [info] 1/4 simple.SimpleTest.format.nil Success
+ [info] 2/4 simple.SimpleTest.format.timeZero Success
+ [info] 3/4 simple.SimpleTest.format Success
+ [info] 4/4 simple.SimpleTest Success
+ [info] -----------------------------------Results-----------------------------------
+ [info] simple.SimpleTest Success
+ [info] format Success
+ [info] nil Success
+ [info] timeZero Success
+ [info] Failures:
+ [info]
+ [info] Tests: 4
+ [info] Passed: 4
+ [info] Failed: 0
+ [success] Total time: 0 s, completed Nov 8, 2014 7:42:39 PM
+
+ @p
+ And you'll see that we've run our unit tests twice: once on Scala.js in Rhino, and once on Scala-JVM! As expected, the first run in Rhino took much longer (4 seconds!) than the second, as Rhino is much slower than running code directly on the JVM. You can configure the Scala.js run to run in Node.js or PhantomJS, as well as running under different optimization levels.
+
+ @hr
+
+ @p
+ Now that you've got a basic cross-platform Scala module building and testing, what next? One thing you may want to do is add things to the project. Depending on where you want your code to run, there's a place for everything:
+
+ @ul
+ @li
+ @code{js/shared/main/scala}/@code{jvm/shared/main/scala} is where your shared library code goes. This code will be run on both Scala.js and Scala-JVM
+ @li
+ @code{jvm/src/main/scala} Scala-JVM only code
+ @li
+ @code{js/src/main/scala} Scala.js only code
+
+ @p
+ It is entirely possible for your modules to have slightly different implementations and APIs on Scala.js and Scala-JVM. @lnk.github.Scalatags exposes additional DOM-related functionality only for it's Scala.js version, while @lnk.github.uPickle uses different JSON libraries (@lnk("Jawn", "https://github.com/non/jawn") v.s. @lnk("DOM", "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse")) on the backend while the exposed interface remains the same. You have the flexibility to pick and choose which bits of your library you wish to share and which bits will be different.
+
+ @p
+ Everything above also applies to your unit tests, which fall in @code{test/} folders mirroring the @code{main/} folders listed above. You can also choose to share or not-share your unit test code as you see fit. \ No newline at end of file
diff --git a/book/src/main/scalatex/book/handson/WebPage.scalatex b/book/src/main/scalatex/book/handson/WebPage.scalatex
new file mode 100644
index 0000000..1056460
--- /dev/null
+++ b/book/src/main/scalatex/book/handson/WebPage.scalatex
@@ -0,0 +1,267 @@
+@import BookData._
+
+@p
+ Most web applications aren't neat little games which live on a single canvas: they are large, structured HTML pages, which involve displaying data (whether from the user or from the web) in multiple ways, while allowing the user to make changes to the data that can be saved back to whatever remote web-service/database it came from.
+
+@p
+ At this point, you are already competent at using Scala.js to make basic, self-contained canvas applications. In this chapter, we will cover how to use Scala.js to build the sort of interactive-web-pages that make up the bulk of the modern-day internet. We'll cover how to use powerful libraries that turn front-end development form the typical fragile-mess into a structured, robust piece of software.
+
+@sect{Hello World: HTML}
+
+ @p
+ The most basic way of building interactive web pages using Scala.js is to use the Javascript APIs to blat HTML strings directly into some container @hl.html{<div>} or @hl.html{<body>}. This approach works, as the following code snippet demonstrates:
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/webpage/HelloWorld0.scala")
+
+ @less
+ @BookData.example(div, "HelloWorld0().main")
+
+ @p
+ Remember that we're now requiring a @hl.scala{dom.HTMLDivElement} instead of a @hl.scala{dom.HTMLCanvsElement} to be passed in when the Javascript calls @hl.javascript{HelloWorld0().main(...)}. If you're coming to this point from the previous chapter, you'll need to update the on-page Javascript's @hl.javascript{document.getElementById} to pick a @hl.html{<div>} rather than the @hl.html{<canvas>} we were using in the previous chapter.
+
+ @p
+ This approach works, as the above example shows, but has a couple of disadvantages:
+
+ @ul
+ @li
+ It is untyped: it is easy to accidentally mistype something, and result in malformed HTML. A typo such as @hl.html{<dvi>} would go un-noticed at build-time. Depending on where the typo happens, it could go un-noticed until the application is deployed, causing subtle bugs that only get resolved much later.
+ @li
+ It is insecure: @lnk("Cross-site Scripting", "http://en.wikipedia.org/wiki/Cross-site_scripting") is a real thing, and it is easy to forget to escape the values you are putting into your HTML strings. Above they're constants like @hl.scala{"dog"}, but if they're user-defined, you may not notice there is a problem until something like @hl.scala{"<script>...</script>"} sneaks through and your users' accounts & data is compromised.
+
+ @p
+ There are more, but we won't go deep into the intricacies of these problems. Suffice to say it makes mistakes easy to make and hard to catch, and we have something better...
+
+@sect{Scalatags}
+ @p
+ @lnk("Scalatags", "https://github.com/lihaoyi/scalatags") is a cross-platform Scala.js/Scala-JVM library that is designed to generate HTML. To use Scalatags, you need to add it as a dependency to your Scala.js SBT project, in the @code{build.sbt} file:
+
+ @hl.ref("examples/demos/build.sbt", "com.scalatags", "")
+
+ @p
+ With that, the above snippet of code re-written using Scalatags looks as follows:
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/webpage/HelloWorld1.scala")
+
+ @less
+ @BookData.example(div, "HelloWorld1().main")
+
+ @p
+ Scalatags has some nice advantages over plain HTML: it's type-safe, so typos like @hl.scala{dvi} get caught at compile-time. It's also secure, such that you don't need to worry about script-tags in strings or similar. The @lnk("Scalatags Readme", "https://github.com/lihaoyi/scalatags#scalatags") elaborates on these points and other advantages. As you can see, it takes just 1 import at the top of the file to bring it in scope, and then you can use all of Scalatags' functionality.
+
+ @p
+ The Scalatags github page has @lnk("comprehensive documentation", "https://github.com/lihaoyi/scalatags#hello-world") on how to express all manner of HTML fragments using Scalatags, so anyone who's familiar with how HTML works can quickly get up to speed. Instead of a detailed listing, we'll walk through some interactive examples to show Scalatags in action!
+
+ @sect{User Input}
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/webpage/Inputs.scala", "val box")
+
+ @less
+ @BookData.example(div(height:="150px"), "Inputs().main")
+
+ @p
+ In Scalatags, you build up fragments of type @hl.scala{Frag} using functions like @hl.scala{div}, @hl.scala{h1}, etc., and call @hl.scala{.render} on it to turn it into a real @lnk.dom.Element. Different fragments render to different things: e.g. @hl.scala{input.render} gives you a @lnk.dom.HTMLInputElement, @hl.scala{span.render} gives you a @lnk.dom.HTMLSpanElement. You can then access the properties of these elements: adding callbacks, checking their value, anything you want.
+
+ @p
+ In this example, we render and @hl.scala{input} element and a @hl.scala{span}, wire up the input to set the value of the span whenever you press a key in the input, and then stuff both of them into a larger HTML fragment that forms the contents of our @hl.scala{target} element.
+
+ @sect{Re-rendering}
+ @p
+ Let's look at a slightly longer example. While above we spliced small snippets of text into the DOM, here we are going to re-render entire sections of HTML! The goal of this little exercise is to make a filtering search-box: starting from a default list of items, narrow it down as the user enters text into the box.
+
+ @p
+ To begin with, let's define our list of items: Fruits!
+
+ @hl.ref("examples/demos/src/main/scala/webpage/Search0.scala", "val listings", "def")
+
+ @p
+ Next, let's think about how we want to render these fruits. One natural way would be as a list, which in HTML is represented by a @hl.html{<ul>} with @hl.html{<li>}s inside of it if we wanted the list to be unordered. We'll make it a @hl.scala{def}, because we know up-front we're going to need to re-render this listing as the search query changes. Lastly, we know we want 1 list item for each fruit, but only if the fruit starts with the search query.
+
+ @hl.ref("examples/demos/src/main/scala/webpage/Search0.scala", "def renderListings", "lazy val")
+
+ @p
+ Using a @hl.scala{for}-loop with a filter inside the Scalatags fragment is just normal Scala, since you can nest arbitrary Scala expressions inside a Scalatags snippet. In this case, we're converting both the fruit and the search query to lower case so we can compare them case-insensitively.
+
+ @p
+ Lastly, we just need to define the input box and output-container (as we did earlier), set the @lnk.dom.onkeyup event handler, and place it in a larger fragment, and then into our target:
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/webpage/Search0.scala", "val output")
+
+ @less
+ @BookData.example(div, "Search0().main")
+
+ @p
+ And there you have it! A working search box. This is a relatively self-contained example: all the items its searching are available locally, no Ajax calls, and there's no fancy handling of the searched items. If we want to, for example, highlght the matched section of each fruit's name, we can modify the @hl.scala{def renderListings} call to do so:
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/webpage/Search1.scala", "def renderListings", "lazy val")
+
+ @less
+ @BookData.example(div, "Search1().main")
+
+ @p
+ Here, instead of sticking the name of the matched fruits directly into the @hl.scala{li}, we instead first split off the part which matches the query, and then highlght the first section yellow. Easy!
+
+ @hr
+
+ @p
+ Hopefully this has given you a good overview of how to do things using Scala.js and Scalatags. I won't go too deep into the various ways you can use Scalatags: the @lnk("documentation", "https://github.com/lihaoyi/scalatags") should cover most of it. Now that you've gone through this experience, it's worth re-iterating a few things you've probably already noticed about Scalatags
+
+ @ul
+ @li
+ It's safe! If you make a trivial syntactic mistake, the compiler will catch it, because Scalatags is plain Scala. Try it!
+ @li
+ It's composable! You can easily define fragments and assign them to variables, to be used later. You can break apart large Scalatags fragments the same way you break apart normal code, avoiding the huge monolithic HTML templates that are common in other templating systems.
+ @li
+ It's Scala! You have the full power of the Scala language to write your fragments. No need to learn special syntax/cases for conditionals or repetitions: you can use plain-old-Scala @hl.scala{if}-@hl.scala{else}s, @hl.scala{for}-loops, etc.
+
+ @p
+ Now that you've gotten a quick overview of the kinds of things you can do with Scalatags, let's move on to the next section of our hands-on tutorial...
+
+@sect{Using Web Services}
+
+ @p
+ One half of the web application faces forwards towards the user, managing and rendering HTML or Canvas for the user to view and interact with. Another half faces backwards, talking to various web-services or databases which turn the application from a standalone-widget into part of a greater whole. We've already seen how to make the front half, let's now talk about working with the back half.
+
+ @sect{Raw Javascript}
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/webpage/Weather0.scala", "val xhr")
+
+ @less
+ @BookData.example(div, "Weather0().main")
+ @p
+ The above snippet of code uses the raw Javascript Ajax API in order to make a request to @lnk("openweathermap.org", "http://openweathermap.org/"), to get the weather data for the city of Singapore as a JSON blob. The part of the API that we'll be using is documented @lnk("here", "http://openweathermap.org/current"), and if you're interested you can read all about the various options that they provide. For now, we're unceremoniously dumping it in a @hl.scala{pre} so you can see the raw response data.
+
+ @p
+ As you can see, using the raw Javascript API to make the Ajax call looks almost identical to actually doing this in Javascript, shown below:
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/resources/webpage/weather.js", "var xhr")
+
+ @less
+ @BookData.example(div, "WeatherJs")
+
+ @p
+ The primary syntactic differences are:
+
+ @ul
+ @li
+ @hl.scala{val}s for immutable data v.s. mutable @hl.javascript{var}s.
+ @li
+ @hl.scala("=>") v.s. @hl.javascript{function} to define the callback.
+ @li
+ Scalatags' @hl.scala{pre} v.s. @hl.javascript{document.createElement("pre")}
+
+ @p
+ Overall, they're pretty close, which is a common theme in Scala.js: using Javascript APIs in Scala.js is often as seamless and easy as using them in Javascript itself, and it often looks almost identical.
+
+ @sect{dom.extensions}
+ @p
+ Although the Javascript XMLHttpRequest API is workable, it's kind of awkward and clunky compared to what you're used to in Scala. We create a half-baked object, set some magic properties, and call a magic function, which all has to be done in the correct order or it won't work.
+
+ @p
+ With Scala.js, we provide a simpler API that is more clearly functional. First, you need to import some things into scope:
+
+ @hl.ref("examples/demos/src/main/scala/webpage/Weather1.scala", "import dom", "val url =")
+
+ @p
+ The first import brings in Scala adapters to several DOM APIs, which allow you to use them more idiomatically from Scala. The second brings in an implicit @hl.scala{scala.concurrent.ExecutionContext} that we'll need to run our asynchronous operations.
+
+ @p
+ Then we need the code itself:
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/webpage/Weather1.scala", "val url")
+
+ @less
+ @BookData.example(div(height:="100%", overflow:="scroll"), "Weather1().main")
+
+ @p
+ A single call to @hl.scala{Ajax.get(...)}, with the URL, and we receive a @hl.scala{scala.concurrent.Future} that we can use to get access to the result when ready. Here we're just using it's @hl.scala{onSuccess}, but we could use it in a for-comprehension, with @lnk("Scala Async", "https://github.com/scala/async"), or however else we can use normal @hl.scala{Future}s
+
+ @sect{Parsing the Data}
+ @p
+ We've taken the data-dump from OpenWeatherMap in three different ways, but there's still something missing: we need to actually parse the JSON data to make use of it! Most people don't use their JSON data as strings but as structured documents, querying and extracting only the bits we need.
+
+ @p
+ First, let's make the call prettyprint the document, so at least we can see what it contains:
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/webpage/Weather2.scala", "Ajax.get")
+
+ @less
+ @BookData.example(div(height:="100%", overflow:="scroll"), "Weather1().main")
+
+ @p
+ We do this by taking @hl.scala{xhr.responseText} and putting it through both @hl.scala{JSON.parse} and @hl.scala{JSON.stringify}, passing in a @hl.scala{space} argument to tell @hl.scala{JSON.stringify} to spread it out nicely.
+
+ @p
+ Now that we've pretty-printed it, we can immediately see what data it contains and which part of the data we want. Let's change the previous example's @hl.scala{onSuccess} call to extract the @hl.scala{weather}, @hl.scala{temp} and @hl.scala{humidity} and put them in a nice, human-friendly format for us to enjoy:
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/webpage/Weather3.scala", "Ajax.get")
+
+ @less
+ @BookData.example(div(height:="100%", overflow:="scroll"), "Weather3().main")
+
+ @p
+ First we parse the incoming response, extract a bunch of values from it, and then stick it in a Scalatags fragment for us to see. Note how we can use the names of the attributes e.g. @hl.scala{json.name} even though @hl.scala{name} is a dynamic property which you can't be sure exists: this is because @hl.scala{json} is of type @hl.scala{js.Dynamic}, which allows us to refer to arbitrary parameters and methods on the underlying object without type-checking.
+
+ @p
+ Calls on @hl.scala{js.Dynamic} resolve directly to javascript property/method references, and will fail at run-time with an exception if used wrongly. This is also why we need to call @hl.scala{.toString} or @hl.scala{.asInstanceOf}on the values before use: without these casts, the compiler can't be sure what kind of value is underneath the @hl.scala{js.Dynamic} type, and so we have to provide it the guarantee that it is what it needs.
+
+@sect{Tying it together: Weather Search}
+ @p
+ At this point we've made a small app that allows us to search from a pre-populated list of words, as well as a small app that lets us query a remote web-service to find the weather in Singapore. The natural thing to do is to put these things together to make a app that will let us search from a list of countries and query the weather in any country we desire. Let's start!
+
+ @hl.ref("examples/demos/src/main/scala/webpage/WeatherSearch.scala", "lazy val box", "def fetchWeather")
+
+ @p
+ This sets up the basics: an input box, an output div, and sets an @hl.scala{onkeyup} that fetches the weather data each time you hit a key. It then renders all these components and sticks them into the @hl.scala{target} div. This is basically the same stuff we saw in the early examples, with minor tweaks e.g. adding a @hl.scala{maxHeight} and @hl.scala{overflowY:="scroll"} to the @hl.scala{output} box in case the output is too large. Whenever we enter something in the box, we call the function @hl.scala{fetchWeather}, which is defined as:
+
+ @hl.ref("examples/demos/src/main/scala/webpage/WeatherSearch.scala", "def fetchWeather", "def showResults")
+
+ @p
+ This is where the actual data fetching happens. It's relatively straightforward: we make an @hl.scala{Ajax.get} request, @hl.scala{JSON.parse} the response, and feed it into the callback function. We're using a slightly different API from earlier: we now have the @hl.scala{"type=like"} flag, which is documented in the @lnk("OpenWeatherMap API docs", "http://openweathermap.org/current#other") to return multiple results for each city whose name matches your query.
+
+ @p
+ Notably, before we re-render the results, we check whether the @hl.scala{query} that was passed in is the same value that's in the @hl.scala{box}. This is to prevent a particularly slow ajax call from finishing out-of-order, potentially stomping over the results of more recent searches. We also check whether the @hl.scala{.list: js.Dynamic} property we want is an instance of @hl.scala{js.Array}: if it isn't, it means we don't have any results to show, and we can skip the whole render-output step.
+
+ @hl.ref("examples/demos/src/main/scala/webpage/WeatherSearch.scala", "def showResults")
+
+ @p
+ Here is the meat and potatoes of this program: every time it gets called with an array of weather-data, we iterate over the cities in that array. It then does a similar sort of data-extraction that we did earlier, putting the results into the @hl.scala{output} div we defined above, including highlighting.
+
+ @BookData.example(div, "WeatherSearch().main")
+
+ @p
+ And that's the working example! Try searching for cities like "Singapore" or "New York" or "San Francisco" and watch as the search narrows as you enter more characters into the text box. Note that the OpenWeatherMap API limits ambiguous searches to about a dozen results, so if a city doesn't turn up in a partial-search, try entering more characters to narrow it down.
+
+@sect{Interactive Web Pages Recap}
+ @p
+ In this chapter, we've explored the basics of how you can use Scala.js to build interactive web pages. The two main contributions are using Scalatags to render HTML in a concise, safe way, and making Ajax calls to external web services. We combined these two capabilities in a small weather-search app that let a user interactively search for the weather in different cities around the world.
+ @p
+ Some things you may have noticed in the process:
+
+ @ul
+ @li
+ Using Scalatags to render HTML fragments, and managing them at runtime with callbacks and getting/setting properties, is really quite nice
+ @li
+ Using @hl.scala{new dom.XMLHttpRequest} to make web requests feels just like the Javascript code to do so
+ @li
+ Using @hl.scala{Ajax.get(...)} and working with the resultant : @hl.scala{Future} feels a lot cleaner than directly using the Javascript API
+
+ @p
+ You're at this point reasonably pro
diff --git a/book/src/main/scalatex/book/indepth/AdvancedTechniques.scalatex b/book/src/main/scalatex/book/indepth/AdvancedTechniques.scalatex
new file mode 100644
index 0000000..171b2d3
--- /dev/null
+++ b/book/src/main/scalatex/book/indepth/AdvancedTechniques.scalatex
@@ -0,0 +1,305 @@
+@import BookData._
+@p
+ @sect.ref{Getting Started} walks you through how to set up some basic Scala.js applications, but that only scratches the surface of the things you can do with Scala.js. Apart from being able to use the same techniques you're used to in Scala-JVM in the browser, Scala.js opens up a whole range of possibilities and novel techniques that are not found in typical Scala-JVM applications.
+
+@p
+ Although these techniques may technically be possible on the JVM, very few Scala-JVM applications are built in a way that can take advantage of them. Most Scala-JVM code runs on back-end servers which have a completely different structure from the client-side apps that Scala.js allows.
+@p
+ This client-side user-interface-focused code lends itself to completely different design patterns from those used to develop server-side code. This section will explore a number of techniques which are present
+
+@ul
+ @li
+ @sect.ref("Functional-Reactive UIs", "Functional-reactive user interfaces")
+ @li
+ @sect.ref("Asynchronous Workflows", "Asynchronous user-interation workflows")
+
+@p
+ One note is that these are "Techniques" rather than "Libraries" because they have not been packaged up in a way that is sufficiently nice that you can use them out-of-the-box just by adding a dependency somewhere. Thus, they each require some small amount of boilerplate before use, though the amount of boilerplate is fixed: it does not grow with the size of your program, and anyway gives you a chance to tweak it to do exactly what you want.
+
+@sect{Functional-Reactive UIs}
+ @p
+ @lnk("Functional-reactive Programming", "http://en.wikipedia.org/wiki/Functional_reactive_programming") (FRP) is a field with encompasses several things:
+
+ @ul
+ @li
+ @b{Discrete}: Handling of first-class event-streams like in @link("RxJS", "https://github.com/Reactive-Extensions/RxJS")
+ @li
+ @b{Continuous}: Handling of first-class signals, like in @link("Elm", "http://elm-lang.org/learn/What-is-FRP.elm")
+
+ @sect{Why FRP}
+ @p
+ The value proposition of FRP is that in a "traditional" program, when an event occurs, events and changes propagate throughout the program in an ad-hoc manner. An event-listener may trigger additional events, call some callbacks, or set some mutable variables that subsequent code will read and react to.
+
+ @p
+ This works, but the ad-hoc nature is both free-ing and limiting. You are free to do whatever you want in response to any action, but in return the developer who maintains your code (e.g. yourself 6 months from now) has no idea what your code is doing in response to any action: the possible consequence of an action is basically "Anything"!
+
+ @p
+ Furthermore, because the propagation is ad-hoc, there is no way for the code to help ensure that you are propagating changes in a "valid" manner: it is thus easy for programmer errors to result in changes or events being incorrectly propagated. This most often results in data falling out of sync: a UI widget may forget to update when an action is taken, resulting in an inconsistent state being shown to the user, ultimately resulting in confused users.
+
+ @p
+ FRP basically structures these event- or change-propagations as first-class values within the program, either as an @hl.scala{EventSource[T]} type that represents a discrete source of individual @hl.scala{T} events, or as a @hl.scala{Signal[T]} type which represents a continuous time-varying value @hl.scala{T}. This comes at some cost within the program: you now have to program using these @hl.scala{EventSource}s or @hl.scala{Signal}s, rather than just ad-hoc running callbacks or listening-to/triggering events all over the place. In exchange, you get more powerful tools to work with these values, making it easy for the library to e.g. ensure that changes always propagate correctly throughout your program, and that all values are always kept in sync.
+
+ @sect{FRP with Scala.Rx}
+ @p
+ @lnk("Scala.Rx", "https://github.com/lihaoyi/scala.rx") is a change-propagation library that implements the @b{Continuous} style of FRP. To begin with, we need to include it in our @code{build.sbt} dependencies:
+
+ @hl.ref("examples/demos/build.sbt", "com.scalarx")
+
+ @p
+ Scala.Rx provides you with smart variables that automatically track dependencies with each other, such that if one smart variable changes, the rest re-compute immediately and automatically. The main primitives in Scala.Rx are:
+
+ @ul
+ @li
+ @b{Var}s: Smart variables that can be set manually, and automatically notify their dependents that they need to recompute
+ @li
+ @b{Rx}s: Smart values which are set as some computation of other @b{Rx}s or @b{Var}s, which recompute automatically when their dependencies change, and notify their dependents
+ @li
+ @b{Obs}s: Observers on either an @b{Rx} or a @b{Var}, which performs some action when it changes
+
+ @p
+ @hl.scala{Var}s and @hl.scala{Rx}s roughly correspond to the idea of a @hl.scala{Signal} described earlier. The documentation for Scala.Rx goes into this in much more detail, so if you're curious you should read it. This section will jump straight into how to use Scala.Rx with Scala.js.
+
+ @p
+ To begin with, let's set up our imports:
+
+ @hl.ref("examples/demos/src/main/scala/advanced/BasicRx.scala", "package advanced", "@JSExport")
+
+ @p
+ Here we are seeing the same @hl.scala{dom} and @hl.scala{scalatags}, imports we saw in the hands-on tutorial, as well a new @hl.scala{import rx._} which bring all the Scala.Rx names into the local namespace.
+
+ @p
+ Scala.Rx does not "natively" bind to Scalatags, but integrating them yourself is simple enough that it's not worth putting into a separate library. He's a simple integration:
+
+ @hl.ref("examples/demos/src/main/scala/advanced/BasicRx.scala", "implicit def")
+
+ @p
+ Scalatags requires that anything you want to embed in a Scalatags fragment be implicitly convertible to @hl.scala{Frag}; here we are providing one for any Scala.Rx @hl.scala{Rx[T]}s, as long as the @hl.scala{T} provided is itself convertible to a @hl.scala{Frag}. We call @hl.scala{r().render} to extract the "current" value of the @hl.scala{Rx}, and then set up an @hl.scala{Obs} that watches the @hl.scala{Rx}, replacing the previous value with the current one every time its value changes.
+
+ @p
+ Now that the set-up is out of the way, let's consider a simple HTML widhet that lets you enter text in a @hl.html{<textarea>}, and keeps track of the number of words, characters, and counts how long each word is.
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/advanced/BasicRx.scala", "val txt =")
+
+ @less
+ @example(div, "BasicRx().main")
+
+ @p
+ This snippet sets up a basic data-flow graph. We have our @hl.scala{txt} @hl.scala{Var}, and a bunch of @hl.scala{Rx}s (@hl.scala{numChars}, @hl.scala{numWords}, @hl.scala{avgWordLength}) that are computed based on @hl.scala{txt}.
+
+ @p
+ Next, we construct our Scalatags fragment: a @hl.scala{textarea} tag with a listener that updates @hl.scala{txt}, and a @hl.scala{div} containing the @hl.scala{textarea} and a list containing the bound values of our @hl.scala{Rx}s.
+
+ @p
+ That's all we need to end up with a live-updating widget, which re-renders the necessary bits of the page when the contents of the text box changes! Note how the code basically flows top-to-bottom, like a batch-rendering program, but at the end of it we get a live widget. The code is much simpler than a similar widget built up using jQuery or Backbone.
+
+ @p
+ Furthermore, there is no chance for the parts of the DOM which are "live" to fall out of sync. There is no visible logic that handles the individual re-calulations and re-renders: that is all done by Scala.Rx and by our @hl.scala{rxFrag} implicit. Because we do not need to write code for each site to keep each individual @hl.scala{Rx} and each DOM fragment in sync, that means there is no chance of the developer screwing it up and resulting in an out-of-sync page.
+
+ @sect{More Rx}
+ @p
+ That was a pretty simple example to get you started with a simple Scala.Rx application. Let's look at a more meaty example to see how we can use Scala.Rx to help structure our interactive web application:
+
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/advanced/BasicRx.scala", "val fruits =")
+
+ @less
+ @example(div, "BasicRx().main2")
+
+ @p
+ This is a basic re-implementation of the autocomplete widget we created in the chapter @sect.ref{Interactive Web Pages}, except done using Scala.Rx. Note that unlike the original implementation, we don't need to manage the clearing of the output area via @hl.scala{innerHTML = ""} and the re-rendering via @hl.scala{appendChild(...)}. All this is handled by the same @hl.scala{rxFrag} code we wrote earlier.
+
+ @p
+ Furthermore, this implementation is more efficient than the original: In the original, everything is always re-rendered every time, which can be a problem if the number of things being rendered is large. In this implementation, only when a fruit appears-in/disappears-from the list does re-rendering happen, and only for that particular fruit. For the bulk of the fruits which did not experience any change in appearance, the DOM is left entirely untouched.
+
+ @p
+ Again, there is no chance for the developer to make a mistake updating things, because all this rendering and re-rendering is hidden from view inside the library.
+
+ @hr
+
+ @p
+ Hopefully this has given you a sense of how you can use Scala.Rx to help build complex, interactive web applications. The implementation is tricky, but the basic value proposition is clear: you get to write your code top-to-bottom, like the most old-fashioned static pages, and have it transformed by Scala.Rx into an interactive, always-consistent web app. By abstracting away the whole event-propagation, manual-updating process inside the library, we have ensured that there is no place where the developer can screw it up, and the application's UI will forever be in sync with its data.
+
+@sect{Asynchronous Workflows}
+ @p
+ In a traditional setting, Scala applications tend to have a mix of concurrency models: some spawn multiple threads and use thread-blocking operations or libraries, others do things with Actors or Futures, trying hard to stay non-blocking throughout, while most are a mix of these two paradigms.
+
+ @p
+ On Scala.js, things are different: multi-threaded concurrency is a non-starter, since Javascript engines are all single-threaded. As a result, there are virtually no blocking APIs in Javascript: all operations need to be asynchronous if you don't want them to freeze the user interface of the browser while the operation is happening. Scala.js uses standard Javascript APIs and is no different.
+
+ @p
+ However, Scala.js has much more powerful tools to work with than your typical Javascript libraries. The Scala standard library comes with a rich API for @sect.ref{Futures & Promises}, which are thankfully 100% asynchronous. Though this design was chosen for performance on the JVM, it perfectly fits our 100% asynchronous Javascript APIs. We have tools like @sect.ref{Scala-Async}, which works perfectly with Scala.js, and lets you create asynchronous computations in a much less confusing manner.
+
+ @sect{Futures & Promises}
+ @p
+ A Future represents an in-progress computation that may or may not have completed. It may encapsulate a web request, or an RPC, or a task happening on another thread. They are not a novel concept, and Scala provides a good in-built implementation of Futures that works well with Scala.js.
+
+ @p
+ To motivate this, let's consider a simple example application that:
+
+ @ul
+ @li
+ Takes as user input a comma-separated list of city-names
+ @li
+ Fetches the temperature in each city from @code{api.openweathermap.org}
+ @li
+ Displays the results when they are all back
+
+ @p
+ We'll work through a few implementations of this.
+
+ @p
+ To begin with, let's write the scaffolding code, that will display the input box, deal with the listeners, and all that:
+
+ @hl.ref("examples/demos/src/main/scala/advanced/Futures.scala", "val myInput")
+
+ @p
+ So far so good. The only thing that's missing here is the mysterious @hl.scala{handle} function, which is given the list of names and the @hl.scala{output} div, and must handle the Ajax requests, aggregating the results, and displaying them in @hl.scala{output}. Let's also define a small number of helper functions that we'll use later:
+
+ @hl.ref("examples/demos/src/main/scala/advanced/Futures.scala", "def urlFor", "def parseTemp")
+
+ @p
+ @hl.scala{urlFor} encapsulates the messy URL-construction logic that we need to make the Ajax call to the right place.
+
+ @hl.ref("examples/demos/src/main/scala/advanced/Futures.scala", "parseTemp", "def formatResults")
+
+ @p
+ @hl.scala{parseTemp} encapsulates the messy result-extraction logic that we need to get the data we want (current temperature, in celsius) out of the structured JSON return blob.
+
+ @hl.ref("examples/demos/src/main/scala/advanced/Futures.scala", "def formatResults", "def main")
+
+ @p
+ @hl.scala{formatResults} encapsulates the conversion of the final @hl.scala{(name, celsius)} data back into readable HTML.
+
+ @p
+ Overall, these helper functions do nothing special, btu we're defining them first to avoid having to copy-&-paste code throughout the subsequent examples. Now that we've defined all the relevant scaffolding, let's walk through a few ways that we can implement the all-important @hl.scala{handle} method.
+
+ @def scrollDiv = div(
+ height:="200px",
+ overflow:="scroll"
+ )
+
+ @sect{Direct Use of XMLHttpRequest}
+ @example(scrollDiv, "Futures().main0")
+ @hl.ref("examples/demos/src/main/scala/advanced/Futures.scala", "def handle0", "main")
+
+ @p
+ This is a simple solution that directly uses the @hl.scala{XMLHttpRequest} class that is available in Javascript in order to perform the Ajax call. Every Ajax call that returns, we aggregate in a @hl.scala{results} buffer, and when the @hl.scala{results} buffer is full we then append the formatted results to the output div.
+ @p
+ This is relatively straightforward, though maybe knottier than people would be used to. For example, we have to "construct" the Ajax call via calling mutating methods and setting properties on the @hl.scala{XMLHttpRequest} object, where it's easy to make a mistake. Furthermore, we need to manually aggregate the @hl.scala{results} and keep track ourselves whether or not the calls have all completed, which again is messy and error-prone.
+
+ @p
+ This solution is basically equivalent to the initial code given in the @sect.ref{Raw Javascript} section of @sect.ref{Interactive Web Pages}, with the additional code necessary for aggregation. As described in @sect.ref{dom.extensions}, we can make use of the @hl.scala{Ajax} object to make it slightly tidier.
+
+ @sect{Using dom.extensions.Ajax}
+ @example(scrollDiv, "Futures().main1")
+ @hl.ref("examples/demos/src/main/scala/advanced/Futures.scala", "def handle1", "main")
+
+ @p
+ This solution uses the @hl.scala{dom.extensions.Ajax} object, as described in @hl.scala{dom.extensions}. This basically wraps the messy @hl.scala{XMLHttpRequest} interface in a single function that returns a @hl.scala{scala.concurrent.Future}, which you can then map/foreach over to perform the action when the @hl.scala{Future} is complete.
+ @p
+ However, we still have the messiness inherent in the result aggregation: we don't actually want to perform our action (writing to the @hl.scala{output} div) when one @hl.scala{Future} is complete, but only when @i{all} the @hl.scala{Future}s are complete. Thus we still need to do some amount of manual book-keeping in the @hl.scala{results} buffer.
+
+ @sect{Future Combinators}
+ @example(scrollDiv, "Futures().main2")
+ @hl.ref("examples/demos/src/main/scala/advanced/Futures.scala", "def handle2", "main")
+
+ @p
+ Since we're using Scala's @hl.scala{Future}s, we aren't limited to just map/foreach-ing over them. @hl.scala{scala.concurrent.Future} provides a @lnk("rich api", "http://www.scala-lang.org/files/archive/nightly/docs/library/scala/concurrent/Future.html") that can be used to deal with common tasks like working with lists of futures in parallel, or aggregating the result of futures together.
+ @p
+ Here, instead of manually counting until all the @hl.scala{Future}s are complete, we instead create the Futures which will contain what we want (name and temperature) and store them in a list. Then we can use the @hl.scala{Future.sequence} function to invert the @hl.scala{Seq[Future[T]]} into a @hl.scala{Future[Seq[T]]}, a single Future that will provide all the results in a single list when every Future is complete. We can then simply foreach- over the single Future to get the data we need to feed to @hl.scala{formatResults}/@hl.scala{appendChild}.
+
+ @p
+ This approach is significantly neater than the previous two examples: we no longer have any mutation going on, and the logic is expressed in a very high-level, simple manner. "Make a bunch of Futures, join them, use the result" is much less error-prone than the imperative result-aggregation-and-counting logic used in the previous examples.
+
+ @hr
+
+ @p
+ @hl.scala{scala.concurrent.Future} isn't limited to just calling @hl.scala{.sequence} on lists. It provides the ability to @hl.scala{.zip} two Futures of different types together to get their result, or @hl.scala{.recover} in the case where Futures fail. Although these tools were originally built for Scala-JVM, all of them work unchanged on Scala.js, and serve their purpose well in simplifying messy asynchronous computations.
+
+ @sect{Scala-Async}
+ @p
+ Let's look at how to use Scala-Async. To motivate us, let's consider a simple paint-like canvas application similar to the one we built in the section @sect.ref{Making a Sketchpad using Mouse Input}. This application will have a few properties:
+
+ @ul
+ @li
+ The user clicks and drags to begin drawing a line on the canvas
+ @li
+ When the user releases the mouse, we fill the shape that was formed by the dragging
+ @li
+ The user clicks again to clear the canvas; like most clicks, the action happens when the button is released
+ @li
+ And can repeat the process from the top, indefinitely
+
+ @p
+ This is a toy example, but is enough to bring out the difficulty of doing things the "traditional" way, and why using Scala-Async with Scala.js is superior. To begin with, let's set the stage:
+
+ @hl.ref("examples/demos/src/main/scala/advanced/Async.scala", "val renderer")
+
+ @p
+ To initialize the canvas with the part of the code which will remain the same, so we can look more closely at the code which differs.
+
+ @sect{Traditional Asynchrony}
+ @p
+ Let's look at a traditional implementation, using Scala.js but no special features. We'll just use the Javascript @hl.scala{canvas.onmouveXXX} operations directly.
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/advanced/Async.scala", "// traditional")
+
+ @less
+ @example(canvas, "Async().main0")
+ @p
+ This is a working implementation, and you can play with it on the right. We basically set the three listeners:
+
+ @ul
+ @li
+ @hl.scala{canvas.onmousemove}
+ @li
+ @hl.scala{canvas.onmousedown}
+ @li
+ @hl.scala{canvas.onmouseup}
+
+ @p
+ And each listener is in charge of deciding what to do when it is it's turn to fire.
+
+ @p
+ This code is pretty tricky and hard to follow. It's not immediately clear what it is doing. One thing you may notice is the presence of this @hl.scala{dragState} variable, which seems to add a lot to the confusion with branches all over the place. At first you may think you can simplify the code to do without it, but attempts to do so will reveal why it is necessary.
+
+ @p
+ This variable is necessary because each mouse event could mean different things at different times. For example, @hl.scala{canvas.onmousemove} should do nothing it occurs between an @hl.scala{canvas.onmousedown} and @hl.scala{canvas.onmouseup}. @hl.scala{canvas.onmouseup} itself has two tasks: it either ends the dragging phase (which necessitates the fill-current-shape call) or it serves to clear the canvas if happening after a drag. And @hl.scala{canvas.onmousedown} should not start a new drag if the previous drawing hasn't been cleared from the canvas.
+
+ @p
+ This is a pretty simple workflow for the user, and yet the code is already tricky enough it's not obvious that it's correct at first glance. More complex tools will have correspondingly more complex workflows, and it is easy to see how just another 1 or 2 more states can get out of hand.
+
+ @sect{Using Scala-Async}
+ @p
+ Now we've seen what a "traditional" approach looks like, let's look at how we would do this using Scala-Async.
+
+ @split
+ @more
+ @hl.ref("examples/demos/src/main/scala/advanced/Async.scala", "// async")
+
+ @less
+ @example(canvas, "Async().main")
+
+ @p
+ We have an @hl.scala{async} block, which contains a while loop. Each round around the loop, we wait for the @hl.scala{mousedown} channel to start the path, waiting for either @hl.scala{mousedown} or @hl.scala{mousedown} (which continues the path or ends it respectively), fill the shape, and then wait for another @hl.scala{mousedown} before clearing the canvas and going again.
+
+ @p
+ Hopefully you'd agree that this code is much simpler to read and understand than the previous version. In particular, the control-flow of the code goes from top to bottom in a "natural" fashion, rather than jumping around ad-hoc like in the previous callback-based design.
+ @p
+ You may be wondering what these @hl.scala{Channel} things are, and where they are coming from. Although these are not provided by Scala, they are pretty straightforward to define ourselves:
+
+ @hl.ref("examples/demos/src/main/scala/advanced/Async.scala", "case class Channel")
+
+ @p
+ The point of @hl.scala{Channel} is to allow us to turn event-callbacks (like those provided by the DOM's @hl.scala{onmouseXXX} properties) into some kind of event-stream, that we can listen to asynchronously (via @hl.scala{apply} that returns a @hl.scala{Future}) or merge via @hl.scala{|}. This is a minimal implementation for what we need now, but it would be easy to provide more functionality (filter, map, etc.) as necessary.
+
+ @hr
+
+ @p
+ Scala-Async is a Macro; that means that it is both more flexible and more limited than normal Scala, e.g. you cannot put the @hl.scala{await} call inside a lambda or higher-order-function like @hl.scala{.map}. Like Futures, it doesn't provide any fundamentally new capabilities, but is a tool that can be used to simplify otherwise messy asynchronous workflows.
diff --git a/book/src/main/scalatex/book/indepth/CompilationPipeline.scalatex b/book/src/main/scalatex/book/indepth/CompilationPipeline.scalatex
new file mode 100644
index 0000000..1718f5e
--- /dev/null
+++ b/book/src/main/scalatex/book/indepth/CompilationPipeline.scalatex
@@ -0,0 +1,185 @@
+
+@p
+ Scala.js is implemented as a compiler plugin in the Scala compiler. Despite this, the overall process looks very different from that of a normal Scala application. This is because Scala.js optimizes for the size of the compiled executable, which is something that Scala-JVM does not usually do.
+
+@sect{Whole Program Optimizaton}
+ @p
+ At a first approximation, Scala.js achieves its tiny executables by using whole-program optimization. Scala-JVM, like Java, allows for separate compilation: this means that after compilation, you can combine your compiled code with code compiled separately, which can interact with the code you already compiled in an ad-hoc basis: code from both sides can call each others methods, instantiate each others classes, etc. without any limits.
+
+ @p
+ Even things like package-private do not help you: Java packages are separate-compile-able too, and multiple compilation runs can dump things in the same package! You may think that private members and methods may be some salvation, but the Java ecosystem typically relies heavily on reflection, which depends on the fact that these private things remain exactly as-they-are.
+
+ @p
+ Overall, this makes it difficult to do any meaningful optimization: you never know whether or not you can eliminate a class, method or field. Even if it's not used anywhere you can see, it could easily be used by some other code compiled separately, or accessed through reflection.
+
+ @p
+ With Scala.js, we have decided to forgo reflection, and forgo separate compilation, in exchange for smaller executables. This is made easier by the fact that the pure-Scala ecosystem makes little use of reflection overall. Thus, at the right before shipping your Scala.js app to your users, the Scala.js optimizer gathers up all your Scala.js code, determines which things are used and which are not, and eliminates all the un-used classes/methods/variables. This allows us to achieve a much smaller code size than is possible with reflection/separate-compilation support. Furthermore, because we forgo these two things, we can perform much more aggressive inlining and other compile-time optimizations than is possible with Scala-JVM, further reducing code size and improving performance.
+
+ @p
+ It's worth noting that such optimizations exist as an option on the JVM aswell: @lnk("Proguard", "http://proguard.sourceforge.net/") is a well known library for doing similar DCE/optimization for Java/Scala applications, and is extensively used in developing mobile applications which face similar "minimize-code-size" constraints that web-apps do. However, the bulk of Scala code which runs on the server does not use these tools.
+
+@sect{How Compilation Works}
+ @p
+ The Scala.js compilation pipeline is roughly split into multiple stages:
+
+ @ul
+ @li
+ @b{Initial Compilation}: @code{.scala} files to @code{.class} and @code{.sjsir} files
+ @li
+ @b{Fast Optimization}: @code{.sjsir} files to smallish/fast @code{.js} files
+ @li
+ @b{Full Optimization}: @code{.js} files to smaller/faster @code{.js} files
+
+ @p
+ @code{.scala} files are the source code you're familiar with. @code{.class} files are the JVM-targetted artifacts which aren't used, but we keep around: tools such as @lnk.misc.IntelliJ or @lnk.misc.Eclipse use these files to provide IDE support for Scala.js code, even if they take no part in compilation. @code{.js} files are the output Javascript, which we can execute in a web browser.
+ @p
+ @code{.sjsir} files are worth calling out: the name stands for "ScalaJS Intermediate Representation", and these files contain compiled code half-way between Scala and Javascript: most Scala features have by this point been replaced their Java/Javascript equivalents, but it still contains Types (which have all been inferred) that can aid in analysis. Many Scala.js specific optimizations take place on this IR.
+
+ @p
+ Each stage has a purpose, and together the stages do bring benefits to offset their cost in complexity. The original compilation pipeline was much more simple:
+
+ @ul
+ @li
+ @b{Compilation}: @code{.scala} files to @code{.js} files
+
+ @p
+ But produced far larger (20mb) and slower executables. This section will explore each stage and we'll learn what these stages do, starting with a small example program:
+
+ @hl.scala
+ def main() = {
+ var x = 0
+ while(x < 999){
+ x = x + "2".toInt
+ }
+ println(x)
+ }
+
+ @sect{Compilation}
+ @p
+ As described earlier, the Scala.js compiler is implemented as a Scala compiler plugin, and lives in the main repository in @lnk("compiler/", "https://github.com/scala-js/scala-js/tree/master/compiler"). The bulk of the plugin runs after the @code{mixin} phase in the @lnk("Scala compilation pipeline", "http://stackoverflow.com/a/4528092/871202"). By this point:
+
+ @ul
+ @li
+ Types and implicits have all been inferred
+ @li
+ Pattern-matches have been compiled to imperative code
+ @li
+ @hl.scala("@tailrec") functions have been translated to while-loops, @hl.scala{lazy val}s have been replaced by @hl.scala{var}s.
+ @li
+ @hl.scala{trait}s have been @lnk("replaced by interfaces and classes", "http://stackoverflow.com/a/2558317/871202")
+
+ @p
+ Overall, by the time the Scala.js compiler plugin takes action, most of the high-level features of the Scala language have already been removed. Compared to a hypothetical, alternative "from scratch" implementation, this approach has several advantages:
+
+ @ul
+ @li
+ It helps ensure that the semantics of these features always, 100% match that of Scala-JVM
+ @li
+ It reduces the amount of implementation work required by re-using the existing compilation phases
+
+ @p
+ This first phase is mostly a translation from the Scala compiler's internal AST to the Scala.js Intermediate Representation, and does not contain very many interesting optimizations. At the end of the initial compilation, the Scala compiler with Scala.js plugin results in two sets of files:
+
+ @ul
+ @li
+ The original @code{.class} files, as if it were compiled on the JVM. For code that does not use any Javascript interop, these are perfectly valid Java @code{.class} files full of bytecode and can even be executed on the JVM.
+ @li
+ The @code{.sjsir} files, destined for further compilation in the Scala.js pipeline.
+
+ @p
+ The ASTs defined in the @code{.sjsir} files is at about the same level of abstraction as the @hl.scala{Tree}s that the Scala compiler is working with at this stage. However, the @hl.scala{Tree}s within the Scala compiler contain a lot of cruft related to the compiler internals, and are also not easily serializable. This phase cleans them up into a "purer" format, (defined in the @lnk("ir/", "https://github.com/scala-js/scala-js/blob/master/ir/src/main/scala/scala/scalajs/ir/Trees.scala") folder) which is also serializable.
+
+ @p
+ This is the only phase in the Scala.js compilation pipeline that separate compilation is possible: you can compile many different sets of Scala.js @code{.scala} files separately, only to combine them later. This is used e.g. for distributing Scala.js libraries as Maven Jars, which are compiled separately by library authors to be combined into a final executable later.
+
+ @sect{Fast Optimization}
+ @hl.javascript
+ ScalaJS.c.LExample$.prototype.main__V = (function() {
+ var x = 0;
+ while ((x < 999)) {
+ x = ((x + new ScalaJS.c.sci_StringOps().init___T(
+ ScalaJS.m.s_Predef().augmentString__T__T("2")
+ ).toInt__I()) | 0)
+ };
+ ScalaJS.m.s_Predef().println__O__V(x)
+ });
+
+ @p
+ This phase is a whole-program optimization of the @code{.sjsir} files, and lives in the @lnk("tools/", "https://github.com/scala-js/scala-js/tree/master/tools") folder of the Scala.js repository. The end result is a rough translation of Scala into the equivalent Javascript (e.g. above):
+
+ @ul
+ @li
+ Scala-style method @hl.scala{def}s become Javascript-style prototype-function-assignment
+ @li
+ Scala @hl.scala{var}s become Javascript @hl.scala{var}s
+ @li
+ Scala @hl.scala{while}s become Javascript @hl.scala{while}s
+ @li
+ Implicits are materialized, hence all the @hl.scala{StringOps} and @hl.scala{augmentString} extensions are present in the output
+ @li
+ Classes and methods are fully-qualified, e.g. @hl.scala{println} becomes @hl.scala{Predef().println}
+ @li
+ Method names are qualified by their types, e.g. @hl.scala{__O__V} means that @hl.scala{println} takes @hl.scala{Object} and returns @hl.scala{void}
+
+ @p
+ This is an incomplete description of the translation, but it should give a good sense of how the translation from Scala to Javascript looks like. In general, the output is verbose but straightforward.
+
+ @p
+ In addition to this superficial translation, the optimizer does a number of things which are more subtle and vary from case to case. The rough operations that get performed are:
+
+ @ul
+ @li
+ @b{Dead-code elimination}: entry-points to the program such as @hl.scala("@JSExport")ed methods/classes are kept, as are any methods/classes that these reference. All others are removed. This reduces the potentially 20mb of Javascript generated by a naive compilation to a more manageable 700kb-1mb for a typical application
+ @li
+ @b{Inlining}: in cases where a method is only called in a few places, the optimizer inlines the implementation of the method at those callsites. This typically reduces the code size by a small amount, but offers a several-times speedup of the generated code by inlining away much of the overhead from the abstractions (implicit-conversions, higher-order-functions, etc.) in Scala's standard library.
+ @p
+ As a whole-program optimization, it tightly ties together the code it is compiling and does not let you e.g. inject additional classes later. This does not mean you cannot interact with external code at all: you can, but it has to go through explicitly @hl.scala{@@JSExport}ed methods and classes via Javascript Interop, and not on ad-hoc classes/methods within the module. Thus it's entirely possible to have multiple "whole-programs" running in the same browser; they just will likely have duplicate copies of e.g. standard library classes inside of them, since they cannot share the code as it's not exported.
+
+ @p
+ While the input for this phase is the aggregate @code{.sjsir} files from your project and all your dependencies, the output is executable Javascript. This phase usually runs in less than a second, outputs a Javascript blob in the 700kb-1mb range, and is suitable for repeated use during development. This corresponds to the @code{fastOptJS} command in SBT.
+
+ @sect{Full Optimization}
+ @hl.javascript
+ be.prototype.main=function(){
+ for(var a=0;999>a;)
+ a=a+(new de).g(S(L(),"2")).ne()|0;
+ ee(); L();
+ var b=F(fe); ge();
+ a=(new he).g(w(a)); b=bc(0,J(q(b,[a])));
+ ie(bc(L(),J(q(F(fe),[je(ke(ge().Vg),b)]))))
+ }
+
+ @p
+ The @lnk("Google Closure Compiler", "https://developers.google.com/closure/compiler/") (GCC) is a set of tools that work with Javascript. It has multiple @lnk("levels of optimization", "https://developers.google.com/closure/compiler/docs/compilation_levels"), doing everything from basic whitespace-removal to heavy optimization. It is a old, relatively mature project that is relied on both inside and outside google to optimize the delivery of Javascript to the browser.
+
+ @p
+ Scala.js uses GCC in its most aggressive mode: @lnk("Advanced Optimization", "https://developers.google.com/closure/compiler/docs/api-tutorial3"). GCC spits out a compressed, minified version of the Javascript (above) that @sect.ref{Fast Optimization} spits out: e.g. in the example above, all identifiers have been renamed to short strings, the @hl.javascript{while}-loop has been replaced by a @hl.javascript{for}-loop, and the @hl.scala{println} function has been inlined.
+
+ @p
+ As described in the linked documentation, GCC performs optimizations such as:
+
+ @ul
+ @li
+ Whitespace removal
+ @li
+ Variable and property renaming
+ @li
+ Dead code elimination
+ @li
+ Inlining
+
+ @p
+ Notably, GCC @i{does not preserve the semantics of arbitrary Javascript}! In particular, it only works for a subset of Javascript that it understands and can properly analyze. This is an issue when hand-writing Javascript for GCC since it's very easy to step outside that subset and have GCC break your code, but is not a worry when using Scala.js: the Scala.js optimizer (the previous phase in the pipeline) automatically outputs Javascript which GCC understands and can work with.
+ @p
+ GCC duplicates a lot of functionality that the Scala.js optimizer already does, such as DCE and inlining. It is entirely possible to skip the optimization phase, output the naive 20mb Javascript blob, and run GCC on it to bring the size down. However, GCC is much slower than the Scala.js optimizer, taking 60 seconds where the optimizer takes less than 1.
+
+ @p
+ Empirically, running GCC on the output of the optimizer produces the smallest output blobs: ~150-400kb, significantly smaller than the output of running either of them alone, and so that is what we do. This takes 5-10 seconds to run, which makes it somewhat slow for iterative development, so it's typically only run right before final testing and deployment. This corresponds to the @code{fullOptJS} command in SBT.
+
+@hr
+
+@p
+ This hopefully has given a good overview of how the Scala.js compilation pipeline works. The pipeline and optimizer is a work-in-progress, and is changing all the time in an attempt to achieve ever-smaller executables and ever-faster code.
+
+@p
+ This whole chapter has been focused on the @i{what} but not the @i{why}. The chapter on @sect.ref{Scala.js' Design Space} contains a section which talks about @sect.ref("Small Executables", "why we care so much about small executables"). \ No newline at end of file
diff --git a/book/src/main/scalatex/book/indepth/DesignSpace.scalatex b/book/src/main/scalatex/book/indepth/DesignSpace.scalatex
new file mode 100644
index 0000000..a1e807f
--- /dev/null
+++ b/book/src/main/scalatex/book/indepth/DesignSpace.scalatex
@@ -0,0 +1,239 @@
+@p
+ Scala.js is a relatively large project, and is the result of both an enormous amount of hard work as well as a number of decisions that craft what it's like to program in Scala.js today. Many of these decisions result in marked differences from the behavior of the same code running on the JVM. This chapter explores the reasoning and rationale behind these decisions.
+
+
+@sect{Why No Reflection?}
+ @p
+ Scala.js prohibits reflection as it makes dead-code elimination difficult, and the compiler relies heavily on dead-code elimination to generate reasonably-sized executables. The chapter on @sect.ref("The Compilation Pipeline") goes into more detail of why, but a rough estimate of the effect of various optimizations on a small application is:
+
+ @ul
+ @li
+ @b{Full Output} - ~20mb
+ @li
+ @b{Naive Dead-Code-Elimnation} - ~800kb
+ @li
+ @b{Inlining Dead-Code-Elimnation} - ~600kb
+ @li
+ @b{Minified by Google Closure Compiler} - ~200kb
+
+ @p
+ The default output size of 20mb makes the executables difficult to work with. Even though browsers can deal with 20mb Javascript blobs, it takes the browser several seconds to even load it, and up to a minute after that for the JIT to optimize the whole thing.
+
+ @sect{Dead Code Elimination}
+ @p
+ To illustrate why reflection makes things difficult, consider a tiny application:
+
+ @hl.scala
+ @@JSExport
+ object App extends js.JSApp{
+ @@JSExport
+ def main() = {
+ println(foo())
+ }
+ def foo() = 10
+ def bar = "i am a cow"
+ }
+ object Dead{
+ def complexFunction() = ...
+ }
+
+ @p
+ When the @sect.ref("Fast Optimization", "Scala.js optimizer"), looks at this application, it is able to deduce certain things immediately:
+
+ @ul
+ @li
+ @hl.scala{App} and @hl.scala{App.main} are exported via @hl.scala{@@JSExport}, and thus can't be considered dead code.
+ @li
+ @hl.scala{App.foo} is called from @hl.scala{App.main}, and so has to be kept around
+ @li
+ @hl.scala{App.bar} is never called from @hl.scala{App.main} or @hl.scala{App.foo}, and so can be eliminated
+ @li
+ @hl.scala{Dead}, including @hl.scala{Dead.complexFunction}, are not called from any live code, and can be eliminated.
+
+ @p
+ The actual process is a bit more involved than this, but this is a first-approximation of how the dead-code-elimination works: you start with a small set of live code (e.g. @hl.scala{@@JSExport}ed things), search out to find the things which are recursively reachable from that set, and eliminate all the rest. This means that the Scala.js compiler can eliminate, e.g., parts of the Scala standard library that you are not using. The standard library is not small, and makes up the bulk of the 20mb of the uncompressed blob.
+
+ @sect{Whither Reflection?}
+ @p
+ To imagine why reflection makes this difficult, imagine a slightly modified program which includes some reflective calls in @hl.scala{App.main}
+
+ @hl.scala
+ @@JSExport
+ object App extends js.JSApp{
+ @@JSExport
+ def main() = {
+ Class.forName(userInput()).getMethod(userInput()).invoke()
+ }
+ def foo() = 10
+ def bar = "i am a cow"
+ }
+ object Dead{
+ def complexFunction() = ...
+ }
+
+ @p
+ Here, we're assuming @hl.scala{userInput()} is some method which returns a @hl.scala{String} that was input by the user or otherwise somehow decided at runtime.
+ @p
+ We can start the same process: @hl.scala{App.main} is live since we @hl.scala{@@JSExport}ed it, but what objects or methods are reachable from @hl.scala{App.main}? The answer is: it depends on the values of @hl.scala{userInput()}, which we don't know. And hence we don't know which classes or methods are reachable! Depending on what @hl.scala{userInput()} returns, any or all methods and classes could be used by @hl.scala{App.main()}.
+ @p
+ This leaves us a few options:
+
+ @ul
+ @li
+ Keep every method or class around at runtime. This severely hampers the compiler's ability to optimize, and results in massive 20mb executables.
+ @li
+ Ignore reflection, and go ahead and eliminate/optimize things assuming reflection did not exist.
+ @li
+ Allow the user to annotate methods/classes that should be kept, and eliminate the rest.
+
+ @p
+ All three are possible options: Scala.js started off with #1. #3 is the approach used by @lnk("Proguard", "http://proguard.sourceforge.net/manual/examples.html#annotated"), which lets you annotate things e.g. @hl.scala{@@KeepApplication} to preserve things for reflection and preventing Proguard from eliminating them as dead code.
+
+ @p
+ In the end, Scala.js chose #2. This is helped by the fact that overall, Scala code tends not to use reflection as heavily as Java, or dynamic languages which use it heavily. Scala uses techniques such as @lnk("lambdas", "http://docs.scala-lang.org/tutorials/tour/anonymous-function-syntax.html") or @lnk("implicits", "http://docs.scala-lang.org/tutorials/tour/implicit-parameters.html") to satisfy many use cases which Java has traditionally used reflection for, while friendly to the optimizer.
+
+ @p
+ There are a range of use-cases for reflection where you want to inspect an object's structure or methods, where lambdas or implicits don't help. People use reflection to @lnk("serialize objects", "http://jackson.codehaus.org/DataBindingDeepDive"), or for @lnk("routing messages to methods", "https://access.redhat.com/documentation/en-US/Fuse_ESB_Enterprise/7.1/html/Implementing_Enterprise_Integration_Patterns/files/BasicPrinciples-BeanIntegration.html"). However, both these cases can be satisfied by...
+
+ @sect{Macros}
+
+ @p
+ The Scala programming language, since the 2.10.x series, has support for @lnk("Macros", "http://docs.scala-lang.org/overviews/macros/overview.html") in the language. Although experimental, these are heavily used in many projects such as Play and Slick and Akka, and allow a developer to perform compile-time computations and generate code where-ever the macros are used.
+
+ @p
+ People typically think of macros as AST-transformers: you pass in an AST and get a modified AST out. However, in Scala, these ASTs are strongly-typed, and the macro is able to inspect the types involved in generating the output AST. This leads to a lot of @lnk("interesting techniques", "http://docs.scala-lang.org/overviews/macros/implicits.html") around macros where you synthesize ASTs based on the type (explicit or inferred) of the macro callsite, something that is impossible in dynamic languages.
+
+ @p
+ Practically, this means that you can use macros to do things such as inspecting the methods, fields and other type-level properties of a typed value. This allows us to do things like @lnk("serialize objects with no boilerplate", "https://github.com/lihaoyi/upickle"):
+
+ @hl.scala
+ import upickle._
+
+ case class Thing(a: Int, b: String)
+ write(Thing(1, "gg"))
+ // res23: String = {"a": 1, "b": "gg"}
+
+ @p
+ Or to @lnk("route messages to the appropiate methods", "https://github.com/lihaoyi/autowire") without boilerplate, and @i{without} using reflection!
+
+ @p
+ The fact that you can satisfy these use cases with macros is non-obvious: in dynamic languages, macros only get an AST, which is basically opaque when you're only passing a single value to it. With Scala, you get the value @i{together with it's type}, which lets you inspect the type and generate the proper serialization/routing code that is impossible to do in a dynamic language with macros.
+
+ @p
+ Using macros here also plays well with the Scala.js optimizer: the macros are fully expanded before the optimizer is run, so by the time the optimizer sees the code, there is no more magic left: it is then free to do dead-code-elimination/inlining/other-optimizations without worrying about reflection causing the code to do weird things at runtime. Thus, we've managed to substitute most of the main use-cases of reflection, and so can do without it.
+
+@sect{Why does error behavior differ?}
+ @p
+ Scala.js deviates from the semantics of Scala-JVM in several ways. Many of these ways revolve around the edge-conditions of a program: what happens when something goes wrong? An array index is out of bounds? An integer is divided-by-zero? These differences cause some amount of annoyance when debugging, since when you mess up an array index, you expect an exception, not silently-invalid-data!
+
+ @p
+ In most of these cases, it was a trade-off between performance and correctness. These are situations where the default semantics of Scala deviate from that of Javascript, and Scala.js would have to perform extra work to emulate the desired behavior. For example, compare the division behavior of the JVM and Javascript.
+ @sect{Divide-by-zero: a case study}
+ @hl.scala
+ /*JVM*/
+ 15 / 4 // 3
+ @hl.javascript
+ /*JS*/
+ 15 / 4 // 3.25
+ @p
+ On the JVM, integer division is a primitive, and dividing @hl.scala{15 / 4} gives @hl.scala{3}. However, in Javascript, it gives @hl.javascript{3.25}, since all numbers of double-precision floating points.
+
+ @p
+ Scala.js works around this in the general case by adding a @hl.javascript{| 0} to the translation, e.g.
+
+ @hl.scala
+ /*JVM*/
+ 15 / 4 // 3
+ @hl.javascript
+ /*JS*/
+ (15 / 4) | 0 // 3
+
+ @p
+ This gives the correct result for most numbers, and is reasonably efficient. However, what about dividing-by-zero?
+
+ @hl.scala
+ /*JVM*/
+ 15 / 0 // ArithmeticException
+ @hl.javascript
+ /*JS*/
+ 15 / 0 // Infinity
+ (15 / 0) | 0 // 0
+
+ @p
+ On the JVM, the JVM is kind enough to throw an exception for you. However, in Javascript, the integer simply wraps around to @hl.javascript{Infinity}, which then gets truncated down to zero.
+ @p
+ So that's the current behavior of integers in Scala.js. One may ask: can we fix it? And the answer is, we can:
+ @hl.scala
+ /*JVM*/
+ 1 / 0 // ArithmeticException
+ @hl.javascript
+ /*JS*/
+ function intDivide(x, y){
+ var z = x / y
+ if (z == Infinity) throw new ArithmeticException("Divide by Zero")
+ else return z
+ }
+ intDivide(1, 0) // ArithmeticException
+ @p
+ This translation fixes the problem, and enforces that the @hl.scala{ArithmeticException} is thrown at the correct time. However, this approach causes some overhead: what was previously two primitive operations is now a function call, a local variable assignment, and a conditional. That is a lot more expensive than two primitive operations!
+
+ @sect{The Performance/Correctness Tradeoff}
+ @p
+ In the end, a lot of the semantic differences listed here come down to the same tradeoff: we could make the code behave more-like-Scala, but at a cost of adding overhead via function calls and other checks. Furthermore, the cost is paid regardless of whether the "exceptional case" is triggered or not: in the example above, every division in the program pays the cost!
+ @p
+ The decision to not support these exceptional cases comes down to a value judgement: how often do people actually depend on an exception being thrown as part of their program semantics, e.g. by catching it and performing actions? And how often are they just a way of indicating bugs? It turns out that very few @hl.scala{ArithmeticException}s, @hl.scala{ArrayIndexOutOfBoundsException}s, or similar are actually a necessary part of the program! They exist during debugging, but after that, these code paths are never relied upon "in production".
+ @p
+ Thus Scala.js goes for a compromise: in the Fast Optimization mode, we run the code with all these checks in place, so as to catch cases where these errors occur close-to-the-source and make it easy for you to debug them. In Full Optimization mode, on the other hand, we remove these checks, assuming you've already ran through these cases and found any bugs during development.
+ @p
+ This is a common pattern in situations where there's a tradeoff between debuggability and speed. In Scala.js' case, it allows us to get good debuggability in development, as well as good performance in production. There's some loss in debuggability in development, sacrificed in exchange for greater performance.
+
+@sect{Small Executables}
+ Why do we care so much about how big our executables are in Scala.js? Why don't we care about how big they are on Scala-JVM? This is mostly due to three reasons:
+
+ @ul
+ @li
+ When cross-compiling Scala to Javascript, the end-result tends to be much more verbose than when cross-compiled to Java Bytecode.
+ @li
+ Scala.js typically is run in web browsers, which typically do not work well with large executables compared to e.g. the JVM
+ @li
+ Scala.js often is delivered to many users over the network, and long download times force users to wait, degrading the user experience
+
+ @p
+ These factors combined means that Scala.js has to put in extra effort to optimize the code to reduce it's size at compile-time.
+
+ @sect{Raw Verbosity}
+ @p
+ Scala.js compiles to Javascript source code, while Scala-JVM compiles to Java bytecode. Java bytecode is a binary format and thus somewhat optimized for size, while Javascript is textual and is designed to be easy to read and write by hand.
+ @p
+ What does these mean, concretely? This means that a symbol marking something, e.g. the start of a function, is often a single byte in Java bytecode. Even more, it may not have any delimiter at all, instead the meaning of the binary data being inferred from its position in the file! On the other hand, in Javascript, declaring a function takes a long-and-verbose @hl.javascript{function} keyword, which together with peripheral punctuation (@code{.}, @code{ = }, etc.) often adds up to tens of bytes to express a single idea.
+ @p
+ What does this mean concretely? This means that expressing the same meaning in Javascript usually takes more "raw code" than expressing the same meaning in Java bytecode. Even though Java bytecode is relatively verbose for a binary format, it still is significantly more concise the Javascript, and it shows: the Scala standard library weighs in at a cool 6mb on Scala-JVM, while it weighs 20mb on Scala.js.
+ @p
+ All things being equal, this would mean that Scala.js would have to work harder to keep down code-size than Scala-JVM would have to. Alas, not all other things are equal.
+
+ @sect{Browsers Performance}
+ @p
+ Without any optimization, a naive compilation to Scala.js results in an executable (Including the standard library) weighing around 20mb. On the surface, this isn't a problem: runtimes like the JVM have no issue with loading 20mb of Java bytecode to execute; many large desktop applications weigh in the 100s of megabytes while still loading and executing fine.
+ @p
+ However, the web browser isn't a native execution environment; loading 20mb of Javascript is sufficient to heavily tax even the most modern web browsers such as Chrome and Firefox. Even though most of the code comprises class and method definitions that never have their contents executed, loading such a heavy load into e.g. Chrome makes it freeze for 5-10 seconds initially. Even after that, even after the code has all been parsed and isn't been actively executed, having all this Javascript makes the browser sluggish for up to a minute before the JIT compiler can speed things up.
+ @p
+ Overall, this means that you probably do not want to work with un-optimized Scala.js executables. Even for development, the slow load times and initial sluggishness make testing the results of your hard-work in the browser a frustrating experience. But that's not all...
+
+ @sect{Deployment Size}
+ @p
+ Scala.js applications often run in the browser. Not just any browser, but the browsers of your users, who had come to your website or web-app to try and accomplish some task. This is in stark contrast the Scala-JVM applications, which most often run on servers: servers that you own and control, and can deploy code to at your leisure.
+
+ @p
+ When running code on your own servers in some data center, you often do not care how big the compiled code is: the Scala standard library is several (6-7) megabytes, which added to your own code and any third-party libraries you're using, may add up to tens of megabytes, maybe a hundred or two if it's a relatively large application. Even that pales in comparison to the size of the JVM, which weighs in the 100s of megabytes.
+ @p
+ Even so, you are deploying your code on an machine (virtual or real) which has several gigabytes of memory and 100s of gigabytes of disk space. Even if the size of the code makes deployment slower, you only deploy fresh code a handful of times a day at most, and the size of your executable typically does not worry you.
+ @p
+ Scala.js is different: it runs in the browsers of your users. Before it can run in their browser, it first has to be downloaded, probably over a connection that is much slower than the one used to deploy your code to your servers or data-center. It probably is downloaded thousands of times per day, and every user which downloads it must pay the cost of waiting for it to finish downloading before they can take any actions on your website.
+
+ @p
+ A typical website loads ~100kb-1mb of Javascript, and 1mb is on the heavy side. Most Javascript libraries weigh in on the order of 50-100kb. For Scala.js to be useful in the browser, it has to be able to compare favorably with these numbers.
+
+ @hr
+
+ @p
+ Thus, while on Scala-JVM you typically have executables that (including dependencies) end up weighing 10s to 100s of megabytes, Scala.js has a much tighter budget. A hello world Scala.js application weighs in at around 100kb, and as you write more code and use more libraries (and parts of the standard library) this number rises to the 100s of kb. This isn't tiny, especially compared to the many small Javascript libraries out there, but it definitely is much smaller than what you'd be used to on the JVM.
diff --git a/book/src/main/scalatex/book/indepth/JavaAPIs.scalatex b/book/src/main/scalatex/book/indepth/JavaAPIs.scalatex
new file mode 100644
index 0000000..0ad886d
--- /dev/null
+++ b/book/src/main/scalatex/book/indepth/JavaAPIs.scalatex
@@ -0,0 +1,44 @@
+@p
+ Below is a list of classes from the Java Standard Library that are available from Scala.js. In general, much of @hl.scala{java.lang}, and parts of @hl.scala{java.io}, @hl.scala{java.util} and @hl.scala{java.net} have been ported over. This means that all these classes are available for use in Scala.js applications despite being part of the Java standard library.
+@p
+ There are many reasons you may want to port a Java class to Scala.js: you want to use it directly, you may be trying to port a library which uses it. In general, we haven't been porting things "for fun", and obscure classes like @hl.scala{org.omg.corba} will likely never be ported: we've been porting things as the need arises in order to support libraries (e.g. @lnk("Scala.Rx", "https://github.com/lihaoyi/scala.rx") that need them.
+
+@sect{Available Java APIs}
+
+ @ul
+ @for(data <- BookData.javaAPIs)
+ @li
+ @a(data._1, href:=data._2)
+
+@sect{Porting Java APIs}
+ @p
+ The process for making Java library classes available in Scala.js is relatively straightforward:
+ @ul
+ @li
+ Find a class that you want to use in Scala.js, but is not implemented.
+ @li
+ Write a clean-room implementation in Scala, without looking at the source code of @lnk("OpenJDK", "http://openjdk.java.net/"). This is due to legal-software-license incompatibility between OpenJDK and Scala.js. Reading the docs or specification are fine, as is looking at the source of alternate implementations such as @lnk("Harmony", "http://harmony.apache.org/")
+ @li
+ Submit a pull-request to the @lnk("Scala.js repository", "https://github.com/scala-js/scala-js"), including your implementation, together with tests. See the @lnk("existing tests", "https://github.com/scala-js/scala-js/tree/master/test-suite/src/test/scala/scala/scalajs/testsuite/javalib") in the repository if you need examples of how to write your own.
+
+ @p
+ In general, this is a simple process, for "pure-Java" classes which do not use any special JVM/Java-specific APIs. However, this will not be possible for classes which do! This means that classes that make use of Java-specific things like:
+
+ @ul
+ @li
+ Threads
+ @li
+ Filesystem APIs
+ @li
+ Network APIs
+ @li
+ @hl.scala{sun.misc.Unsafe}
+
+ @p
+ And other similar APIs will either need to be rewritten to not-use them. For example, @hl.scala{AtomicXXXs} can be written without threading/unsafe APIs because Javascript is single-threaded, making the implementation for e.g. an @hl.scala{AtomicBoolean} pretty trivial:
+
+ @hl.ref("output/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicBoolean.scala")
+
+ @p
+ Others can't be ported at all (e.g. @code{java.io.File}) simply because the API capabilities they provide (blocking reads & writes to files) do not exist in the Javascript runtime.
+
diff --git a/book/src/main/scalatex/book/indepth/JavascriptInterop.scalatex b/book/src/main/scalatex/book/indepth/JavascriptInterop.scalatex
new file mode 100644
index 0000000..30404ce
--- /dev/null
+++ b/book/src/main/scalatex/book/indepth/JavascriptInterop.scalatex
@@ -0,0 +1 @@
+TODO \ No newline at end of file
diff --git a/book/src/main/scalatex/book/indepth/SemanticDifferences.scalatex b/book/src/main/scalatex/book/indepth/SemanticDifferences.scalatex
new file mode 100644
index 0000000..ebfd1db
--- /dev/null
+++ b/book/src/main/scalatex/book/indepth/SemanticDifferences.scalatex
@@ -0,0 +1,247 @@
+@import BookData._
+@p
+ Although Scala.js tries very hard to maintain compatibility with Scala-JVM, there are some parts where the two platforms differs. This can be roughly grouped into two things: differences in the libraries available,and differences in the language itself. This chapter will cover both of these facets.
+
+@sect{Language Differences}
+ @sect{Floats are Doubles}
+ @p
+ Since JavaScript doesn't have a native float type, we sometimes represent Floats using doubles/numbers, rather than with lower-precision 32-bit floats.
+ @p
+ The choice of how to represent floats is up to the implementation. You may not rely on floats providing 64-bit floating point precision.
+ @p
+ Float literals are truncated to their (binary) precision. However, output does not truncate to that precision. This can lead to the following behavior (this works as expected when using doubles):
+
+ @split
+ @half
+ @hl.scala
+ // Scala-JVM
+ > println(13.345f)
+ 13.345
+
+ @half
+ @hl.scala
+ // Scala.js
+ > println(13.345f)
+ 13.345000267028809
+
+ @sect{Int division by 0 is undefined}
+ @p
+ Unlike the JVM where dividing an integer type by 0 throws an exception, in Scala.js integer division by 0 is undefined. This allows for efficient implementation of division. Dividing a Double or Float by 0 yields positive or negative infinity as expected.
+
+ @split
+ @half
+ @hl.scala
+ // Scala-JVM
+ > 10 / 0
+ java.lang.ArithmeticException: / by zero
+ @half
+ @hl.scala
+ // Scala.js
+ > 10 / 0
+ 0
+
+ @p
+ This is a consequence of the eternal trade-off between performance and correctness, as described in the section @sect.ref{Why does error behavior differ?}
+
+ @sect{Primitive isInstanceOf tests are based on value}
+ @p
+ Instance tests (and consequently pattern matching) on any of @hl.scala{Byte}, @hl.scala{Short}, @hl.scala{Int}, @hl.scala{Float}, @hl.scala{Double} are based on the value and not the type they were created with. The following are examples:
+
+ @ul
+ @li
+ @hl.scala{1} matches @hl.scala{Byte}, @hl.scala{Short}, @hl.scala{Int}, @hl.scala{Float}, @hl.scala{Double}
+ @li
+ @hl.scala{128} (> @hl.scala{Byte.MaxValue}) matches @hl.scala{Short}, @hl.scala{Int}, @hl.scala{Float}, @hl.scala{Double}
+ @li
+ @hl.scala{32768} (> @hl.scala{Short.MaxValue}) matches @hl.scala{Int}, @hl.scala{Float}, @hl.scala{Double}
+ @li
+ @hl.scala{2147483648} (> @hl.scala{Int.MaxValue}) matches @hl.scala{Float}, @hl.scala{Double}
+ @li
+ @hl.scala{1.2} matches @hl.scala{Float}, @hl.scala{Double}
+ @p
+ As a consequence, the following apparent subtyping relationship holds:
+
+ @hl.scala
+ Byte <:< Short <:< Int <:< Float =:= Double
+
+ @sect{toString for integral Floats and Doubles}
+ @p
+ Calling toString on a Float or a Double that holds an integral value, will not append ".0" to that value:
+
+ @split
+ @half
+ @hl.scala
+ // Scala-JVM:
+ > println(1.0)
+ 1.0
+ @half
+ @hl.scala
+ // Scala.js:
+ > println(1.0)
+ 1
+ @p
+ This is due to how numeric values are represented at runtime in Scala.js: @hl.scala{Float}s and @hl.scala{Double}s are raw Javascript @hl.scala{Number}s, and their @hl.scala{toString} behavior follows from that.
+
+ @p
+ Use a formatting interpolator if you always want to show decimals:
+
+ @hl.scala
+ val x = 1.0
+ println(f"$x%.1f")
+ // Scala-JVM: 1.0
+ // Scala.js: 1.0
+
+ @sect{Unit}
+ @p
+ @hl.scala{scala.Unit} is represented using JavaScript's undefined. Therefore, calling @hl.scala{toString()} on @hl.scala{Unit} will return @hl.scala{"undefined"} rather than @hl.scala{"()"}. In practice, this shouldn't matter for most use cases.
+
+ @sect{Reflection}
+ @p
+ Java reflection and Scala reflection, are not supported. There is limited support for @lnk("java.lang.Class", "https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html"), e.g., @hl.scala{obj.getClass.getName} will work for any Scala.js object but not for objects that come from JavaScript interop (i.e. anything which @hl.scala{extends js.Object}). Reflection makes it difficult to perform the optimizations that Scala.js heavily relies on. For a more detailed discussion on this topic, take a look at the section @sect.ref{Why No Reflection?}.
+
+ @sect{Exceptions}
+ @p
+ In general, Scala.js supports exceptions, including catching them based on their type. However, exceptions that are typically triggered by the JVM have flaky semantics, in particular:
+
+ @ul
+ @li
+ @hl.scala{ArrayIndexOutOfBoundsException} is never thrown. Instead, the value becomes @hl.javascript{undefined}, which will probably propagate through your program and blow up somewhat later.
+ @li
+ @hl.scala{NullPointerException} is reported as JavaScript @hl.scala{TypeError} instead.
+ @li
+ @hl.scala{StackOverflowError} is unsupported since the underlying JavaScript exception type varies based on the browser. e.g. in Chrome the browser just hangs and kills the process/tab without any chance for the developer to catch the error.
+
+ @sect{Regular expressions}
+ @p
+ JavaScript regular expressions are slightly different from Java regular expressions. The support for regular expressions in Scala.js is implemented on top of JavaScript regexes.
+ @p
+ This sometimes has an impact on functions in the Scala library that use regular expressions themselves. A list of known functions that are affected is given here:
+ @ul
+ @li
+ @hl.scala{StringLike.split(x: Array[Char])}
+
+ @sect{Symbols}
+ @p
+ @hl.scala{scala.Symbol} is supported, but is a potential source of memory leaks in applications that make heavy use of symbols. The main reason is that JavaScript does not support weak references, causing all symbols created by Scala.js tow remain in memory throughout the lifetime of the application.
+
+ @sect{Enumerations}
+ @p
+ The methods @hl.scala{Value()} and @hl.scala{Value(i: Int)} on @lnk.scala{scala.Enumeration} use reflection to retrieve a string representation of the member name and are therefore -- in principle -- unsupported. However, since Enumerations are an integral part of the Scala library, Scala.js adds limited support for these two methods:
+ @p
+ Calls to either of these two methods of the forms:
+ @hl.scala
+ val <ident> = Value
+ val <ident> = Value(<num>)
+ @p
+ are statically rewritten to (a slightly more complicated version of):
+ @hl.scala
+ val <ident> = Value("<ident>")
+ val <ident> = Value(<num>,"<ident>")
+ @p
+ Note that this also includes calls like
+ @hl.scala
+ val A,B,C,D = Value
+ @p
+ since they are desugared into separate val definitions.
+ @p
+ Calls to either of these two methods which could not be rewritten, or calls to constructors of the protected Val class without an explicit name as parameter, will issue a warning.
+ @p
+ Note that the name rewriting honors the @hl.scala{nextName} iterator. Therefore, the full rewrite is:
+ @hl.scala
+ val <ident> = Value(
+ if (nextName != null && nextName.hasNext)
+ nextName.next()
+ else
+ "<ident>"
+ )
+ @p
+ We believe that this covers most use cases of scala.Enumeration. Please let us know if another (generalized) rewrite would make your life easier.
+
+@sect{Library Differences}
+ @val myTable = Seq(
+ ("Most of java.lang.*", "java.lang.Thread, java.lang.Runtime, ..."),
+ ("Almost all of scala.*", "scala.collection.parallel, scala.tools.nsc"),
+ ("Some of java.util.*", "org.omg.CORBA, sun.misc.*"),
+ ("Macros: uPickle, Scala-Async, Scalaxy, etc", "Reflection: Scala-Pickling, Scala-Reflect"),
+ ("Shapeless, Scalaz, Scalatags, uTest", "Scalatest, Scalate"),
+ ("XMLHttpRequest, Websockets. Localstorage", "Netty, Akka, Spray, File IO, JNI"),
+ ("HTML DOM, Canvas, WebGL", "AWT, Swing, SWT, OpenGL"),
+ ("Chipmunk.js, Hand.js, React.js, jQuery", "Guice, JUnit, Apache-Commons, log4j"),
+ ("IntelliJ, Eclipse, SBT, Chrome console, Firebug", "Scala REPL, Yourkit, VisualVM, JProfiler")
+ )
+
+ @p
+ Scala.js differs from Scala-JVM not just in the corner-cases of the language, but also in the libraries available. Scala-JVM has access to JVM APIs and the wealth of the Java libraries, while Scala.js has access to Javascript APIs and Javascript libraries. It's also possible to write pure-Scala libraries that run on both Scala.js and Scala-JVM, as detailed @a("here").
+ @p
+ This table gives a quick overview of the sorts of libraries you can and can't use when working on Scala.js:
+
+ @val tableHead = pureTable(th("Can Use"), th("Can't Use"))
+
+ @tableHead
+ @for(tuple <- myTable)
+ @tr
+ @td{@tuple._1}@td{@tuple._2}
+
+ @p
+ We'll go into each section bit by bit
+
+ @sect{Standard Library}
+ @tableHead
+ @for(tuple <- myTable.slice(0, 3))
+ @tr
+ @td{@tuple._1}@td{@tuple._2}
+
+ @p
+ You can use more-or-less the whole Scala standard library in Scala.js, sans some more esoteric components like the parallel collections or the tools. Furthermore, we've ported some subset of the Java standard library that many common Scala libraries depends on, including most of @hl.scala{java.lang.*} and some of @hl.scala{java.util.*}.
+ @p
+ There isn't a full list of standard library library APIs which are available from Scala.js, but it should be enough to give you a rough idea of what is supported. The full list of classes that have been ported to Scala.js is available under @sect.ref{Available Java APIs}
+
+ @sect{Macros v.s. Reflection}
+ @tableHead
+ @for(tuple <- myTable.slice(3, 4))
+ @tr
+ @td{@tuple._1}@td{@tuple._2}
+
+ @p
+ As described @sect.ref("Why No Reflection?", "here"), Reflection is not supported in Scala.js, due to the way it inhibits optimization. This doesn't just mean you can't use reflection yourself: many third-party libraries also use reflection, and you won't be able to use them either.
+
+ @p
+ On the other hand, Scala.js does support Macros, and macros can in many ways substitute many of the use cases that people have traditionally used reflection for (see @sect.ref("Macros", "here")). For example, instead of using a reflection-based serialization library like @lnk.github.scalaPickling, you can use a macro-based library such as @lnk.github.uPickle.
+
+ @sect{Pure-Scala v.s. Java Libraries}
+ @tableHead
+ @for(tuple <- myTable.slice(4, 5))
+ @tr
+ @td{@tuple._1}@td{@tuple._2}
+ @p
+ Scala.js has access to any pure-Scala libraries that you have cross-compiled to Scala.js, and cross-compiling a pure-Scala library with no dependencies is straightforward. Many of them, such as the ones listed above, have already been cross-compiled and can be used via their maven coordinates.
+ @p
+ You cannot use any libraries which have a Java dependency. This means libraries like @lnk.misc.ScalaTest or @lnk.misc.Scalate, which depend on a number of external Java libraries or source files, cannot be used from Scala.js. You can only use libraries which have no dependency on Java libraries or sources.
+
+ @sect{Javascript APIs v.s. JVM APIs}
+ @tableHead
+ @for(tuple <- myTable.slice(5, 7))
+ @tr
+ @td{@tuple._1}@td{@tuple._2}
+
+ @p
+ Apart from depending on Java sources, the other thing that you can't use in Scala.js are JVM-specific APIs. This means that anything which goes down to the underlying operating system, filesystem, GUI or network are unavailable in Scala.js. This makes sense when you consider that these capabilities are no provided by the browser which Scala.js runs in, and it's impossible to re-implement them ourselves.
+ @p
+ In exchange for this, Scala.js provides you access to Browser APIs that do related things. Although you can't set up a HTTP server to take in-bound requests, you can make out-bound requests using @lnk.dom.XMLHttpRequest to other servers. You can't write to the filesystem or databases directly, but you can write to the @hl.scala{dom.localStorage} provided by the browser. You can't use Swing or AWT or WebGL but instead work with the DOM and Canvas and WebGL.
+ @p
+ Naturally, none of these are an exact replacement, as the browser environment is fundamentally different from that of a desktop application running on the JVM. Nonetheless, there are many analogues, and if so desired you can write code to abstract away these differences and run on both Scala.js and Scala-JVM
+
+
+ @sect{Scala/Browser tooling v.s. Java tooling}
+ @tableHead
+ @for(tuple <- myTable.slice(7, 8))
+ @tr
+ @td{@tuple._1}@td{@tuple._2}
+
+
+ @p
+ Lastly, there is the matter of tools. Naturally, all the Scala tools which depend on the JVM are out. This means things like the @lnk("Yourkit", "http://www.yourkit.com/"), @lnk("VisualVM", "http://visualvm.java.net/") and @lnk("JProfiler", "https://www.ej-technologies.com/products/jprofiler/overview.html") profilers, as well as things like the Scala command-line REPL which relies on classloaders and other such things to run on the JVM
+ @p
+ On the other hand, you do get to keep and continue using many tools which are build for Scala but JVM-agnostic. For example, IDEs such a @lnk.misc.IntelliJ and @lnk.misc.Eclipse work great with Scala.js; from their point of view, it's just Scala, and things like code-navigation, refactoring and error-highlighting all work out of the box. SBT works with Scala.js too, and you see the same compile-erorrs in the command-line as you would in vanilla Scala, and even things like incremental compilation work un-changed.
+ @p
+ Lastly, you gain access to browser tools that don't work with normal Scala: you can use the Chrome or Firefox consoles to poke at your Scala.js application from the command line, or their profilers/debuggers. With source maps set up, you can even step-through debug your Scala.js application directly in Chrome.
diff --git a/build.sbt b/build.sbt
new file mode 100644
index 0000000..8df7b50
--- /dev/null
+++ b/build.sbt
@@ -0,0 +1,99 @@
+
+import scala.scalajs.sbtplugin.ScalaJSPlugin._
+import ScalaJSKeys._
+
+lazy val scalaParser = project.in(file("scalaParser")).settings(
+ scalaVersion := "2.11.4",
+ libraryDependencies ++= Seq(
+ "com.lihaoyi" %% "utest" % "0.2.4",
+ "com.lihaoyi" %% "acyclic" % "0.1.2" % "provided",
+ "org.parboiled" %% "parboiled" % "2.0.1"
+ ),
+ addCompilerPlugin("com.lihaoyi" %% "acyclic" % "0.1.2"),
+ testFrameworks += new TestFramework("utest.runner.JvmFramework")
+)
+lazy val scalatexApi = project.in(file("scalatexApi"))
+ .dependsOn(scalaParser)
+ .settings(
+ scalaVersion := "2.11.4",
+ libraryDependencies ++= Seq(
+ "com.lihaoyi" %% "utest" % "0.2.4",
+ "com.scalatags" %% "scalatags" % "0.4.2",
+ "org.scala-lang" % "scala-reflect" % scalaVersion.value,
+ "com.lihaoyi" %% "acyclic" % "0.1.2" % "provided",
+ "org.parboiled" %% "parboiled" % "2.0.1"
+ ),
+ addCompilerPlugin("com.lihaoyi" %% "acyclic" % "0.1.2"),
+ testFrameworks += new TestFramework("utest.runner.JvmFramework")
+)
+
+lazy val scalatexPlugin = Project(
+ id = "scalatexPlugin",
+ base = file("scalatexPlugin"),
+ dependencies = Seq(scalatexApi)
+) settings (
+ scalaVersion := "2.11.4",
+ libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value,
+ publishArtifact in Compile := false
+)
+
+lazy val book = Project(
+ id = "book",
+ base = file("book"),
+ dependencies = Seq(scalatexApi)
+).settings(
+ scalaVersion := "2.11.4",
+ libraryDependencies ++= Seq(
+ "org.webjars" % "highlightjs" % "8.2-1",
+ "org.webjars" % "pure" % "0.5.0",
+ "org.webjars" % "font-awesome" % "4.2.0",
+ "org.webjars" % "react" % "0.11.1",
+ "org.scala-lang" % "scala-reflect" % scalaVersion.value,
+ "org.scala-lang" % "scala-compiler" % scalaVersion.value,
+ "org.eclipse.jgit" % "org.eclipse.jgit" % "3.5.1.201410131835-r",
+ "com.lihaoyi" %%% "upickle" % "0.2.5"
+ ),
+ (resources in Compile) += {
+ (fullOptJS in (demos, Compile)).value
+ (artifactPath in (demos, Compile, fullOptJS)).value
+ },
+ (unmanagedResourceDirectories in Compile) ++=
+ (unmanagedResourceDirectories in (demos, Compile)).value,
+ scalacOptions in Compile ++= {
+ val jar = (Keys.`package` in (scalatexPlugin, Compile)).value
+ val addPlugin = "-Xplugin:" + jar.getAbsolutePath
+ // add plugin timestamp to compiler options to trigger recompile of
+ // main after editing the plugin. (Otherwise a 'clean' is needed.)
+ val dummy = "-Jdummy=" + jar.lastModified
+ val options = "-P:scalatex-options:" + sourceDirectory.value / "scalatex"
+ Seq(addPlugin, dummy)
+ },
+ watchSources ++= {
+ ((sourceDirectory in Compile).value / "scalatex" ** "*.scalatex").get
+ },
+ (watchSources in Test) ++= {
+ ((sourceDirectory in Test).value / "scalatex" ** "*.scalatex").get
+ },
+ libraryDependencies += "com.lihaoyi" %% "acyclic" % "0.1.2" % "provided",
+ autoCompilerPlugins := true,
+ addCompilerPlugin("com.lihaoyi" %% "acyclic" % "0.1.2")
+)
+
+lazy val demos = project.in(file("examples/demos"))
+
+lazy val simple = project.in(file("examples/crossBuilds/simple"))
+
+lazy val simple2 = project.in(file("examples/crossBuilds/simple2"))
+
+lazy val clientserver = project.in(file("examples/crossBuilds/clientserver"))
+
+lazy val client = ProjectRef(file("examples/crossBuilds/clientserver"), "client")
+
+lazy val server = ProjectRef(file("examples/crossBuilds/clientserver"), "server")
+
+lazy val clientserver2 = project.in(file("examples/crossBuilds/clientserver2"))
+
+lazy val client2 = ProjectRef(file("examples/crossBuilds/clientserver2"), "client")
+
+lazy val server2 = ProjectRef(file("examples/crossBuilds/clientserver2"), "server")
+
diff --git a/examples/crossBuilds/clientserver/build.sbt b/examples/crossBuilds/clientserver/build.sbt
new file mode 100644
index 0000000..e5b70ff
--- /dev/null
+++ b/examples/crossBuilds/clientserver/build.sbt
@@ -0,0 +1,36 @@
+import utest.jsrunner.JsCrossBuild
+import scala.scalajs.sbtplugin.ScalaJSPlugin._
+import ScalaJSKeys._
+val sharedSettings = Seq(
+ unmanagedSourceDirectories in Compile +=
+ baseDirectory.value / "shared" / "main" / "scala",
+ libraryDependencies ++= Seq(
+ "com.scalatags" %%% "scalatags" % "0.4.2",
+ "com.lihaoyi" %%% "upickle" % "0.2.5"
+ ),
+ scalaVersion := "2.11.4"
+)
+
+lazy val client = project.in(file("client"))
+ .settings(scalaJSSettings:_*)
+ .settings(sharedSettings:_*)
+ .settings(
+ libraryDependencies ++= Seq(
+ "org.scala-lang.modules.scalajs" %%% "scalajs-dom" % "0.6"
+ )
+)
+
+lazy val server = project.in(file("server"))
+ .settings(sharedSettings:_*)
+ .settings(
+ libraryDependencies ++= Seq(
+ "io.spray" %% "spray-can" % "1.3.2",
+ "io.spray" %% "spray-routing" % "1.3.2",
+ "com.typesafe.akka" %% "akka-actor" % "2.3.6"
+ ),
+ (resources in Compile) += {
+ (fastOptJS in (client, Compile)).value
+ (artifactPath in (client, Compile, fastOptJS)).value
+ }
+)
+
diff --git a/examples/crossBuilds/clientserver/client/shared/main/scala/simple/FileData.scala b/examples/crossBuilds/clientserver/client/shared/main/scala/simple/FileData.scala
new file mode 100644
index 0000000..d3d2f91
--- /dev/null
+++ b/examples/crossBuilds/clientserver/client/shared/main/scala/simple/FileData.scala
@@ -0,0 +1,3 @@
+package simple
+
+case class FileData(name: String, size: Long) \ No newline at end of file
diff --git a/examples/crossBuilds/clientserver/client/src/main/scala/simple/Client.scala b/examples/crossBuilds/clientserver/client/src/main/scala/simple/Client.scala
new file mode 100644
index 0000000..adefe01
--- /dev/null
+++ b/examples/crossBuilds/clientserver/client/src/main/scala/simple/Client.scala
@@ -0,0 +1,36 @@
+package simple
+
+import scalatags.JsDom.all._
+import scala.scalajs.concurrent.JSExecutionContext.Implicits.runNow
+import org.scalajs.dom
+import dom.extensions.Ajax
+import scala.scalajs.js.annotation.JSExport
+
+@JSExport
+object Client extends{
+ @JSExport
+ def main(container: dom.HTMLDivElement) = {
+ val inputBox = input.render
+ val outputBox = ul.render
+ def update() = Ajax.post("/ajax/list", inputBox.value).foreach{ xhr =>
+ val data = upickle.read[Seq[FileData]](xhr.responseText)
+ outputBox.innerHTML = ""
+ for(FileData(name, size) <- data){
+ outputBox.appendChild(
+ li(
+ b(name), " - ", size, " bytes"
+ ).render
+ )
+ }
+ }
+ inputBox.onkeyup = (e: dom.Event) => update()
+ update()
+ container.appendChild(
+ div(
+ h1("File Search"),
+ inputBox,
+ outputBox
+ ).render
+ )
+ }
+} \ No newline at end of file
diff --git a/examples/crossBuilds/clientserver/project/build.sbt b/examples/crossBuilds/clientserver/project/build.sbt
new file mode 100644
index 0000000..7c60a91
--- /dev/null
+++ b/examples/crossBuilds/clientserver/project/build.sbt
@@ -0,0 +1,5 @@
+/*project/build.sbt*/
+addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.5")
+
+addSbtPlugin("com.lihaoyi" % "utest-js-plugin" % "0.2.4")
+
diff --git a/examples/crossBuilds/clientserver/server/shared b/examples/crossBuilds/clientserver/server/shared
new file mode 120000
index 0000000..f32be42
--- /dev/null
+++ b/examples/crossBuilds/clientserver/server/shared
@@ -0,0 +1 @@
+../client/shared \ No newline at end of file
diff --git a/examples/crossBuilds/clientserver/server/src/main/scala/simple/Page.scala b/examples/crossBuilds/clientserver/server/src/main/scala/simple/Page.scala
new file mode 100644
index 0000000..ce6617c
--- /dev/null
+++ b/examples/crossBuilds/clientserver/server/src/main/scala/simple/Page.scala
@@ -0,0 +1,21 @@
+package simple
+import scalatags.Text.all._
+
+object Page{
+ val boot =
+ "Client().main(document.getElementById('contents'))"
+ val skeleton =
+ html(
+ head(
+ script(src:="/client-fastopt.js"),
+ link(
+ rel:="stylesheet",
+ href:="http://yui.yahooapis.com/pure/0.5.0/pure-min.css"
+ )
+ ),
+ body(
+ onload:=boot,
+ div(id:="contents")
+ )
+ )
+}
diff --git a/examples/crossBuilds/clientserver/server/src/main/scala/simple/Server.scala b/examples/crossBuilds/clientserver/server/src/main/scala/simple/Server.scala
new file mode 100644
index 0000000..4d1ece2
--- /dev/null
+++ b/examples/crossBuilds/clientserver/server/src/main/scala/simple/Server.scala
@@ -0,0 +1,43 @@
+package simple
+
+import akka.actor.ActorSystem
+import spray.http.{HttpEntity, MediaTypes}
+import spray.routing.SimpleRoutingApp
+
+object Server extends SimpleRoutingApp{
+ def main(args: Array[String]): Unit = {
+ implicit val system = ActorSystem()
+ startServer("localhost", port = 8080){
+ get{
+ pathSingleSlash{
+ complete{
+ HttpEntity(
+ MediaTypes.`text/html`,
+ Page.skeleton.render
+ )
+ }
+ } ~
+ getFromResourceDirectory("")
+ } ~
+ post{
+ path("ajax" / "list"){
+ extract(_.request.entity.asString) { e =>
+ complete {
+ upickle.write(list(e))
+ }
+ }
+ }
+ }
+ }
+ }
+ def list(path: String) = {
+ val (dir, last) = path.splitAt(path.lastIndexOf("/") + 1)
+ val files =
+ Option(new java.io.File("./" + dir).listFiles())
+ .toSeq.flatten
+ for{
+ f <- files
+ if f.getName.startsWith(last)
+ } yield FileData(f.getName, f.length())
+ }
+} \ No newline at end of file
diff --git a/examples/crossBuilds/clientserver2/build.sbt b/examples/crossBuilds/clientserver2/build.sbt
new file mode 100644
index 0000000..c64a6fd
--- /dev/null
+++ b/examples/crossBuilds/clientserver2/build.sbt
@@ -0,0 +1,37 @@
+import utest.jsrunner.JsCrossBuild
+import scala.scalajs.sbtplugin.ScalaJSPlugin._
+import ScalaJSKeys._
+val sharedSettings = Seq(
+ unmanagedSourceDirectories in Compile +=
+ baseDirectory.value / "shared" / "main" / "scala",
+ libraryDependencies ++= Seq(
+ "com.scalatags" %%% "scalatags" % "0.4.2",
+ "com.lihaoyi" %%% "upickle" % "0.2.5",
+ "com.lihaoyi" %%% "autowire" % "0.2.3"
+ ),
+ scalaVersion := "2.11.4"
+)
+
+lazy val client = project.in(file("client"))
+ .settings(scalaJSSettings:_*)
+ .settings(sharedSettings:_*)
+ .settings(
+ libraryDependencies ++= Seq(
+ "org.scala-lang.modules.scalajs" %%% "scalajs-dom" % "0.6"
+ )
+)
+
+lazy val server = project.in(file("server"))
+ .settings(sharedSettings:_*)
+ .settings(
+ libraryDependencies ++= Seq(
+ "io.spray" %% "spray-can" % "1.3.2",
+ "io.spray" %% "spray-routing" % "1.3.2",
+ "com.typesafe.akka" %% "akka-actor" % "2.3.6"
+ ),
+ (resources in Compile) += {
+ (fastOptJS in (client, Compile)).value
+ (artifactPath in (client, Compile, fastOptJS)).value
+ }
+)
+
diff --git a/examples/crossBuilds/clientserver2/client/shared/main/scala/simple/Shared.scala b/examples/crossBuilds/clientserver2/client/shared/main/scala/simple/Shared.scala
new file mode 100644
index 0000000..c7b17b7
--- /dev/null
+++ b/examples/crossBuilds/clientserver2/client/shared/main/scala/simple/Shared.scala
@@ -0,0 +1,7 @@
+package simple
+
+case class FileData(name: String, size: Long)
+
+trait Api{
+ def list(path: String): Seq[FileData]
+} \ No newline at end of file
diff --git a/examples/crossBuilds/clientserver2/client/src/main/scala/simple/Client.scala b/examples/crossBuilds/clientserver2/client/src/main/scala/simple/Client.scala
new file mode 100644
index 0000000..026e52d
--- /dev/null
+++ b/examples/crossBuilds/clientserver2/client/src/main/scala/simple/Client.scala
@@ -0,0 +1,46 @@
+package simple
+import scalatags.JsDom.all._
+import org.scalajs.dom
+import scala.scalajs.js.annotation.JSExport
+import scalajs.concurrent.JSExecutionContext.Implicits.runNow
+import autowire._
+
+object Ajaxer extends autowire.Client[String, upickle.Reader, upickle.Writer]{
+ override def doCall(req: Request) = {
+ dom.extensions.Ajax.post(
+ url = "/ajax/" + req.path.mkString("/"),
+ data = upickle.write(req.args)
+ ).map(_.responseText)
+ }
+
+ def read[Result: upickle.Reader](p: String) = upickle.read[Result](p)
+ def write[Result: upickle.Writer](r: Result) = upickle.write(r)
+}
+
+@JSExport
+object Client extends{
+ @JSExport
+ def main(container: dom.HTMLDivElement) = {
+ val inputBox = input.render
+ val outputBox = ul.render
+ def update() = Ajaxer[Api].list(inputBox.value).call().foreach{ data =>
+ outputBox.innerHTML = ""
+ for(FileData(name, size) <- data){
+ outputBox.appendChild(
+ li(
+ b(name), " - ", size, " bytes"
+ ).render
+ )
+ }
+ }
+ inputBox.onkeyup = (e: dom.Event) => update()
+ update()
+ container.appendChild(
+ div(
+ h1("File Search"),
+ inputBox,
+ outputBox
+ ).render
+ )
+ }
+} \ No newline at end of file
diff --git a/examples/crossBuilds/clientserver2/project/build.sbt b/examples/crossBuilds/clientserver2/project/build.sbt
new file mode 100644
index 0000000..7c60a91
--- /dev/null
+++ b/examples/crossBuilds/clientserver2/project/build.sbt
@@ -0,0 +1,5 @@
+/*project/build.sbt*/
+addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.5")
+
+addSbtPlugin("com.lihaoyi" % "utest-js-plugin" % "0.2.4")
+
diff --git a/examples/crossBuilds/clientserver2/server/shared b/examples/crossBuilds/clientserver2/server/shared
new file mode 120000
index 0000000..f32be42
--- /dev/null
+++ b/examples/crossBuilds/clientserver2/server/shared
@@ -0,0 +1 @@
+../client/shared \ No newline at end of file
diff --git a/examples/crossBuilds/clientserver2/server/src/main/scala/simple/Page.scala b/examples/crossBuilds/clientserver2/server/src/main/scala/simple/Page.scala
new file mode 100644
index 0000000..ce6617c
--- /dev/null
+++ b/examples/crossBuilds/clientserver2/server/src/main/scala/simple/Page.scala
@@ -0,0 +1,21 @@
+package simple
+import scalatags.Text.all._
+
+object Page{
+ val boot =
+ "Client().main(document.getElementById('contents'))"
+ val skeleton =
+ html(
+ head(
+ script(src:="/client-fastopt.js"),
+ link(
+ rel:="stylesheet",
+ href:="http://yui.yahooapis.com/pure/0.5.0/pure-min.css"
+ )
+ ),
+ body(
+ onload:=boot,
+ div(id:="contents")
+ )
+ )
+}
diff --git a/examples/crossBuilds/clientserver2/server/src/main/scala/simple/Server.scala b/examples/crossBuilds/clientserver2/server/src/main/scala/simple/Server.scala
new file mode 100644
index 0000000..df5f877
--- /dev/null
+++ b/examples/crossBuilds/clientserver2/server/src/main/scala/simple/Server.scala
@@ -0,0 +1,51 @@
+package simple
+
+import akka.actor.ActorSystem
+import spray.http.{HttpEntity, MediaTypes}
+import spray.routing.SimpleRoutingApp
+import scala.concurrent.ExecutionContext.Implicits.global
+
+object Router extends autowire.Server[String, upickle.Reader, upickle.Writer]{
+ def read[Result: upickle.Reader](p: String) = upickle.read[Result](p)
+ def write[Result: upickle.Writer](r: Result) = upickle.write(r)
+}
+
+object Server extends SimpleRoutingApp with Api{
+ def main(args: Array[String]): Unit = {
+ implicit val system = ActorSystem()
+ startServer("localhost", port = 8080){
+ get{
+ pathSingleSlash{
+ complete{
+ HttpEntity(
+ MediaTypes.`text/html`,
+ Page.skeleton.render
+ )
+ }
+ } ~
+ getFromResourceDirectory("")
+ } ~
+ post{
+ path("ajax" / Segments){ s =>
+ extract(_.request.entity.asString) { e =>
+ complete {
+ Router.route[Api](Server)(
+ autowire.Core.Request(s, upickle.read[Map[String, String]](e))
+ )
+ }
+ }
+ }
+ }
+ }
+ }
+ def list(path: String) = {
+ val (dir, last) = path.splitAt(path.lastIndexOf("/") + 1)
+ val files =
+ Option(new java.io.File("./" + dir).listFiles())
+ .toSeq.flatten
+ for{
+ f <- files
+ if f.getName.startsWith(last)
+ } yield FileData(f.getName, f.length())
+ }
+} \ No newline at end of file
diff --git a/examples/crossBuilds/simple/build.sbt b/examples/crossBuilds/simple/build.sbt
new file mode 100644
index 0000000..f1cda7e
--- /dev/null
+++ b/examples/crossBuilds/simple/build.sbt
@@ -0,0 +1,9 @@
+val sharedSettings = Seq(
+ unmanagedSourceDirectories in Compile +=
+ baseDirectory.value / "shared" / "main" / "scala"
+)
+
+lazy val js = project.in(file("js")).settings(scalaJSSettings:_*)
+ .settings(sharedSettings:_*)
+
+lazy val jvm = project.in(file("jvm")).settings(sharedSettings:_*) \ No newline at end of file
diff --git a/examples/crossBuilds/simple/js/shared/main/scala/simple/Simple.scala b/examples/crossBuilds/simple/js/shared/main/scala/simple/Simple.scala
new file mode 100644
index 0000000..4ed0285
--- /dev/null
+++ b/examples/crossBuilds/simple/js/shared/main/scala/simple/Simple.scala
@@ -0,0 +1,7 @@
+/*shared/main/scala/simple/Simple.scala*/
+package simple
+object Simple{
+ def formatTimes(timestamps: Seq[Long]): Seq[String] = {
+ timestamps.map(Platform.format).map(_.dropRight(5))
+ }
+} \ No newline at end of file
diff --git a/examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala b/examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala
new file mode 100644
index 0000000..35ebe1d
--- /dev/null
+++ b/examples/crossBuilds/simple/js/src/main/scala/simple/Platform.scala
@@ -0,0 +1,17 @@
+//js/src/main/scala/simple/Platform.scala
+package simple
+import scala.scalajs.js
+
+object Platform extends js.JSApp{
+ def format(ts: Long) = {
+ new js.Date(ts).toISOString()
+ }
+ def main() = {
+ val times = Seq(
+ 0L,
+ 1L << 32
+ )
+ println("Running on JS! " + 1.0d)
+ println(Simple.formatTimes(times))
+ }
+} \ No newline at end of file
diff --git a/examples/crossBuilds/simple/jvm/shared b/examples/crossBuilds/simple/jvm/shared
new file mode 120000
index 0000000..a12df7d
--- /dev/null
+++ b/examples/crossBuilds/simple/jvm/shared
@@ -0,0 +1 @@
+../js/shared \ No newline at end of file
diff --git a/examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala b/examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala
new file mode 100644
index 0000000..c5e8216
--- /dev/null
+++ b/examples/crossBuilds/simple/jvm/src/main/scala/simple/Platform.scala
@@ -0,0 +1,22 @@
+//jvm/src/main/scala/simple/Platform.scala
+package simple
+import java.text.SimpleDateFormat
+import java.util.{TimeZone, Locale}
+
+object Platform{
+ def format(ts: Long) = {
+ val fmt = new SimpleDateFormat(
+ "yyyy-MM-dd'T'HH:mm:ss.sss'Z'"
+ )
+ fmt.setTimeZone(TimeZone.getTimeZone("UTC"))
+ fmt.format(new java.util.Date(ts))
+ }
+ def main(args: Array[String]) = {
+ val times = Seq(
+ 0L,
+ 1L << 32
+ )
+ println("Running on JVM! " + 1.0d)
+ println(Simple.formatTimes(times))
+ }
+} \ No newline at end of file
diff --git a/examples/crossBuilds/simple/project/build.sbt b/examples/crossBuilds/simple/project/build.sbt
new file mode 100644
index 0000000..a1dbd1d
--- /dev/null
+++ b/examples/crossBuilds/simple/project/build.sbt
@@ -0,0 +1,2 @@
+/*project/build.sbt*/
+addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.5") \ No newline at end of file
diff --git a/examples/crossBuilds/simple2/build.sbt b/examples/crossBuilds/simple2/build.sbt
new file mode 100644
index 0000000..a20cf1d
--- /dev/null
+++ b/examples/crossBuilds/simple2/build.sbt
@@ -0,0 +1,13 @@
+import utest.jsrunner.JsCrossBuild
+
+val cross = new JsCrossBuild(
+ // Shared settings here
+)
+
+lazy val js = cross.js.settings(
+ // JS-specific settings here
+)
+
+lazy val jvm = cross.jvm.settings(
+ // JVM-specific settings here
+)
diff --git a/examples/crossBuilds/simple2/js/shared/main/scala/simple/Simple.scala b/examples/crossBuilds/simple2/js/shared/main/scala/simple/Simple.scala
new file mode 100644
index 0000000..4ed0285
--- /dev/null
+++ b/examples/crossBuilds/simple2/js/shared/main/scala/simple/Simple.scala
@@ -0,0 +1,7 @@
+/*shared/main/scala/simple/Simple.scala*/
+package simple
+object Simple{
+ def formatTimes(timestamps: Seq[Long]): Seq[String] = {
+ timestamps.map(Platform.format).map(_.dropRight(5))
+ }
+} \ No newline at end of file
diff --git a/examples/crossBuilds/simple2/js/shared/test/scala/simple/SimpleTest.scala b/examples/crossBuilds/simple2/js/shared/test/scala/simple/SimpleTest.scala
new file mode 100644
index 0000000..b348c6f
--- /dev/null
+++ b/examples/crossBuilds/simple2/js/shared/test/scala/simple/SimpleTest.scala
@@ -0,0 +1,20 @@
+/*js/shared/test/scala/simple/SimpleTest.scala*/
+/*jvm/shared/test/scala/simple/SimpleTest.scala*/
+package simple
+import utest._
+object SimpleTest extends TestSuite{
+ val tests = TestSuite{
+ 'format{
+ 'nil - assert(Simple.formatTimes(Nil) == Nil)
+ 'timeZero - {
+ val timestamps = Seq(0L, 1L << 32)
+ val expected = Seq(
+ "1970-01-01T00:00:00",
+ "1970-02-19T17:02:47"
+ )
+ val formatted = Simple.formatTimes(timestamps)
+ assert(formatted == expected)
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/examples/crossBuilds/simple2/js/src/main/scala/simple/Platform.scala b/examples/crossBuilds/simple2/js/src/main/scala/simple/Platform.scala
new file mode 100644
index 0000000..42cc7dc
--- /dev/null
+++ b/examples/crossBuilds/simple2/js/src/main/scala/simple/Platform.scala
@@ -0,0 +1,9 @@
+//js/src/main/scala/simple/Platform.scala
+package simple
+import scala.scalajs.js
+
+object Platform{
+ def format(ts: Long) = {
+ new js.Date(ts).toISOString()
+ }
+} \ No newline at end of file
diff --git a/examples/crossBuilds/simple2/jvm/shared b/examples/crossBuilds/simple2/jvm/shared
new file mode 120000
index 0000000..a12df7d
--- /dev/null
+++ b/examples/crossBuilds/simple2/jvm/shared
@@ -0,0 +1 @@
+../js/shared \ No newline at end of file
diff --git a/examples/crossBuilds/simple2/jvm/src/main/scala/simple/Platform.scala b/examples/crossBuilds/simple2/jvm/src/main/scala/simple/Platform.scala
new file mode 100644
index 0000000..4713005
--- /dev/null
+++ b/examples/crossBuilds/simple2/jvm/src/main/scala/simple/Platform.scala
@@ -0,0 +1,14 @@
+//jvm/src/main/scala/simple/Platform.scala
+package simple
+import java.text.SimpleDateFormat
+import java.util.TimeZone
+
+object Platform{
+ def format(ts: Long) = {
+ val fmt = new SimpleDateFormat(
+ "yyyy-MM-dd'T'HH:mm:ss.sss'Z'"
+ )
+ fmt.setTimeZone(TimeZone.getTimeZone("UTC"))
+ fmt.format(new java.util.Date(ts))
+ }
+} \ No newline at end of file
diff --git a/examples/crossBuilds/simple2/project/build.sbt b/examples/crossBuilds/simple2/project/build.sbt
new file mode 100644
index 0000000..5bd83ce
--- /dev/null
+++ b/examples/crossBuilds/simple2/project/build.sbt
@@ -0,0 +1,4 @@
+/*project/build.sbt*/
+addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.5")
+
+addSbtPlugin("com.lihaoyi" % "utest-js-plugin" % "0.2.4") \ No newline at end of file
diff --git a/examples/demos/build.sbt b/examples/demos/build.sbt
new file mode 100644
index 0000000..5b55829
--- /dev/null
+++ b/examples/demos/build.sbt
@@ -0,0 +1,21 @@
+import scala.scalajs.sbtplugin.ScalaJSPlugin.ScalaJSKeys.jsDependencies
+
+scalaJSSettings
+
+name := "Example"
+
+version := "0.1-SNAPSHOT"
+
+scalaVersion := "2.11.4"
+
+libraryDependencies += "com.lihaoyi" %% "acyclic" % "0.1.2" % "provided"
+
+libraryDependencies += "com.lihaoyi" %%% "upickle" % "0.2.5"
+
+libraryDependencies += "org.scala-lang.modules.scalajs" %%% "scalajs-dom" % "0.6"
+
+libraryDependencies += "com.scalatags" %%% "scalatags" % "0.4.2"
+
+libraryDependencies += "com.scalarx" %%% "scalarx" % "0.2.6"
+
+libraryDependencies += "org.scala-lang.modules" %% "scala-async" % "0.9.2" \ No newline at end of file
diff --git a/examples/demos/src/main/resources/webpage/weather.js b/examples/demos/src/main/resources/webpage/weather.js
new file mode 100644
index 0000000..8e95305
--- /dev/null
+++ b/examples/demos/src/main/resources/webpage/weather.js
@@ -0,0 +1,17 @@
+function WeatherJs(target) {
+ var xhr = new XMLHttpRequest()
+
+ xhr.open("GET",
+ "http://api.openweathermap.org/data/" +
+ "2.5/weather?q=Singapore"
+ );
+
+ xhr.onload = function (e) {
+ if (xhr.status == 200) {
+ var pre = document.createElement("pre");
+ pre.textContent = xhr.responseText;
+ target.appendChild(pre);
+ }
+ };
+ xhr.send();
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/Splash.scala b/examples/demos/src/main/scala/Splash.scala
new file mode 100644
index 0000000..c68bdca
--- /dev/null
+++ b/examples/demos/src/main/scala/Splash.scala
@@ -0,0 +1,43 @@
+import java.lang.Math._
+
+import org.scalajs.dom
+
+import scala.scalajs.js.annotation.JSExport
+
+@JSExport
+object Splash extends{
+ @JSExport
+ def main(canvas: dom.HTMLCanvasElement) = {
+
+ def clear() = {
+ canvas.width = canvas.parentElement.clientWidth
+ canvas.height = canvas.parentElement.clientHeight
+ }
+ clear()
+
+ val renderer =
+ canvas.getContext("2d")
+ .asInstanceOf[dom.CanvasRenderingContext2D]
+
+ def h = canvas.height
+ def w = canvas.width
+
+ var x = 0.0
+ type Graph = (String, Double => Double)
+ val graphs = Seq[Graph](
+ ("red", sin),
+ ("green", x => 1 - abs(x % 4 - 2)),
+ ("blue", x => pow(sin(x/12), 2) * sin(x))
+ ).zipWithIndex
+ dom.setInterval(() => {
+ x = (x + 1) % w; if (x == 0) clear()
+ for (((color, f), i) <- graphs) {
+ val offset = h / 3 * (i + 0.5)
+ val y = f(x / w * 75) * h / 30
+ renderer.fillStyle = color
+ renderer.fillRect(x, y + offset, 3, 3)
+ }
+ }, 20)
+
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/advanced/Async.scala b/examples/demos/src/main/scala/advanced/Async.scala
new file mode 100644
index 0000000..481e80e
--- /dev/null
+++ b/examples/demos/src/main/scala/advanced/Async.scala
@@ -0,0 +1,120 @@
+package advanced
+
+import org.scalajs.dom
+import concurrent._
+import async.Async._
+import scala.scalajs.js.annotation.JSExport
+import scalajs.concurrent.JSExecutionContext.Implicits.queue
+
+@JSExport
+object Async {
+ def init(canvas: dom.HTMLCanvasElement) = {
+ val renderer = canvas.getContext("2d")
+ .asInstanceOf[dom.CanvasRenderingContext2D]
+
+ canvas.style.backgroundColor = "#f8f8f8"
+ canvas.height = canvas.parentElement.clientHeight
+ canvas.width = canvas.parentElement.clientWidth
+
+ renderer.lineWidth = 5
+ renderer.strokeStyle = "red"
+ renderer.fillStyle = "cyan"
+ renderer
+ }
+ @JSExport
+ def main(canvas: dom.HTMLCanvasElement) = {
+ val renderer = init(canvas)
+ // async
+ def rect = canvas.getBoundingClientRect()
+
+ type ME = dom.MouseEvent
+ val mousemove =
+ Channel[ME](canvas.onmousemove = _)
+ val mouseup =
+ Channel[ME](canvas.onmouseup = _)
+ val mousedown =
+ Channel[ME](canvas.onmousedown = _)
+
+ async{
+ while(true){
+ val start = await(mousedown())
+ renderer.beginPath()
+ renderer.moveTo(
+ start.clientX - rect.left,
+ start.clientY - rect.top
+ )
+
+ var res = await(mousemove | mouseup)
+ while(res.`type` == "mousemove"){
+ renderer.lineTo(
+ res.clientX - rect.left,
+ res.clientY - rect.top
+ )
+ renderer.stroke()
+ res = await(mousemove | mouseup)
+ }
+
+ renderer.fill()
+ await(mouseup())
+ renderer.clearRect(0, 0, 1000, 1000)
+ }
+ }
+ }
+ @JSExport
+ def main0(canvas: dom.HTMLCanvasElement) = {
+ val renderer = init(canvas)
+ // traditional
+ def rect = canvas.getBoundingClientRect()
+
+ var dragState = 0
+
+ canvas.onmousemove ={(e: dom.MouseEvent) =>
+ if (dragState == 1) {
+ renderer.lineTo(
+ e.clientX - rect.left,
+ e.clientY - rect.top
+ )
+ renderer.stroke()
+ }
+ }
+ canvas.onmouseup = {(e: dom.MouseEvent) =>
+ if(dragState == 1) {
+ renderer.fill()
+ dragState = 2
+ }else if (dragState == 2){
+ renderer.clearRect(0, 0, 1000, 1000)
+ dragState = 0
+ }
+ }
+ canvas.onmousedown ={(e: dom.MouseEvent) =>
+ if (dragState == 0) {
+ dragState = 1
+ renderer.beginPath()
+ renderer.moveTo(
+ e.clientX - rect.left,
+ e.clientY - rect.top
+ )
+ }
+ }
+ }
+}
+
+case class Channel[T](init: (T => Unit) => Unit){
+ init(update)
+ private[this] var value: Promise[T] = null
+ def apply(): Future[T] = {
+ value = Promise[T]()
+ value.future
+ }
+ def update(t: T): Unit = {
+ if (value != null && !value.isCompleted) value.success(t)
+ }
+ def |(other: Channel[T]): Future[T] = {
+ val p = Promise[T]()
+ for{
+ f <- Seq(other(), this())
+ t <- f
+ } p.trySuccess(t)
+ p.future
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/advanced/BasicRx.scala b/examples/demos/src/main/scala/advanced/BasicRx.scala
new file mode 100644
index 0000000..56b41b0
--- /dev/null
+++ b/examples/demos/src/main/scala/advanced/BasicRx.scala
@@ -0,0 +1,80 @@
+package advanced
+
+import org.scalajs.dom
+import scala.scalajs.js
+import scala.scalajs.js.annotation.JSExport
+import rx._
+import scalatags.JsDom.all._
+
+@JSExport
+object BasicRx {
+ @JSExport
+ def main(container: dom.HTMLDivElement) = {
+ val txt = Var("")
+ val numChars = Rx{txt().length}
+ val numWords = Rx{
+ txt().split(' ')
+ .filter(_.length > 0)
+ .length
+ }
+
+ val avgWordLength = Rx{
+ txt().count(_ != ' ') * 1.0 / numWords()
+ }
+
+ val txtInput = textarea.render
+ txtInput.onkeyup = (e: dom.Event) => {
+ txt() = txtInput.value
+ }
+
+ container.appendChild(
+ div(
+ txtInput,
+ ul(
+ li("Chars: ", numChars),
+ li("Words: ", numWords),
+ li("Word Length: ", avgWordLength)
+ )
+ ).render
+ )
+ }
+ @JSExport
+ def main2(container: dom.HTMLDivElement) = {
+ val fruits = Seq(
+ "Apple", "Apricot", "Banana", "Cherry",
+ "Mango", "Mangosteen", "Mandarin",
+ "Grape", "Grapefruit", "Guava"
+ )
+ val query = Var("")
+ val txtInput = input.render
+ txtInput.onkeyup = (e: dom.Event) => {
+ query() = txtInput.value
+ }
+
+ val fragments =
+ for(fruit <- fruits) yield Rx {
+ val shown = fruit.toLowerCase
+ .startsWith(query())
+ if (shown) li(fruit)
+ else li(display := "none")
+ }
+
+ container.appendChild(
+ div(
+ txtInput,
+ ul(fragments)
+ ).render
+ )
+ }
+ implicit def rxFrag[T <% Frag](r: Rx[T]): Frag = {
+ def rSafe: dom.Node = span(r()).render
+ var last = rSafe
+ Obs(r, skipInitial = true){
+ val newLast = rSafe
+ js.Dynamic.global.last = last
+ last.parentNode.replaceChild(newLast, last)
+ last = newLast
+ }
+ last
+ }
+}
diff --git a/examples/demos/src/main/scala/advanced/Futures.scala b/examples/demos/src/main/scala/advanced/Futures.scala
new file mode 100644
index 0000000..0d7107d
--- /dev/null
+++ b/examples/demos/src/main/scala/advanced/Futures.scala
@@ -0,0 +1,107 @@
+package advanced
+
+import org.scalajs.dom
+import org.scalajs.dom.XMLHttpRequest
+import org.scalajs.dom.extensions.{Ajax, KeyCode}
+import scala.collection.mutable
+import scala.concurrent.Future
+import scala.scalajs.js
+import scalatags.JsDom.all._
+import scala.scalajs.js.annotation.JSExport
+import scala.scalajs.concurrent.JSExecutionContext.Implicits.runNow
+@JSExport
+object Futures {
+ def main(container: dom.HTMLDivElement,
+ handle: (Seq[String], dom.HTMLDivElement) => Unit) = {
+ val myInput = input(value:="London,Singapore,Berlin,New York").render
+ val output = div.render
+ myInput.onkeyup = (e: dom.KeyboardEvent) => {
+ if (e.keyCode == KeyCode.enter){
+ handle(myInput.value.split(','), output)
+ }
+ }
+ container.appendChild(
+ div(
+ i("Press Enter in the box to fetch temperatures "),
+ myInput,
+ output
+ ).render
+ )
+ }
+ def urlFor(name: String) = {
+ "http://api.openweathermap.org/data/" +
+ "2.5/find?mode=json&q=" +
+ name
+ }
+ def parseTemp(text: String) = {
+ val data = js.JSON.parse(text)
+ val kelvins = data.list
+ .pop()
+ .main
+ .temp
+ .asInstanceOf[Double]
+ kelvins - 272.15
+ }
+ def formatResults(output: dom.HTMLElement, results: Seq[(String, Double)]) = {
+ output.innerHTML = ""
+ output.appendChild(ul(
+ for((name, temp) <- results) yield li(
+ b(name), " - ", temp.toInt, "C"
+ )
+ ).render)
+ }
+ @JSExport
+ def main0(container: dom.HTMLDivElement) = {
+ def handle0(names: Seq[String], output: dom.HTMLDivElement) = {
+ val results = mutable.Buffer.empty[(String, Double)]
+ for(name <- names){
+ val xhr = new XMLHttpRequest
+ xhr.open("GET", urlFor(name))
+ xhr.onload = (e: dom.Event) => {
+ val temp = parseTemp(xhr.responseText)
+ results.append((name, temp))
+ if (results.length == names.length){
+ formatResults(output, results)
+ }
+ }
+ xhr.send()
+ }
+ }
+ main(container, handle0)
+ }
+ @JSExport
+ def main1(container: dom.HTMLDivElement) = {
+ def handle1(names: Seq[String], output: dom.HTMLDivElement) = {
+ val results = mutable.Buffer.empty[(String, Double)]
+ for{
+ name <- names
+ xhr <- Ajax.get(urlFor(name))
+ } {
+ val temp = parseTemp(xhr.responseText)
+ results.append((name, temp))
+ if (results.length == names.length){
+ formatResults(output, results)
+ }
+ }
+ }
+ main(container, handle1)
+ }
+ @JSExport
+ def main2(container: dom.HTMLDivElement) = {
+ def handle2(names: Seq[String], output: dom.HTMLDivElement) = {
+ val futures = for(name <- names) yield{
+ Ajax.get(urlFor(name)).map( xhr =>
+ (name, parseTemp(xhr.responseText))
+ )
+ }
+
+ for(results <- Future.sequence(futures)){
+ formatResults(output, results)
+ }
+ }
+
+ main(container, handle2)
+ }
+
+
+}
diff --git a/examples/demos/src/main/scala/canvasapp/Clock.scala b/examples/demos/src/main/scala/canvasapp/Clock.scala
new file mode 100644
index 0000000..af9d8aa
--- /dev/null
+++ b/examples/demos/src/main/scala/canvasapp/Clock.scala
@@ -0,0 +1,51 @@
+package canvasapp
+
+
+import org.scalajs.dom
+
+import scala.scalajs.js
+import scala.scalajs.js.annotation.JSExport
+@JSExport
+object Clock extends{
+ @JSExport
+ def main(canvas: dom.HTMLCanvasElement) = {
+ /*setup*/
+ val renderer = canvas.getContext("2d")
+ .asInstanceOf[dom.CanvasRenderingContext2D]
+
+ canvas.width = canvas.parentElement.clientWidth
+ canvas.height = canvas.parentElement.clientHeight
+
+ val gradient = renderer.createLinearGradient(
+ canvas.width / 2 - 100, 0, canvas.width/ 2 + 100, 0
+ )
+ gradient.addColorStop(0,"red")
+ gradient.addColorStop(0.5,"green")
+ gradient.addColorStop(1,"blue")
+ renderer.fillStyle = gradient
+ //renderer.fillStyle = "black"
+
+ renderer.textAlign = "center"
+ renderer.textBaseline = "middle"
+
+ /*code*/
+ def render() = {
+ val date = new js.Date()
+ renderer.clearRect(
+ 0, 0, canvas.width, canvas.height
+ )
+
+ renderer.font = "75px sans-serif"
+ renderer.fillText(
+ Seq(
+ date.getHours(),
+ date.getMinutes(),
+ date.getSeconds()
+ ).mkString(":"),
+ canvas.width / 2,
+ canvas.height / 2
+ )
+ }
+ dom.setInterval(render _, 1000)
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/canvasapp/FlappyLine.scala b/examples/demos/src/main/scala/canvasapp/FlappyLine.scala
new file mode 100644
index 0000000..fdf6e60
--- /dev/null
+++ b/examples/demos/src/main/scala/canvasapp/FlappyLine.scala
@@ -0,0 +1,109 @@
+package canvasapp
+
+
+import org.scalajs.dom
+
+import scala.scalajs.js.annotation.JSExport
+import scala.util.Random
+
+@JSExport
+object FlappyLine extends{
+ @JSExport
+ def main(canvas: dom.HTMLCanvasElement) = {
+ /*setup*/
+ val renderer = canvas.getContext("2d")
+ .asInstanceOf[dom.CanvasRenderingContext2D]
+
+ canvas.width = canvas.parentElement.clientWidth
+ canvas.height = 400
+
+ renderer.font = "50px sans-serif"
+ renderer.textAlign = "center"
+ renderer.textBaseline = "middle"
+
+ /*variables*/
+ val obstacleGap = 200 // Gap between the approaching obstacles
+ val holeSize = 50 // Size of the hole in each obstacle you must go through
+ val gravity = 0.1 // Y acceleration of the player
+
+ var playerY = canvas.height / 2.0 // Y position of the player; X is fixed
+ var playerV = 0.0 // Y velocity of the player
+ // Whether the player is dead or not;
+ // 0 means alive, >0 is number of frames before respawning
+ var dead = 0
+ // What frame this is; used to keep track
+ // of where the obstacles should be positioned
+ var frame = -50
+ // List of each obstacle, storing only the Y position of the hole.
+ // The X position of the obstacle is calculated by its position in the
+ // queue and in the current frame.
+ val obstacles = collection.mutable.Queue.empty[Int]
+
+
+ def runLive() = {
+ frame += 2
+
+ // Create new obstacles, or kill old ones as necessary
+ if (frame >= 0 && frame % obstacleGap == 0)
+ obstacles.enqueue(Random.nextInt(canvas.height - 2 * holeSize) + holeSize)
+ if (obstacles.length > 7){
+ obstacles.dequeue()
+ frame -= obstacleGap
+ }
+
+ // Apply physics
+ playerY = playerY + playerV
+ playerV = playerV + gravity
+
+
+ // Render obstacles, and check for collision
+ renderer.fillStyle = "darkblue"
+ for((holeY, i) <- obstacles.zipWithIndex){
+ // Where each obstacle appears depends on what frame it is.
+ // This is what keeps the obstacles moving to the left as time passes.
+ val holeX = i * obstacleGap - frame + canvas.width
+ renderer.fillRect(holeX, 0, 5, holeY - holeSize)
+ renderer.fillRect(
+ holeX, holeY + holeSize, 5, canvas.height - holeY - holeSize
+ )
+
+ // Kill the player if he hits some obstacle
+ if (math.abs(holeX - canvas.width/2) < 5 &&
+ math.abs(holeY - playerY) > holeSize){
+ dead = 50
+ }
+ }
+
+ // Render player
+ renderer.fillStyle = "darkgreen"
+ renderer.fillRect(canvas.width / 2 - 5, playerY - 5, 10, 10)
+
+ // Check for out-of-bounds player
+ if (playerY < 0 || playerY > canvas.height){
+ dead = 50
+ }
+ }
+
+ def runDead() = {
+ playerY = canvas.height / 2
+ playerV = 0
+ frame = -50
+ obstacles.clear()
+ dead -= 1
+ renderer.fillStyle = "darkred"
+ renderer.fillText("Game Over", canvas.width / 2, canvas.height / 2)
+ }
+
+ def run() = {
+ renderer.clearRect(0, 0, canvas.width, canvas.height)
+ if (dead > 0) runDead()
+ else runLive()
+ }
+
+ dom.setInterval(run _, 20)
+
+ canvas.onclick = (e: dom.MouseEvent) => {
+ playerV -= 5
+ }
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/canvasapp/ScratchPad.scala b/examples/demos/src/main/scala/canvasapp/ScratchPad.scala
new file mode 100644
index 0000000..cc3d7e0
--- /dev/null
+++ b/examples/demos/src/main/scala/canvasapp/ScratchPad.scala
@@ -0,0 +1,40 @@
+package canvasapp
+
+
+import org.scalajs.dom
+
+import scala.scalajs.js.annotation.JSExport
+
+@JSExport
+object ScratchPad extends{
+ @JSExport
+ def main(canvas: dom.HTMLCanvasElement) = {
+ /*setup*/
+ val renderer = canvas.getContext("2d")
+ .asInstanceOf[dom.CanvasRenderingContext2D]
+
+ canvas.width = canvas.parentElement.clientWidth
+ canvas.height = canvas.parentElement.clientHeight
+
+ renderer.fillStyle = "#f8f8f8"
+ renderer.fillRect(0, 0, canvas.width, canvas.height)
+
+ /*code*/
+ renderer.fillStyle = "black"
+ var down = false
+ canvas.onmousedown = (e: dom.MouseEvent)=>{
+ down = true
+ }
+ canvas.onmouseup = (e: dom.MouseEvent)=>{
+ down = false
+ }
+ canvas.onmousemove = (e: dom.MouseEvent)=>{
+ val rect = canvas.getBoundingClientRect()
+ if (down) renderer.fillRect(
+ e.clientX - rect.left,
+ e.clientY - rect.top,
+ 10, 10
+ )
+ }
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/scrollmenu/Controller.scala b/examples/demos/src/main/scala/scrollmenu/Controller.scala
new file mode 100644
index 0000000..4480445
--- /dev/null
+++ b/examples/demos/src/main/scala/scrollmenu/Controller.scala
@@ -0,0 +1,80 @@
+package scrollmenu
+
+import org.scalajs.dom
+import org.scalajs.dom.extensions._
+
+import scala.scalajs.js
+import scala.scalajs.js.annotation.JSExport
+import scalatags.JsDom.all._
+
+
+
+@JSExport
+object Controller{
+
+ def munge(name: String) = {
+ name.replace(" ", "")
+ }
+
+ @JSExport
+ def main(data: scala.scalajs.js.Any) = {
+
+ val structure = upickle.readJs[Tree[String]](upickle.json.readJs(data))
+
+ val Seq(main, menu, layout, menuLink) = Seq(
+ "main", "menu", "layout", "menuLink"
+ ).map(dom.document.getElementById)
+
+ val snippets = dom.document.getElementsByClassName("highlight-me")
+
+ snippets.foreach(js.Dynamic.global.hljs.highlightBlock(_))
+ def rest() = {
+ val scrollSpy = new ScrollSpy(structure, main)
+ val list = ul(cls := "menu-item-list collapsed")(
+ scrollSpy.domTrees.map(_.value.frag)
+ ).render
+
+ def updateScroll() = scrollSpy()
+ val expandIcon = i(cls := "fa fa-caret-down").render
+ val expandLink =
+ a(
+ expandIcon,
+ href := "javascript:",
+ marginLeft := "0px",
+ paddingLeft := "15px",
+ paddingRight := "15px",
+ position.absolute,
+ top := "0px",
+ right := "0px",
+ cls := "pure-menu-selected",
+ onclick := { (e: dom.Event) =>
+ expandIcon.classList.toggle("fa-caret-down")
+ expandIcon.classList.toggle("fa-caret-up")
+ list.classList.toggle("collapsed")
+ scrollSpy.clean = !scrollSpy.clean
+ updateScroll()
+ }
+ ).render
+
+
+ menu.appendChild(
+ div(cls := "pure-menu pure-menu-open")(
+ a(cls := "pure-menu-heading")(
+ "Contents", expandLink
+ ),
+ list
+ ).render
+ )
+
+ menuLink.onclick = (e: dom.MouseEvent) => {
+ layout.classList.toggle("active")
+ menu.classList.toggle("active")
+ menuLink.classList.toggle("active")
+ }
+
+ main.onscroll = (e: dom.UIEvent) => updateScroll()
+ updateScroll()
+ }
+ dom.setTimeout(rest _, 10)
+ }
+}
diff --git a/examples/demos/src/main/scala/scrollmenu/ScrollMenu.scala b/examples/demos/src/main/scala/scrollmenu/ScrollMenu.scala
new file mode 100644
index 0000000..9ce9a2b
--- /dev/null
+++ b/examples/demos/src/main/scala/scrollmenu/ScrollMenu.scala
@@ -0,0 +1,117 @@
+package scrollmenu
+
+import org.scalajs.dom
+
+import scala.scalajs.js
+import scalatags.JsDom.all._
+
+case class Tree[T](value: T, children: Vector[Tree[T]])
+
+case class MenuNode(frag: dom.HTMLElement, id: String, start: Int, end: Int)
+
+/**
+ * High performance scrollspy to work keep the left menu bar in sync.
+ * Lots of sketchy imperative code in order to maximize performance.
+ */
+class ScrollSpy(structure: Tree[String],
+ main: dom.HTMLElement,
+ var clean: Boolean = false){
+ val (headers, domTrees) = {
+ var i = 0
+ def recurse(t: Tree[String], depth: Int): Tree[MenuNode] = {
+ val curr =
+ li(
+ a(
+ t.value,
+ href:="#"+Controller.munge(t.value),
+ cls:="menu-item"
+ )
+ )
+ val originalI = i
+ i += 1
+ val children = t.children.map(recurse(_, depth + 1))
+ Tree(
+ MenuNode(
+ curr(ul(paddingLeft := "15px",children.map(_.value.frag))).render,
+ Controller.munge(t.value),
+ originalI,
+ if (children.length > 0) children.map(_.value.end).max else originalI + 1
+ ),
+ children
+ )
+ }
+ def offset(el: dom.HTMLElement, parent: dom.HTMLElement): Double = {
+ if (el == parent) 0
+ else el.offsetTop + offset(el.offsetParent.asInstanceOf[dom.HTMLElement], parent)
+ }
+ val headers = {
+ val menuItems = {
+ def rec(current: Tree[String]): Seq[String] = {
+ current.value +: current.children.flatMap(rec)
+ }
+ rec(structure).tail
+ }
+ menuItems.map(Controller.munge)
+ .map(dom.document.getElementById)
+ .map(offset(_, main))
+ .toVector
+ }
+ val domTrees = structure.children.map(recurse(_, 0))
+ (headers, domTrees)
+ }
+
+
+ private[this] var scrolling = -1
+ def apply() = {
+ dom.clearTimeout(scrolling)
+ scrolling = dom.setTimeout(() => start(), 200)
+ }
+ private[this] def start() = {
+// scrolling = false
+ def scroll(el: dom.Element) = {
+ val rect = el.getBoundingClientRect()
+ if (rect.top <= 0)
+ el.scrollIntoView(true)
+ else if (rect.top > dom.innerHeight)
+ el.scrollIntoView(false)
+ }
+ def walkTree(tree: Tree[MenuNode]): Boolean = {
+ val Tree(MenuNode(menuItem, itemId, start, end), children) = tree
+ val before = headers(start) <= main.scrollTop
+ val after = (end >= headers.length) || headers(end) > main.scrollTop
+
+ val win = before && after
+
+ if (win){
+ menuItem.classList.remove("hide")
+ var winFound = false
+
+ for(c <- tree.children){
+ val newWinFound = walkTree(c)
+ if (!winFound) c.value.frag.classList.add("selected")
+ else c.value.frag.classList.remove("selected")
+ winFound = winFound | newWinFound
+ }
+ if (!winFound) {
+ // This means it's the leaf element, because it won but there
+ // aren't any children which won, so it must be the actual leaf
+ tree.children.foreach(_.value.frag.classList.remove("selected"))
+ if (dom.location.hash != itemId)
+ dom.history.pushState(null, null, "#"+itemId)
+ scroll(menuItem.children(0))
+
+ }
+ menuItem.children(0).classList.add("pure-menu-selected")
+ }else{
+ if(clean) tree.children.map(walkTree)
+ menuItem.children(0).classList.remove("pure-menu-selected")
+ menuItem.classList.add("hide")
+ menuItem.classList.remove("selected")
+ }
+ win
+ }
+ domTrees.map(walkTree)
+ }
+
+
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/webpage/HelloWorld0.scala b/examples/demos/src/main/scala/webpage/HelloWorld0.scala
new file mode 100644
index 0000000..df458ac
--- /dev/null
+++ b/examples/demos/src/main/scala/webpage/HelloWorld0.scala
@@ -0,0 +1,19 @@
+package webpage
+import org.scalajs.dom
+import scala.scalajs.js.annotation.JSExport
+@JSExport
+object HelloWorld0 extends{
+ @JSExport
+ def main(target: dom.HTMLDivElement) = {
+ val (animalA, animalB) = ("fox", "dog")
+ target.innerHTML = s"""
+ <div>
+ <h1>Hello World!</h1>
+ <p>
+ The quick brown <b>$animalA</b>
+ jumped over the lazy <i>$animalB</b>
+ </p>
+ </div>
+ """
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/webpage/HelloWorld1.scala b/examples/demos/src/main/scala/webpage/HelloWorld1.scala
new file mode 100644
index 0000000..1dc77b3
--- /dev/null
+++ b/examples/demos/src/main/scala/webpage/HelloWorld1.scala
@@ -0,0 +1,18 @@
+package webpage
+import org.scalajs.dom
+import scala.scalajs.js.annotation.JSExport
+import scalatags.JsDom.all._
+@JSExport
+object HelloWorld1 extends{
+ @JSExport
+ def main(target: dom.HTMLDivElement) = {
+ val (animalA, animalB) = ("fox", "dog")
+ target.appendChild(
+ div(
+ h1("Hello World!"),
+ p("The quick brown ", b(animalA),
+ " jumped over the lazy ", i(animalB), ".")
+ ).render
+ )
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/webpage/Inputs.scala b/examples/demos/src/main/scala/webpage/Inputs.scala
new file mode 100644
index 0000000..9339e84
--- /dev/null
+++ b/examples/demos/src/main/scala/webpage/Inputs.scala
@@ -0,0 +1,35 @@
+package webpage
+
+import org.scalajs.dom
+import scala.scalajs.js.annotation.JSExport
+import scalatags.JsDom.all._
+
+@JSExport
+object Inputs extends{
+ @JSExport
+ def main(target: dom.HTMLDivElement) = {
+ val box = input(
+ `type`:="text",
+ placeholder:="Type here!"
+ ).render
+
+ val output = span.render
+
+ box.onkeyup = (e: dom.Event) => {
+ output.textContent =
+ box.value.toUpperCase
+ }
+
+ target.appendChild(
+ div(
+ h1("Capital Box!"),
+ p(
+ "Type here and " +
+ "have it capitalized!"
+ ),
+ div(box),
+ div(output)
+ ).render
+ )
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/webpage/Search0.scala b/examples/demos/src/main/scala/webpage/Search0.scala
new file mode 100644
index 0000000..300b506
--- /dev/null
+++ b/examples/demos/src/main/scala/webpage/Search0.scala
@@ -0,0 +1,50 @@
+package webpage
+
+import org.scalajs.dom
+import scala.scalajs.js.annotation.JSExport
+import scalatags.JsDom.all._
+
+@JSExport
+object Search0 extends{
+ @JSExport
+ def main(target: dom.HTMLDivElement) = {
+ val listings = Seq(
+ "Apple", "Apricot", "Banana", "Cherry",
+ "Mango", "Mangosteen", "Mandarin",
+ "Grape", "Grapefruit", "Guava"
+ )
+
+ def renderListings = ul(
+ for {
+ fruit <- listings
+ if fruit.toLowerCase.startsWith(
+ box.value.toLowerCase
+ )
+ } yield li(fruit)
+ ).render
+
+ lazy val box = input(
+ `type`:="text",
+ placeholder:="Type here!"
+ ).render
+
+ val output = div(renderListings).render
+
+ box.onkeyup = (e: dom.Event) => {
+ output.innerHTML = ""
+ output.appendChild(renderListings)
+ }
+
+ target.appendChild(
+ div(
+ h1("Search Box!"),
+ p(
+ "Type here to filter " +
+ "the list of things below!"
+ ),
+ div(box),
+ output
+ ).render
+ )
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/webpage/Search1.scala b/examples/demos/src/main/scala/webpage/Search1.scala
new file mode 100644
index 0000000..1936898
--- /dev/null
+++ b/examples/demos/src/main/scala/webpage/Search1.scala
@@ -0,0 +1,62 @@
+package webpage
+
+import org.scalajs.dom
+import scala.scalajs.js.annotation.JSExport
+import scalatags.JsDom.all._
+
+@JSExport
+object Search1 extends{
+ @JSExport
+ def main(target: dom.HTMLDivElement) = {
+ val listings = Seq(
+ "Apple", "Apricot", "Banana", "Cherry",
+ "Mango", "Mangosteen", "Mandarin",
+ "Grape", "Grapefruit", "Guava"
+ )
+
+ def renderListings = ul(
+ for {
+ fruit <- listings
+ if fruit.toLowerCase.startsWith(
+ box.value.toLowerCase
+ )
+ } yield {
+ val (first, last) = fruit.splitAt(
+ box.value.length
+ )
+ li(
+ span(
+ backgroundColor:="yellow",
+ first
+ ),
+ last
+ )
+ }
+ ).render
+
+
+ lazy val box = input(
+ `type`:="text",
+ placeholder:="Type here!"
+ ).render
+
+ val output = div(renderListings).render
+
+ box.onkeyup = (e: dom.Event) => {
+ output.innerHTML = ""
+ output.appendChild(renderListings)
+ }
+
+ target.appendChild(
+ div(
+ h1("Search Box!"),
+ p(
+ "Type here to filter " +
+ "the list of things below!"
+ ),
+ div(box),
+ output
+ ).render
+ )
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/webpage/Weather0.scala b/examples/demos/src/main/scala/webpage/Weather0.scala
new file mode 100644
index 0000000..4a2c6f0
--- /dev/null
+++ b/examples/demos/src/main/scala/webpage/Weather0.scala
@@ -0,0 +1,27 @@
+package webpage
+
+import org.scalajs.dom
+import org.scalajs.dom.{Node, Element}
+import scala.scalajs.js
+import scala.scalajs.js.annotation.JSExport
+import scalatags.JsDom.all._
+
+@JSExport
+object Weather0 extends{
+ @JSExport
+ def main(target: dom.HTMLDivElement) = {
+ val xhr = new dom.XMLHttpRequest()
+ xhr.open("GET",
+ "http://api.openweathermap.org/" +
+ "data/2.5/weather?q=Singapore"
+ )
+ xhr.onload = (e: dom.Event) => {
+ if (xhr.status == 200) {
+ target.appendChild(
+ pre(xhr.responseText).render
+ )
+ }
+ }
+ xhr.send()
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/webpage/Weather1.scala b/examples/demos/src/main/scala/webpage/Weather1.scala
new file mode 100644
index 0000000..c509cb5
--- /dev/null
+++ b/examples/demos/src/main/scala/webpage/Weather1.scala
@@ -0,0 +1,30 @@
+package webpage
+
+import org.scalajs.dom
+import org.scalajs.dom.{Node, Element}
+import scala.scalajs.js
+import scala.scalajs.js.annotation.JSExport
+import scalatags.JsDom.all._
+
+@JSExport
+object Weather1 extends{
+ @JSExport
+ def main(target: dom.HTMLDivElement) = {
+ import dom.extensions._
+ import scala.scalajs
+ .concurrent
+ .JSExecutionContext
+ .Implicits
+ .runNow
+
+ val url =
+ "http://api.openweathermap.org/" +
+ "data/2.5/weather?q=Singapore"
+
+ Ajax.get(url).onSuccess{ case xhr =>
+ target.appendChild(
+ pre(xhr.responseText).render
+ )
+ }
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/webpage/Weather2.scala b/examples/demos/src/main/scala/webpage/Weather2.scala
new file mode 100644
index 0000000..aa04059
--- /dev/null
+++ b/examples/demos/src/main/scala/webpage/Weather2.scala
@@ -0,0 +1,35 @@
+package webpage
+
+import org.scalajs.dom
+import org.scalajs.dom.{Node, Element}
+import scala.scalajs.js
+import scala.scalajs.js.annotation.JSExport
+import scalatags.JsDom.all._
+
+@JSExport
+object Weather2 extends{
+ @JSExport
+ def main(target: dom.HTMLDivElement) = {
+ import dom.extensions._
+ import scala.scalajs
+ .concurrent
+ .JSExecutionContext
+ .Implicits
+ .runNow
+
+ val url =
+ "http://api.openweathermap.org/" +
+ "data/2.5/weather?q=Singapore"
+
+ Ajax.get(url).onSuccess{ case xhr =>
+ target.appendChild(
+ pre(
+ js.JSON.stringify(
+ js.JSON.parse(xhr.responseText),
+ space=4
+ )
+ ).render
+ )
+ }
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/webpage/Weather3.scala b/examples/demos/src/main/scala/webpage/Weather3.scala
new file mode 100644
index 0000000..4dadf94
--- /dev/null
+++ b/examples/demos/src/main/scala/webpage/Weather3.scala
@@ -0,0 +1,55 @@
+package webpage
+
+import org.scalajs.dom
+import org.scalajs.dom.{Node, Element}
+import scala.scalajs.js
+import scala.scalajs.js.annotation.JSExport
+import scalatags.JsDom.all._
+
+@JSExport
+object Weather3 extends{
+ @JSExport
+ def main(target: dom.HTMLDivElement) = {
+ import dom.extensions._
+ import scala.scalajs
+ .concurrent
+ .JSExecutionContext
+ .Implicits
+ .runNow
+
+ val url =
+ "http://api.openweathermap.org/" +
+ "data/2.5/weather?q=Singapore"
+
+ Ajax.get(url).onSuccess{ case xhr =>
+ if (xhr.status == 200) {
+ val json = js.JSON.parse(
+ xhr.responseText
+ )
+ val name = json.name.toString
+ val weather = json.weather
+ .pop()
+ .main
+ .toString
+
+ def celsius(kelvins: js.Dynamic) = {
+ kelvins.asInstanceOf[Double] - 273.15
+ }.toInt
+ val min = celsius(json.main.temp_min)
+ val max = celsius(json.main.temp_max)
+ val humid = json.main.humidity.toString
+ target.appendChild(
+ div(
+ b("Weather in Singapore:"),
+ ul(
+ li(b("Country "), name),
+ li(b("Weather "), weather),
+ li(b("Temp "), min, " - ", max),
+ li(b("Humidity "), humid, "%")
+ )
+ ).render
+ )
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/examples/demos/src/main/scala/webpage/WeatherSearch.scala b/examples/demos/src/main/scala/webpage/WeatherSearch.scala
new file mode 100644
index 0000000..0c8acc9
--- /dev/null
+++ b/examples/demos/src/main/scala/webpage/WeatherSearch.scala
@@ -0,0 +1,90 @@
+package webpage
+
+import org.scalajs.dom
+import dom.extensions._
+import scala.scalajs.concurrent.JSExecutionContext.Implicits.runNow
+import scala.scalajs.js
+import scala.scalajs.js.annotation.JSExport
+import scalatags.JsDom.all._
+
+@JSExport
+object WeatherSearch extends{
+ @JSExport
+ def main(target: dom.HTMLDivElement) = {
+
+ lazy val box = input(
+ `type`:="text",
+ placeholder:="Type here!"
+ ).render
+
+ lazy val output = div(
+ height:="400px",
+ overflowY:="scroll"
+ ).render
+
+ box.onkeyup = (e: dom.Event) => {
+ output.innerHTML = "Loading..."
+ fetchWeather(box.value)
+ }
+
+ target.appendChild(
+ div(
+ h1("Weather Search"),
+ p(
+ "Enter the name of a city to pull the ",
+ "latest weather data from api.openweathermap.com!"
+ ),
+ p(box),
+ hr, output, hr
+ ).render
+ )
+
+ def fetchWeather(query: String) = {
+ val searchUrl =
+ "http://api.openweathermap.org/data/" +
+ "2.5/find?type=like&mode=json&q=" +
+ query
+
+ for{
+ xhr <- Ajax.get(searchUrl)
+ if query == box.value
+ } js.JSON.parse(xhr.responseText).list match{
+ case jsonlist: js.Array[js.Dynamic] =>
+ output.innerHTML = ""
+ showResults(jsonlist, query)
+ case _ =>
+ output.innerHTML = "No Results"
+ }
+ }
+
+ def showResults(jsonlist: js.Array[js.Dynamic], query: String) = {
+ for (json <- jsonlist) {
+ val name = json.name.toString
+ val country = json.sys.country.toString
+ val weather = json.weather.pop().main.toString
+
+ def celsius(kelvins: js.Dynamic) = {
+ kelvins.asInstanceOf[Double] - 273.15
+ }.toInt
+
+ val min = celsius(json.main.temp_min)
+ val max = celsius(json.main.temp_max)
+ val humid = json.main.humidity.toString
+ val (first, last) = name.splitAt(query.length)
+ output.appendChild(
+ div(
+ b(span(first, backgroundColor:="yellow"), last, ", ", country),
+ ul(
+ li(b("Weather "), weather),
+ li(b("Temp "), min, " - ", max),
+ li(b("Humidity "), humid, "%")
+ )
+ ).render
+ )
+ }
+
+ }
+
+
+ }
+} \ No newline at end of file
diff --git a/examples/scala-js/.gitignore b/examples/scala-js/.gitignore
new file mode 100644
index 0000000..90977dc
--- /dev/null
+++ b/examples/scala-js/.gitignore
@@ -0,0 +1,10 @@
+target/
+.cache
+.classpath
+.project
+.settings/
+/scalalib/fetchedSources/
+/partest/fetchedSources/
+/cli/pack/
+/.idea/
+/.idea_modules/
diff --git a/LICENSE b/examples/scala-js/LICENSE
index 79ec7ac..79ec7ac 100644
--- a/LICENSE
+++ b/examples/scala-js/LICENSE
diff --git a/README.md b/examples/scala-js/README.md
index 51e65c9..51e65c9 100644
--- a/README.md
+++ b/examples/scala-js/README.md
diff --git a/TESTING b/examples/scala-js/TESTING
index 7d393a4..7d393a4 100644
--- a/TESTING
+++ b/examples/scala-js/TESTING
diff --git a/ci/check-partest-coverage.sh b/examples/scala-js/ci/check-partest-coverage.sh
index ca35f37..ca35f37 100755
--- a/ci/check-partest-coverage.sh
+++ b/examples/scala-js/ci/check-partest-coverage.sh
diff --git a/ci/checksizes.sh b/examples/scala-js/ci/checksizes.sh
index 8e7a508..8e7a508 100755
--- a/ci/checksizes.sh
+++ b/examples/scala-js/ci/checksizes.sh
diff --git a/ci/matrix.xml b/examples/scala-js/ci/matrix.xml
index 5c02146..5c02146 100644
--- a/ci/matrix.xml
+++ b/examples/scala-js/ci/matrix.xml
diff --git a/ci/scalajs-matrix-build.groovy b/examples/scala-js/ci/scalajs-matrix-build.groovy
index f2a661a..f2a661a 100644
--- a/ci/scalajs-matrix-build.groovy
+++ b/examples/scala-js/ci/scalajs-matrix-build.groovy
diff --git a/cli/src/main/resources/scalajsc b/examples/scala-js/cli/src/main/resources/scalajsc
index 7fd1100..7fd1100 100755
--- a/cli/src/main/resources/scalajsc
+++ b/examples/scala-js/cli/src/main/resources/scalajsc
diff --git a/cli/src/main/resources/scalajsc.bat b/examples/scala-js/cli/src/main/resources/scalajsc.bat
index 767c5df..767c5df 100644
--- a/cli/src/main/resources/scalajsc.bat
+++ b/examples/scala-js/cli/src/main/resources/scalajsc.bat
diff --git a/cli/src/main/resources/scalajsld b/examples/scala-js/cli/src/main/resources/scalajsld
index 7732e2a..7732e2a 100755
--- a/cli/src/main/resources/scalajsld
+++ b/examples/scala-js/cli/src/main/resources/scalajsld
diff --git a/cli/src/main/resources/scalajsld.bat b/examples/scala-js/cli/src/main/resources/scalajsld.bat
index e915237..e915237 100644
--- a/cli/src/main/resources/scalajsld.bat
+++ b/examples/scala-js/cli/src/main/resources/scalajsld.bat
diff --git a/cli/src/main/resources/scalajsp b/examples/scala-js/cli/src/main/resources/scalajsp
index e7a6e58..e7a6e58 100755
--- a/cli/src/main/resources/scalajsp
+++ b/examples/scala-js/cli/src/main/resources/scalajsp
diff --git a/cli/src/main/resources/scalajsp.bat b/examples/scala-js/cli/src/main/resources/scalajsp.bat
index dd9745c..dd9745c 100644
--- a/cli/src/main/resources/scalajsp.bat
+++ b/examples/scala-js/cli/src/main/resources/scalajsp.bat
diff --git a/cli/src/main/scala/scala/scalajs/cli/Scalajsld.scala b/examples/scala-js/cli/src/main/scala/scala/scalajs/cli/Scalajsld.scala
index 55e61af..55e61af 100644
--- a/cli/src/main/scala/scala/scalajs/cli/Scalajsld.scala
+++ b/examples/scala-js/cli/src/main/scala/scala/scalajs/cli/Scalajsld.scala
diff --git a/cli/src/main/scala/scala/scalajs/cli/Scalajsp.scala b/examples/scala-js/cli/src/main/scala/scala/scalajs/cli/Scalajsp.scala
index 0d64b93..0d64b93 100644
--- a/cli/src/main/scala/scala/scalajs/cli/Scalajsp.scala
+++ b/examples/scala-js/cli/src/main/scala/scala/scalajs/cli/Scalajsp.scala
diff --git a/compiler/src/main/resources/scalac-plugin.xml b/examples/scala-js/compiler/src/main/resources/scalac-plugin.xml
index 76ff1b7..76ff1b7 100644
--- a/compiler/src/main/resources/scalac-plugin.xml
+++ b/examples/scala-js/compiler/src/main/resources/scalac-plugin.xml
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/ClassInfos.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/ClassInfos.scala
index 026d664..026d664 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/ClassInfos.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/ClassInfos.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/Compat210Component.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/Compat210Component.scala
index f357337..f357337 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/Compat210Component.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/Compat210Component.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/GenJSCode.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/GenJSCode.scala
index f9885a0..f9885a0 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/GenJSCode.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/GenJSCode.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/GenJSExports.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/GenJSExports.scala
index 92dc26b..92dc26b 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/GenJSExports.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/GenJSExports.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/GenJSFiles.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/GenJSFiles.scala
index f754e70..f754e70 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/GenJSFiles.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/GenJSFiles.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/JSDefinitions.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSDefinitions.scala
index b8a483a..b8a483a 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/JSDefinitions.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSDefinitions.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/JSEncoding.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSEncoding.scala
index bc7f8be..bc7f8be 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/JSEncoding.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSEncoding.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/JSGlobalAddons.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSGlobalAddons.scala
index 3621050..3621050 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/JSGlobalAddons.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSGlobalAddons.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/JSPrimitives.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSPrimitives.scala
index b8c20e6..b8c20e6 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/JSPrimitives.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSPrimitives.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/JSTreeExtractors.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSTreeExtractors.scala
index a18ad88..a18ad88 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/JSTreeExtractors.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/JSTreeExtractors.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/PrepJSExports.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/PrepJSExports.scala
index 9223061..9223061 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/PrepJSExports.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/PrepJSExports.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/PrepJSInterop.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/PrepJSInterop.scala
index 437576a..437576a 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/PrepJSInterop.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/PrepJSInterop.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/ScalaJSOptions.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/ScalaJSOptions.scala
index 72912bf..72912bf 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/ScalaJSOptions.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/ScalaJSOptions.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/ScalaJSPlugin.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/ScalaJSPlugin.scala
index c3916ab..c3916ab 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/ScalaJSPlugin.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/ScalaJSPlugin.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/TypeKinds.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/TypeKinds.scala
index 774be68..774be68 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/TypeKinds.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/TypeKinds.scala
diff --git a/compiler/src/main/scala/scala/scalajs/compiler/util/ScopedVar.scala b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/util/ScopedVar.scala
index 3924955..3924955 100644
--- a/compiler/src/main/scala/scala/scalajs/compiler/util/ScopedVar.scala
+++ b/examples/scala-js/compiler/src/main/scala/scala/scalajs/compiler/util/ScopedVar.scala
diff --git a/compiler/src/test/scala/scala/scalajs/compiler/test/DiverseErrorsTest.scala b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/DiverseErrorsTest.scala
index 0fe10f8..0fe10f8 100644
--- a/compiler/src/test/scala/scala/scalajs/compiler/test/DiverseErrorsTest.scala
+++ b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/DiverseErrorsTest.scala
diff --git a/compiler/src/test/scala/scala/scalajs/compiler/test/EnumerationInteropTest.scala b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/EnumerationInteropTest.scala
index e186cf4..e186cf4 100644
--- a/compiler/src/test/scala/scala/scalajs/compiler/test/EnumerationInteropTest.scala
+++ b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/EnumerationInteropTest.scala
diff --git a/compiler/src/test/scala/scala/scalajs/compiler/test/JSDynamicLiteralTest.scala b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/JSDynamicLiteralTest.scala
index bc1a1b4..bc1a1b4 100644
--- a/compiler/src/test/scala/scala/scalajs/compiler/test/JSDynamicLiteralTest.scala
+++ b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/JSDynamicLiteralTest.scala
diff --git a/compiler/src/test/scala/scala/scalajs/compiler/test/JSExportASTTest.scala b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/JSExportASTTest.scala
index 4a2b1af..4a2b1af 100644
--- a/compiler/src/test/scala/scala/scalajs/compiler/test/JSExportASTTest.scala
+++ b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/JSExportASTTest.scala
diff --git a/compiler/src/test/scala/scala/scalajs/compiler/test/JSExportTest.scala b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/JSExportTest.scala
index c675420..c675420 100644
--- a/compiler/src/test/scala/scala/scalajs/compiler/test/JSExportTest.scala
+++ b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/JSExportTest.scala
diff --git a/compiler/src/test/scala/scala/scalajs/compiler/test/JSInteropTest.scala b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/JSInteropTest.scala
index 99c274f..99c274f 100644
--- a/compiler/src/test/scala/scala/scalajs/compiler/test/JSInteropTest.scala
+++ b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/JSInteropTest.scala
diff --git a/compiler/src/test/scala/scala/scalajs/compiler/test/OptimizationTest.scala b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/OptimizationTest.scala
index 7f15c7a..7f15c7a 100644
--- a/compiler/src/test/scala/scala/scalajs/compiler/test/OptimizationTest.scala
+++ b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/OptimizationTest.scala
diff --git a/compiler/src/test/scala/scala/scalajs/compiler/test/PositionTest.scala b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/PositionTest.scala
index e25399b..e25399b 100644
--- a/compiler/src/test/scala/scala/scalajs/compiler/test/PositionTest.scala
+++ b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/PositionTest.scala
diff --git a/compiler/src/test/scala/scala/scalajs/compiler/test/util/DirectTest.scala b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/util/DirectTest.scala
index 8289129..8289129 100644
--- a/compiler/src/test/scala/scala/scalajs/compiler/test/util/DirectTest.scala
+++ b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/util/DirectTest.scala
diff --git a/compiler/src/test/scala/scala/scalajs/compiler/test/util/JSASTTest.scala b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/util/JSASTTest.scala
index d3dfd75..d3dfd75 100644
--- a/compiler/src/test/scala/scala/scalajs/compiler/test/util/JSASTTest.scala
+++ b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/util/JSASTTest.scala
diff --git a/compiler/src/test/scala/scala/scalajs/compiler/test/util/TestHelpers.scala b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/util/TestHelpers.scala
index adad89c..adad89c 100644
--- a/compiler/src/test/scala/scala/scalajs/compiler/test/util/TestHelpers.scala
+++ b/examples/scala-js/compiler/src/test/scala/scala/scalajs/compiler/test/util/TestHelpers.scala
diff --git a/examples/helloworld/HelloWorld.scala b/examples/scala-js/examples/helloworld/HelloWorld.scala
index fd33060..fd33060 100644
--- a/examples/helloworld/HelloWorld.scala
+++ b/examples/scala-js/examples/helloworld/HelloWorld.scala
diff --git a/examples/helloworld/helloworld-2.10-fastopt.html b/examples/scala-js/examples/helloworld/helloworld-2.10-fastopt.html
index 98b2705..98b2705 100644
--- a/examples/helloworld/helloworld-2.10-fastopt.html
+++ b/examples/scala-js/examples/helloworld/helloworld-2.10-fastopt.html
diff --git a/examples/helloworld/helloworld-2.10.html b/examples/scala-js/examples/helloworld/helloworld-2.10.html
index 80b00b9..80b00b9 100644
--- a/examples/helloworld/helloworld-2.10.html
+++ b/examples/scala-js/examples/helloworld/helloworld-2.10.html
diff --git a/examples/helloworld/helloworld-2.11-fastopt.html b/examples/scala-js/examples/helloworld/helloworld-2.11-fastopt.html
index dbf5598..dbf5598 100644
--- a/examples/helloworld/helloworld-2.11-fastopt.html
+++ b/examples/scala-js/examples/helloworld/helloworld-2.11-fastopt.html
diff --git a/examples/helloworld/helloworld-2.11.html b/examples/scala-js/examples/helloworld/helloworld-2.11.html
index 9c9a3a1..9c9a3a1 100644
--- a/examples/helloworld/helloworld-2.11.html
+++ b/examples/scala-js/examples/helloworld/helloworld-2.11.html
diff --git a/examples/helloworld/startup.js b/examples/scala-js/examples/helloworld/startup.js
index f45e4cb..f45e4cb 100644
--- a/examples/helloworld/startup.js
+++ b/examples/scala-js/examples/helloworld/startup.js
diff --git a/examples/reversi/JSTypes.scala b/examples/scala-js/examples/reversi/JSTypes.scala
index cc0e5a4..cc0e5a4 100644
--- a/examples/reversi/JSTypes.scala
+++ b/examples/scala-js/examples/reversi/JSTypes.scala
diff --git a/examples/reversi/Reversi.scala b/examples/scala-js/examples/reversi/Reversi.scala
index b4a34a4..b4a34a4 100644
--- a/examples/reversi/Reversi.scala
+++ b/examples/scala-js/examples/reversi/Reversi.scala
diff --git a/examples/reversi/reversi-2.10-fastopt.html b/examples/scala-js/examples/reversi/reversi-2.10-fastopt.html
index 46cd1c7..46cd1c7 100644
--- a/examples/reversi/reversi-2.10-fastopt.html
+++ b/examples/scala-js/examples/reversi/reversi-2.10-fastopt.html
diff --git a/examples/reversi/reversi-2.10.html b/examples/scala-js/examples/reversi/reversi-2.10.html
index 5f7b696..5f7b696 100644
--- a/examples/reversi/reversi-2.10.html
+++ b/examples/scala-js/examples/reversi/reversi-2.10.html
diff --git a/examples/reversi/reversi-2.11-fastopt.html b/examples/scala-js/examples/reversi/reversi-2.11-fastopt.html
index 524e716..524e716 100644
--- a/examples/reversi/reversi-2.11-fastopt.html
+++ b/examples/scala-js/examples/reversi/reversi-2.11-fastopt.html
diff --git a/examples/reversi/reversi-2.11.html b/examples/scala-js/examples/reversi/reversi-2.11.html
index b1a6d08..b1a6d08 100644
--- a/examples/reversi/reversi-2.11.html
+++ b/examples/scala-js/examples/reversi/reversi-2.11.html
diff --git a/examples/testing/src/main/scala/ElementCreator.scala b/examples/scala-js/examples/testing/src/main/scala/ElementCreator.scala
index ccb3600..ccb3600 100644
--- a/examples/testing/src/main/scala/ElementCreator.scala
+++ b/examples/scala-js/examples/testing/src/main/scala/ElementCreator.scala
diff --git a/examples/testing/src/test/scala/CollectionTest.scala b/examples/scala-js/examples/testing/src/test/scala/CollectionTest.scala
index a586ca2..a586ca2 100644
--- a/examples/testing/src/test/scala/CollectionTest.scala
+++ b/examples/scala-js/examples/testing/src/test/scala/CollectionTest.scala
diff --git a/examples/testing/src/test/scala/ElementCreatorTest.scala b/examples/scala-js/examples/testing/src/test/scala/ElementCreatorTest.scala
index 43f6756..43f6756 100644
--- a/examples/testing/src/test/scala/ElementCreatorTest.scala
+++ b/examples/scala-js/examples/testing/src/test/scala/ElementCreatorTest.scala
diff --git a/examples/testing/testing-2.10-fastopt.html b/examples/scala-js/examples/testing/testing-2.10-fastopt.html
index 04ded2f..04ded2f 100644
--- a/examples/testing/testing-2.10-fastopt.html
+++ b/examples/scala-js/examples/testing/testing-2.10-fastopt.html
diff --git a/examples/testing/testing-2.10.html b/examples/scala-js/examples/testing/testing-2.10.html
index bbb0cfe..bbb0cfe 100644
--- a/examples/testing/testing-2.10.html
+++ b/examples/scala-js/examples/testing/testing-2.10.html
diff --git a/examples/testing/testing-2.11-fastopt.html b/examples/scala-js/examples/testing/testing-2.11-fastopt.html
index a87f635..a87f635 100644
--- a/examples/testing/testing-2.11-fastopt.html
+++ b/examples/scala-js/examples/testing/testing-2.11-fastopt.html
diff --git a/examples/testing/testing-2.11.html b/examples/scala-js/examples/testing/testing-2.11.html
index 9902c3f..9902c3f 100644
--- a/examples/testing/testing-2.11.html
+++ b/examples/scala-js/examples/testing/testing-2.11.html
diff --git a/ir/src/main/scala/scala/scalajs/ir/ClassKind.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/ClassKind.scala
index 5092d2c..5092d2c 100644
--- a/ir/src/main/scala/scala/scalajs/ir/ClassKind.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/ClassKind.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/Definitions.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Definitions.scala
index 0762602..0762602 100644
--- a/ir/src/main/scala/scala/scalajs/ir/Definitions.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Definitions.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/Hashers.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Hashers.scala
index 168d7c1..168d7c1 100644
--- a/ir/src/main/scala/scala/scalajs/ir/Hashers.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Hashers.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/InfoSerializers.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/InfoSerializers.scala
index dfb520f..dfb520f 100644
--- a/ir/src/main/scala/scala/scalajs/ir/InfoSerializers.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/InfoSerializers.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/Infos.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Infos.scala
index 66feec2..66feec2 100644
--- a/ir/src/main/scala/scala/scalajs/ir/Infos.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Infos.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/Position.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Position.scala
index 3b6d0a2..3b6d0a2 100644
--- a/ir/src/main/scala/scala/scalajs/ir/Position.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Position.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/Printers.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Printers.scala
index 6208d5f..6208d5f 100644
--- a/ir/src/main/scala/scala/scalajs/ir/Printers.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Printers.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/ScalaJSVersions.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/ScalaJSVersions.scala
index 2690939..2690939 100644
--- a/ir/src/main/scala/scala/scalajs/ir/ScalaJSVersions.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/ScalaJSVersions.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/Serializers.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Serializers.scala
index 04ec5c2..04ec5c2 100644
--- a/ir/src/main/scala/scala/scalajs/ir/Serializers.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Serializers.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/Tags.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Tags.scala
index a03926c..a03926c 100644
--- a/ir/src/main/scala/scala/scalajs/ir/Tags.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Tags.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/Transformers.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Transformers.scala
index 5e4f40c..5e4f40c 100644
--- a/ir/src/main/scala/scala/scalajs/ir/Transformers.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Transformers.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/Traversers.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Traversers.scala
index 1b77e5e..1b77e5e 100644
--- a/ir/src/main/scala/scala/scalajs/ir/Traversers.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Traversers.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/Trees.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Trees.scala
index 4f58ece..4f58ece 100644
--- a/ir/src/main/scala/scala/scalajs/ir/Trees.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Trees.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/Types.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Types.scala
index 4af493a..4af493a 100644
--- a/ir/src/main/scala/scala/scalajs/ir/Types.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Types.scala
diff --git a/ir/src/main/scala/scala/scalajs/ir/Utils.scala b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Utils.scala
index d4769dc..d4769dc 100644
--- a/ir/src/main/scala/scala/scalajs/ir/Utils.scala
+++ b/examples/scala-js/ir/src/main/scala/scala/scalajs/ir/Utils.scala
diff --git a/jasmine-test-framework/src/main/resources/jasmine-polyfills.js b/examples/scala-js/jasmine-test-framework/src/main/resources/jasmine-polyfills.js
index b1a5d44..b1a5d44 100644
--- a/jasmine-test-framework/src/main/resources/jasmine-polyfills.js
+++ b/examples/scala-js/jasmine-test-framework/src/main/resources/jasmine-polyfills.js
diff --git a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Jasmine.scala b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Jasmine.scala
index ca0a63f..ca0a63f 100644
--- a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Jasmine.scala
+++ b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Jasmine.scala
diff --git a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/JasmineEnv.scala b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/JasmineEnv.scala
index b81121e..b81121e 100644
--- a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/JasmineEnv.scala
+++ b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/JasmineEnv.scala
diff --git a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/JasmineExpectation.scala b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/JasmineExpectation.scala
index 9aad02e..9aad02e 100644
--- a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/JasmineExpectation.scala
+++ b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/JasmineExpectation.scala
diff --git a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Results.scala b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Results.scala
index aed78b9..aed78b9 100644
--- a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Results.scala
+++ b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Results.scala
diff --git a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Spec.scala b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Spec.scala
index afbfa13..afbfa13 100644
--- a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Spec.scala
+++ b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Spec.scala
diff --git a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/SpecResults.scala b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/SpecResults.scala
index 50f073c..50f073c 100644
--- a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/SpecResults.scala
+++ b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/SpecResults.scala
diff --git a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Suite.scala b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Suite.scala
index cd4fb75..cd4fb75 100644
--- a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Suite.scala
+++ b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/Suite.scala
diff --git a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/SuiteResults.scala b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/SuiteResults.scala
index db98acf..db98acf 100644
--- a/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/SuiteResults.scala
+++ b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasmine/SuiteResults.scala
diff --git a/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTest.scala b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTest.scala
index 715d39d..715d39d 100644
--- a/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTest.scala
+++ b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTest.scala
diff --git a/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTestFramework.scala b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTestFramework.scala
index 2686e31..2686e31 100644
--- a/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTestFramework.scala
+++ b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTestFramework.scala
diff --git a/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTestReporter.scala b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTestReporter.scala
index 79a7c75..79a7c75 100644
--- a/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTestReporter.scala
+++ b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/JasmineTestReporter.scala
diff --git a/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/TestSuiteContext.scala b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/TestSuiteContext.scala
index 827eefd..827eefd 100644
--- a/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/TestSuiteContext.scala
+++ b/examples/scala-js/jasmine-test-framework/src/main/scala/org/scalajs/jasminetest/TestSuiteContext.scala
diff --git a/javalanglib/src/main/scala/java/lang/Appendable.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Appendable.scala
index 9cd74ad..9cd74ad 100644
--- a/javalanglib/src/main/scala/java/lang/Appendable.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Appendable.scala
diff --git a/javalanglib/src/main/scala/java/lang/AutoCloseable.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/AutoCloseable.scala
index 21a3d0f..21a3d0f 100644
--- a/javalanglib/src/main/scala/java/lang/AutoCloseable.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/AutoCloseable.scala
diff --git a/javalanglib/src/main/scala/java/lang/Boolean.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Boolean.scala
index 94a9967..94a9967 100644
--- a/javalanglib/src/main/scala/java/lang/Boolean.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Boolean.scala
diff --git a/javalanglib/src/main/scala/java/lang/Byte.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Byte.scala
index dc0c82f..dc0c82f 100644
--- a/javalanglib/src/main/scala/java/lang/Byte.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Byte.scala
diff --git a/javalanglib/src/main/scala/java/lang/CharSequence.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/CharSequence.scala
index 5875a2d..5875a2d 100644
--- a/javalanglib/src/main/scala/java/lang/CharSequence.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/CharSequence.scala
diff --git a/javalanglib/src/main/scala/java/lang/Character.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Character.scala
index 1b2b565..1b2b565 100644
--- a/javalanglib/src/main/scala/java/lang/Character.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Character.scala
diff --git a/javalanglib/src/main/scala/java/lang/Class.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Class.scala
index e8ff46f..e8ff46f 100644
--- a/javalanglib/src/main/scala/java/lang/Class.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Class.scala
diff --git a/javalanglib/src/main/scala/java/lang/Cloneable.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Cloneable.scala
index 4183bf5..4183bf5 100644
--- a/javalanglib/src/main/scala/java/lang/Cloneable.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Cloneable.scala
diff --git a/javalanglib/src/main/scala/java/lang/Comparable.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Comparable.scala
index 8d17c6f..8d17c6f 100644
--- a/javalanglib/src/main/scala/java/lang/Comparable.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Comparable.scala
diff --git a/javalanglib/src/main/scala/java/lang/Double.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Double.scala
index 25987ac..25987ac 100644
--- a/javalanglib/src/main/scala/java/lang/Double.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Double.scala
diff --git a/javalanglib/src/main/scala/java/lang/Float.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Float.scala
index 70cb33e..70cb33e 100644
--- a/javalanglib/src/main/scala/java/lang/Float.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Float.scala
diff --git a/javalanglib/src/main/scala/java/lang/InheritableThreadLocal.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/InheritableThreadLocal.scala
index 92ef07c..92ef07c 100644
--- a/javalanglib/src/main/scala/java/lang/InheritableThreadLocal.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/InheritableThreadLocal.scala
diff --git a/javalanglib/src/main/scala/java/lang/Integer.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Integer.scala
index a002fb7..a002fb7 100644
--- a/javalanglib/src/main/scala/java/lang/Integer.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Integer.scala
diff --git a/javalanglib/src/main/scala/java/lang/Long.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Long.scala
index beeef32..beeef32 100644
--- a/javalanglib/src/main/scala/java/lang/Long.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Long.scala
diff --git a/javalanglib/src/main/scala/java/lang/Math.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Math.scala
index c8cd7aa..c8cd7aa 100644
--- a/javalanglib/src/main/scala/java/lang/Math.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Math.scala
diff --git a/javalanglib/src/main/scala/java/lang/Number.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Number.scala
index 05ffc7a..05ffc7a 100644
--- a/javalanglib/src/main/scala/java/lang/Number.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Number.scala
diff --git a/javalanglib/src/main/scala/java/lang/Readable.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Readable.scala
index 53e5689..53e5689 100644
--- a/javalanglib/src/main/scala/java/lang/Readable.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Readable.scala
diff --git a/javalanglib/src/main/scala/java/lang/Runnable.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Runnable.scala
index c98cb41..c98cb41 100644
--- a/javalanglib/src/main/scala/java/lang/Runnable.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Runnable.scala
diff --git a/javalanglib/src/main/scala/java/lang/Runtime.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Runtime.scala
index 25aaa9f..25aaa9f 100644
--- a/javalanglib/src/main/scala/java/lang/Runtime.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Runtime.scala
diff --git a/javalanglib/src/main/scala/java/lang/Short.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Short.scala
index 135fe12..135fe12 100644
--- a/javalanglib/src/main/scala/java/lang/Short.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Short.scala
diff --git a/javalanglib/src/main/scala/java/lang/StackTraceElement.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/StackTraceElement.scala
index cc87aec..cc87aec 100644
--- a/javalanglib/src/main/scala/java/lang/StackTraceElement.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/StackTraceElement.scala
diff --git a/javalanglib/src/main/scala/java/lang/StringBuffer.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/StringBuffer.scala
index 31ee89a..31ee89a 100644
--- a/javalanglib/src/main/scala/java/lang/StringBuffer.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/StringBuffer.scala
diff --git a/javalanglib/src/main/scala/java/lang/StringBuilder.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/StringBuilder.scala
index e8bd2b7..e8bd2b7 100644
--- a/javalanglib/src/main/scala/java/lang/StringBuilder.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/StringBuilder.scala
diff --git a/javalanglib/src/main/scala/java/lang/System.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/System.scala
index 6d80eaf..6d80eaf 100644
--- a/javalanglib/src/main/scala/java/lang/System.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/System.scala
diff --git a/javalanglib/src/main/scala/java/lang/Thread.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Thread.scala
index e52d7f6..e52d7f6 100644
--- a/javalanglib/src/main/scala/java/lang/Thread.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Thread.scala
diff --git a/javalanglib/src/main/scala/java/lang/ThreadLocal.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/ThreadLocal.scala
index a36a40c..a36a40c 100644
--- a/javalanglib/src/main/scala/java/lang/ThreadLocal.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/ThreadLocal.scala
diff --git a/javalanglib/src/main/scala/java/lang/Throwables.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Throwables.scala
index a38fee9..a38fee9 100644
--- a/javalanglib/src/main/scala/java/lang/Throwables.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Throwables.scala
diff --git a/javalanglib/src/main/scala/java/lang/Void.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/Void.scala
index fbe68fb..fbe68fb 100644
--- a/javalanglib/src/main/scala/java/lang/Void.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/Void.scala
diff --git a/javalanglib/src/main/scala/java/lang/ref/PhantomReference.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/ref/PhantomReference.scala
index ecace8a..ecace8a 100644
--- a/javalanglib/src/main/scala/java/lang/ref/PhantomReference.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/ref/PhantomReference.scala
diff --git a/javalanglib/src/main/scala/java/lang/ref/Reference.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/ref/Reference.scala
index 76909cf..76909cf 100644
--- a/javalanglib/src/main/scala/java/lang/ref/Reference.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/ref/Reference.scala
diff --git a/javalanglib/src/main/scala/java/lang/ref/ReferenceQueue.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/ref/ReferenceQueue.scala
index e9c5110..e9c5110 100644
--- a/javalanglib/src/main/scala/java/lang/ref/ReferenceQueue.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/ref/ReferenceQueue.scala
diff --git a/javalanglib/src/main/scala/java/lang/ref/SoftReference.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/ref/SoftReference.scala
index eb0fdf7..eb0fdf7 100644
--- a/javalanglib/src/main/scala/java/lang/ref/SoftReference.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/ref/SoftReference.scala
diff --git a/javalanglib/src/main/scala/java/lang/ref/WeakReference.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/ref/WeakReference.scala
index 2a74aa1..2a74aa1 100644
--- a/javalanglib/src/main/scala/java/lang/ref/WeakReference.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/ref/WeakReference.scala
diff --git a/javalanglib/src/main/scala/java/lang/reflect/Array.scala b/examples/scala-js/javalanglib/src/main/scala/java/lang/reflect/Array.scala
index bc3696e..bc3696e 100644
--- a/javalanglib/src/main/scala/java/lang/reflect/Array.scala
+++ b/examples/scala-js/javalanglib/src/main/scala/java/lang/reflect/Array.scala
diff --git a/javalib-ex-test-suite/src/test/scala/scala/scalajs/testsuite/javalibex/DataInputStreamTest.scala b/examples/scala-js/javalib-ex-test-suite/src/test/scala/scala/scalajs/testsuite/javalibex/DataInputStreamTest.scala
index 61ec560..61ec560 100644
--- a/javalib-ex-test-suite/src/test/scala/scala/scalajs/testsuite/javalibex/DataInputStreamTest.scala
+++ b/examples/scala-js/javalib-ex-test-suite/src/test/scala/scala/scalajs/testsuite/javalibex/DataInputStreamTest.scala
diff --git a/javalib-ex-test-suite/src/test/scala/scala/scalajs/testsuite/javalibex/ZipInputStreamTest.scala b/examples/scala-js/javalib-ex-test-suite/src/test/scala/scala/scalajs/testsuite/javalibex/ZipInputStreamTest.scala
index b2a2fe2..b2a2fe2 100644
--- a/javalib-ex-test-suite/src/test/scala/scala/scalajs/testsuite/javalibex/ZipInputStreamTest.scala
+++ b/examples/scala-js/javalib-ex-test-suite/src/test/scala/scala/scalajs/testsuite/javalibex/ZipInputStreamTest.scala
diff --git a/javalib-ex/src/main/scala/java/io/DataInputStream.scala b/examples/scala-js/javalib-ex/src/main/scala/java/io/DataInputStream.scala
index bd11731..bd11731 100644
--- a/javalib-ex/src/main/scala/java/io/DataInputStream.scala
+++ b/examples/scala-js/javalib-ex/src/main/scala/java/io/DataInputStream.scala
diff --git a/javalib-ex/src/main/scala/java/util/zip/InflaterInputStream.scala b/examples/scala-js/javalib-ex/src/main/scala/java/util/zip/InflaterInputStream.scala
index 10aa04e..10aa04e 100644
--- a/javalib-ex/src/main/scala/java/util/zip/InflaterInputStream.scala
+++ b/examples/scala-js/javalib-ex/src/main/scala/java/util/zip/InflaterInputStream.scala
diff --git a/javalib-ex/src/main/scala/java/util/zip/ZipEntry.scala b/examples/scala-js/javalib-ex/src/main/scala/java/util/zip/ZipEntry.scala
index 89f37a3..89f37a3 100644
--- a/javalib-ex/src/main/scala/java/util/zip/ZipEntry.scala
+++ b/examples/scala-js/javalib-ex/src/main/scala/java/util/zip/ZipEntry.scala
diff --git a/javalib-ex/src/main/scala/java/util/zip/ZipInputStream.scala b/examples/scala-js/javalib-ex/src/main/scala/java/util/zip/ZipInputStream.scala
index 082f6fc..082f6fc 100644
--- a/javalib-ex/src/main/scala/java/util/zip/ZipInputStream.scala
+++ b/examples/scala-js/javalib-ex/src/main/scala/java/util/zip/ZipInputStream.scala
diff --git a/javalib/src/main/scala/java/io/BufferedReader.scala b/examples/scala-js/javalib/src/main/scala/java/io/BufferedReader.scala
index 0f06523..0f06523 100644
--- a/javalib/src/main/scala/java/io/BufferedReader.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/BufferedReader.scala
diff --git a/javalib/src/main/scala/java/io/ByteArrayInputStream.scala b/examples/scala-js/javalib/src/main/scala/java/io/ByteArrayInputStream.scala
index 697e07b..697e07b 100644
--- a/javalib/src/main/scala/java/io/ByteArrayInputStream.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/ByteArrayInputStream.scala
diff --git a/javalib/src/main/scala/java/io/ByteArrayOutputStream.scala b/examples/scala-js/javalib/src/main/scala/java/io/ByteArrayOutputStream.scala
index 916002d..916002d 100644
--- a/javalib/src/main/scala/java/io/ByteArrayOutputStream.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/ByteArrayOutputStream.scala
diff --git a/javalib/src/main/scala/java/io/Closeable.scala b/examples/scala-js/javalib/src/main/scala/java/io/Closeable.scala
index e572390..e572390 100644
--- a/javalib/src/main/scala/java/io/Closeable.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/Closeable.scala
diff --git a/javalib/src/main/scala/java/io/DataInput.scala b/examples/scala-js/javalib/src/main/scala/java/io/DataInput.scala
index 37913b4..37913b4 100644
--- a/javalib/src/main/scala/java/io/DataInput.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/DataInput.scala
diff --git a/javalib/src/main/scala/java/io/FilterInputStream.scala b/examples/scala-js/javalib/src/main/scala/java/io/FilterInputStream.scala
index a85b9f6..a85b9f6 100644
--- a/javalib/src/main/scala/java/io/FilterInputStream.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/FilterInputStream.scala
diff --git a/javalib/src/main/scala/java/io/FilterOutputStream.scala b/examples/scala-js/javalib/src/main/scala/java/io/FilterOutputStream.scala
index 299b7b6..299b7b6 100644
--- a/javalib/src/main/scala/java/io/FilterOutputStream.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/FilterOutputStream.scala
diff --git a/javalib/src/main/scala/java/io/Flushable.scala b/examples/scala-js/javalib/src/main/scala/java/io/Flushable.scala
index 2879ad2..2879ad2 100644
--- a/javalib/src/main/scala/java/io/Flushable.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/Flushable.scala
diff --git a/javalib/src/main/scala/java/io/InputStream.scala b/examples/scala-js/javalib/src/main/scala/java/io/InputStream.scala
index 412d84b..412d84b 100644
--- a/javalib/src/main/scala/java/io/InputStream.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/InputStream.scala
diff --git a/javalib/src/main/scala/java/io/InputStreamReader.scala b/examples/scala-js/javalib/src/main/scala/java/io/InputStreamReader.scala
index 1ef957c..1ef957c 100644
--- a/javalib/src/main/scala/java/io/InputStreamReader.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/InputStreamReader.scala
diff --git a/javalib/src/main/scala/java/io/OutputStream.scala b/examples/scala-js/javalib/src/main/scala/java/io/OutputStream.scala
index 729e69b..729e69b 100644
--- a/javalib/src/main/scala/java/io/OutputStream.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/OutputStream.scala
diff --git a/javalib/src/main/scala/java/io/OutputStreamWriter.scala b/examples/scala-js/javalib/src/main/scala/java/io/OutputStreamWriter.scala
index 18c1c57..18c1c57 100644
--- a/javalib/src/main/scala/java/io/OutputStreamWriter.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/OutputStreamWriter.scala
diff --git a/javalib/src/main/scala/java/io/PrintStream.scala b/examples/scala-js/javalib/src/main/scala/java/io/PrintStream.scala
index 68fa041..68fa041 100644
--- a/javalib/src/main/scala/java/io/PrintStream.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/PrintStream.scala
diff --git a/javalib/src/main/scala/java/io/PrintWriter.scala b/examples/scala-js/javalib/src/main/scala/java/io/PrintWriter.scala
index 4e693e0..4e693e0 100644
--- a/javalib/src/main/scala/java/io/PrintWriter.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/PrintWriter.scala
diff --git a/javalib/src/main/scala/java/io/Reader.scala b/examples/scala-js/javalib/src/main/scala/java/io/Reader.scala
index 97be140..97be140 100644
--- a/javalib/src/main/scala/java/io/Reader.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/Reader.scala
diff --git a/javalib/src/main/scala/java/io/Serializable.scala b/examples/scala-js/javalib/src/main/scala/java/io/Serializable.scala
index 01dd228..01dd228 100644
--- a/javalib/src/main/scala/java/io/Serializable.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/Serializable.scala
diff --git a/javalib/src/main/scala/java/io/StringReader.scala b/examples/scala-js/javalib/src/main/scala/java/io/StringReader.scala
index 2ca8f90..2ca8f90 100644
--- a/javalib/src/main/scala/java/io/StringReader.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/StringReader.scala
diff --git a/javalib/src/main/scala/java/io/StringWriter.scala b/examples/scala-js/javalib/src/main/scala/java/io/StringWriter.scala
index 13eca00..13eca00 100644
--- a/javalib/src/main/scala/java/io/StringWriter.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/StringWriter.scala
diff --git a/javalib/src/main/scala/java/io/Throwables.scala b/examples/scala-js/javalib/src/main/scala/java/io/Throwables.scala
index c312c4c..c312c4c 100644
--- a/javalib/src/main/scala/java/io/Throwables.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/Throwables.scala
diff --git a/javalib/src/main/scala/java/io/Writer.scala b/examples/scala-js/javalib/src/main/scala/java/io/Writer.scala
index d63b477..d63b477 100644
--- a/javalib/src/main/scala/java/io/Writer.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/io/Writer.scala
diff --git a/javalib/src/main/scala/java/net/URI.scala b/examples/scala-js/javalib/src/main/scala/java/net/URI.scala
index c969f55..c969f55 100644
--- a/javalib/src/main/scala/java/net/URI.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/net/URI.scala
diff --git a/javalib/src/main/scala/java/net/URISyntaxException.scala b/examples/scala-js/javalib/src/main/scala/java/net/URISyntaxException.scala
index 85e0879..85e0879 100644
--- a/javalib/src/main/scala/java/net/URISyntaxException.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/net/URISyntaxException.scala
diff --git a/javalib/src/main/scala/java/nio/Buffer.scala b/examples/scala-js/javalib/src/main/scala/java/nio/Buffer.scala
index be7ab7f..be7ab7f 100644
--- a/javalib/src/main/scala/java/nio/Buffer.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/Buffer.scala
diff --git a/javalib/src/main/scala/java/nio/BufferOverflowException.scala b/examples/scala-js/javalib/src/main/scala/java/nio/BufferOverflowException.scala
index 03f359e..03f359e 100644
--- a/javalib/src/main/scala/java/nio/BufferOverflowException.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/BufferOverflowException.scala
diff --git a/javalib/src/main/scala/java/nio/BufferUnderflowException.scala b/examples/scala-js/javalib/src/main/scala/java/nio/BufferUnderflowException.scala
index e286975..e286975 100644
--- a/javalib/src/main/scala/java/nio/BufferUnderflowException.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/BufferUnderflowException.scala
diff --git a/javalib/src/main/scala/java/nio/ByteBuffer.scala b/examples/scala-js/javalib/src/main/scala/java/nio/ByteBuffer.scala
index b743b39..b743b39 100644
--- a/javalib/src/main/scala/java/nio/ByteBuffer.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/ByteBuffer.scala
diff --git a/javalib/src/main/scala/java/nio/ByteOrder.scala b/examples/scala-js/javalib/src/main/scala/java/nio/ByteOrder.scala
index 20bac6a..20bac6a 100644
--- a/javalib/src/main/scala/java/nio/ByteOrder.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/ByteOrder.scala
diff --git a/javalib/src/main/scala/java/nio/CharBuffer.scala b/examples/scala-js/javalib/src/main/scala/java/nio/CharBuffer.scala
index 5e74953..5e74953 100644
--- a/javalib/src/main/scala/java/nio/CharBuffer.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/CharBuffer.scala
diff --git a/javalib/src/main/scala/java/nio/HeapByteBuffer.scala b/examples/scala-js/javalib/src/main/scala/java/nio/HeapByteBuffer.scala
index ed3fd29..ed3fd29 100644
--- a/javalib/src/main/scala/java/nio/HeapByteBuffer.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/HeapByteBuffer.scala
diff --git a/javalib/src/main/scala/java/nio/HeapCharBuffer.scala b/examples/scala-js/javalib/src/main/scala/java/nio/HeapCharBuffer.scala
index 546c55d..546c55d 100644
--- a/javalib/src/main/scala/java/nio/HeapCharBuffer.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/HeapCharBuffer.scala
diff --git a/javalib/src/main/scala/java/nio/InvalidMarkException.scala b/examples/scala-js/javalib/src/main/scala/java/nio/InvalidMarkException.scala
index c2d3714..c2d3714 100644
--- a/javalib/src/main/scala/java/nio/InvalidMarkException.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/InvalidMarkException.scala
diff --git a/javalib/src/main/scala/java/nio/ReadOnlyBufferException.scala b/examples/scala-js/javalib/src/main/scala/java/nio/ReadOnlyBufferException.scala
index ee0868b..ee0868b 100644
--- a/javalib/src/main/scala/java/nio/ReadOnlyBufferException.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/ReadOnlyBufferException.scala
diff --git a/javalib/src/main/scala/java/nio/StringCharBuffer.scala b/examples/scala-js/javalib/src/main/scala/java/nio/StringCharBuffer.scala
index 25bc594..25bc594 100644
--- a/javalib/src/main/scala/java/nio/StringCharBuffer.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/StringCharBuffer.scala
diff --git a/javalib/src/main/scala/java/nio/charset/CharacterCodingException.scala b/examples/scala-js/javalib/src/main/scala/java/nio/charset/CharacterCodingException.scala
index 8017348..8017348 100644
--- a/javalib/src/main/scala/java/nio/charset/CharacterCodingException.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/charset/CharacterCodingException.scala
diff --git a/javalib/src/main/scala/java/nio/charset/Charset.scala b/examples/scala-js/javalib/src/main/scala/java/nio/charset/Charset.scala
index 6d1af47..6d1af47 100644
--- a/javalib/src/main/scala/java/nio/charset/Charset.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/charset/Charset.scala
diff --git a/javalib/src/main/scala/java/nio/charset/CharsetDecoder.scala b/examples/scala-js/javalib/src/main/scala/java/nio/charset/CharsetDecoder.scala
index a3532ba..a3532ba 100644
--- a/javalib/src/main/scala/java/nio/charset/CharsetDecoder.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/charset/CharsetDecoder.scala
diff --git a/javalib/src/main/scala/java/nio/charset/CharsetEncoder.scala b/examples/scala-js/javalib/src/main/scala/java/nio/charset/CharsetEncoder.scala
index 37d2296..37d2296 100644
--- a/javalib/src/main/scala/java/nio/charset/CharsetEncoder.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/charset/CharsetEncoder.scala
diff --git a/javalib/src/main/scala/java/nio/charset/CoderMalfunctionError.scala b/examples/scala-js/javalib/src/main/scala/java/nio/charset/CoderMalfunctionError.scala
index 33174f3..33174f3 100644
--- a/javalib/src/main/scala/java/nio/charset/CoderMalfunctionError.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/charset/CoderMalfunctionError.scala
diff --git a/javalib/src/main/scala/java/nio/charset/CoderResult.scala b/examples/scala-js/javalib/src/main/scala/java/nio/charset/CoderResult.scala
index fdc63cc..fdc63cc 100644
--- a/javalib/src/main/scala/java/nio/charset/CoderResult.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/charset/CoderResult.scala
diff --git a/javalib/src/main/scala/java/nio/charset/CodingErrorAction.scala b/examples/scala-js/javalib/src/main/scala/java/nio/charset/CodingErrorAction.scala
index 63b48bb..63b48bb 100644
--- a/javalib/src/main/scala/java/nio/charset/CodingErrorAction.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/charset/CodingErrorAction.scala
diff --git a/javalib/src/main/scala/java/nio/charset/MalformedInputException.scala b/examples/scala-js/javalib/src/main/scala/java/nio/charset/MalformedInputException.scala
index 4c91c1b..4c91c1b 100644
--- a/javalib/src/main/scala/java/nio/charset/MalformedInputException.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/charset/MalformedInputException.scala
diff --git a/javalib/src/main/scala/java/nio/charset/StandardCharsets.scala b/examples/scala-js/javalib/src/main/scala/java/nio/charset/StandardCharsets.scala
index 38f3f98..38f3f98 100644
--- a/javalib/src/main/scala/java/nio/charset/StandardCharsets.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/charset/StandardCharsets.scala
diff --git a/javalib/src/main/scala/java/nio/charset/UnmappableCharacterException.scala b/examples/scala-js/javalib/src/main/scala/java/nio/charset/UnmappableCharacterException.scala
index 5748f70..5748f70 100644
--- a/javalib/src/main/scala/java/nio/charset/UnmappableCharacterException.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/charset/UnmappableCharacterException.scala
diff --git a/javalib/src/main/scala/java/nio/charset/UnsupportedCharsetException.scala b/examples/scala-js/javalib/src/main/scala/java/nio/charset/UnsupportedCharsetException.scala
index 97a7a4e..97a7a4e 100644
--- a/javalib/src/main/scala/java/nio/charset/UnsupportedCharsetException.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/nio/charset/UnsupportedCharsetException.scala
diff --git a/javalib/src/main/scala/java/util/Arrays.scala b/examples/scala-js/javalib/src/main/scala/java/util/Arrays.scala
index ed9afd1..ed9afd1 100644
--- a/javalib/src/main/scala/java/util/Arrays.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/Arrays.scala
diff --git a/javalib/src/main/scala/java/util/Comparator.scala b/examples/scala-js/javalib/src/main/scala/java/util/Comparator.scala
index d63c48e..d63c48e 100644
--- a/javalib/src/main/scala/java/util/Comparator.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/Comparator.scala
diff --git a/javalib/src/main/scala/java/util/Date.scala b/examples/scala-js/javalib/src/main/scala/java/util/Date.scala
index 8f4e85f..8f4e85f 100644
--- a/javalib/src/main/scala/java/util/Date.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/Date.scala
diff --git a/javalib/src/main/scala/java/util/Formattable.scala b/examples/scala-js/javalib/src/main/scala/java/util/Formattable.scala
index e651fbb..e651fbb 100644
--- a/javalib/src/main/scala/java/util/Formattable.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/Formattable.scala
diff --git a/javalib/src/main/scala/java/util/FormattableFlags.scala b/examples/scala-js/javalib/src/main/scala/java/util/FormattableFlags.scala
index 02f5bce..02f5bce 100644
--- a/javalib/src/main/scala/java/util/FormattableFlags.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/FormattableFlags.scala
diff --git a/javalib/src/main/scala/java/util/Formatter.scala b/examples/scala-js/javalib/src/main/scala/java/util/Formatter.scala
index 5e0ab22..5e0ab22 100644
--- a/javalib/src/main/scala/java/util/Formatter.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/Formatter.scala
diff --git a/javalib/src/main/scala/java/util/Random.scala b/examples/scala-js/javalib/src/main/scala/java/util/Random.scala
index 80428fb..80428fb 100644
--- a/javalib/src/main/scala/java/util/Random.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/Random.scala
diff --git a/javalib/src/main/scala/java/util/Throwables.scala b/examples/scala-js/javalib/src/main/scala/java/util/Throwables.scala
index c4bb3d6..c4bb3d6 100644
--- a/javalib/src/main/scala/java/util/Throwables.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/Throwables.scala
diff --git a/javalib/src/main/scala/java/util/UUID.scala b/examples/scala-js/javalib/src/main/scala/java/util/UUID.scala
index 9e6c1d4..9e6c1d4 100644
--- a/javalib/src/main/scala/java/util/UUID.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/UUID.scala
diff --git a/javalib/src/main/scala/java/util/concurrent/ExecutionException.scala b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/ExecutionException.scala
index 6d04889..6d04889 100644
--- a/javalib/src/main/scala/java/util/concurrent/ExecutionException.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/ExecutionException.scala
diff --git a/javalib/src/main/scala/java/util/concurrent/Executor.scala b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/Executor.scala
index d030551..d030551 100644
--- a/javalib/src/main/scala/java/util/concurrent/Executor.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/Executor.scala
diff --git a/javalib/src/main/scala/java/util/concurrent/TimeUnit.scala b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/TimeUnit.scala
index a77dbfc..a77dbfc 100644
--- a/javalib/src/main/scala/java/util/concurrent/TimeUnit.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/TimeUnit.scala
diff --git a/javalib/src/main/scala/java/util/concurrent/atomic/AtomicBoolean.scala b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicBoolean.scala
index 5675c31..5675c31 100644
--- a/javalib/src/main/scala/java/util/concurrent/atomic/AtomicBoolean.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicBoolean.scala
diff --git a/javalib/src/main/scala/java/util/concurrent/atomic/AtomicInteger.scala b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicInteger.scala
index 1f24b7b..1f24b7b 100644
--- a/javalib/src/main/scala/java/util/concurrent/atomic/AtomicInteger.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicInteger.scala
diff --git a/javalib/src/main/scala/java/util/concurrent/atomic/AtomicLong.scala b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicLong.scala
index 5bfecf2..5bfecf2 100644
--- a/javalib/src/main/scala/java/util/concurrent/atomic/AtomicLong.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicLong.scala
diff --git a/javalib/src/main/scala/java/util/concurrent/atomic/AtomicReference.scala b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicReference.scala
index 650b1e0..650b1e0 100644
--- a/javalib/src/main/scala/java/util/concurrent/atomic/AtomicReference.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicReference.scala
diff --git a/javalib/src/main/scala/java/util/regex/MatchResult.scala b/examples/scala-js/javalib/src/main/scala/java/util/regex/MatchResult.scala
index f321c60..f321c60 100644
--- a/javalib/src/main/scala/java/util/regex/MatchResult.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/regex/MatchResult.scala
diff --git a/javalib/src/main/scala/java/util/regex/Matcher.scala b/examples/scala-js/javalib/src/main/scala/java/util/regex/Matcher.scala
index 331f56b..331f56b 100644
--- a/javalib/src/main/scala/java/util/regex/Matcher.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/regex/Matcher.scala
diff --git a/javalib/src/main/scala/java/util/regex/Pattern.scala b/examples/scala-js/javalib/src/main/scala/java/util/regex/Pattern.scala
index fda103f..fda103f 100644
--- a/javalib/src/main/scala/java/util/regex/Pattern.scala
+++ b/examples/scala-js/javalib/src/main/scala/java/util/regex/Pattern.scala
diff --git a/library-aux/src/main/scala/scala/runtime/ArrayRuntime.scala b/examples/scala-js/library-aux/src/main/scala/scala/runtime/ArrayRuntime.scala
index ceda199..ceda199 100644
--- a/library-aux/src/main/scala/scala/runtime/ArrayRuntime.scala
+++ b/examples/scala-js/library-aux/src/main/scala/scala/runtime/ArrayRuntime.scala
diff --git a/library-aux/src/main/scala/scala/runtime/BoxedUnit.scala b/examples/scala-js/library-aux/src/main/scala/scala/runtime/BoxedUnit.scala
index b6ac773..b6ac773 100644
--- a/library-aux/src/main/scala/scala/runtime/BoxedUnit.scala
+++ b/examples/scala-js/library-aux/src/main/scala/scala/runtime/BoxedUnit.scala
diff --git a/library-aux/src/main/scala/scala/runtime/RefTypes.scala b/examples/scala-js/library-aux/src/main/scala/scala/runtime/RefTypes.scala
index 4724d13..4724d13 100644
--- a/library-aux/src/main/scala/scala/runtime/RefTypes.scala
+++ b/examples/scala-js/library-aux/src/main/scala/scala/runtime/RefTypes.scala
diff --git a/library-aux/src/main/scala/scala/runtime/Statics.scala b/examples/scala-js/library-aux/src/main/scala/scala/runtime/Statics.scala
index b4e7e52..b4e7e52 100644
--- a/library-aux/src/main/scala/scala/runtime/Statics.scala
+++ b/examples/scala-js/library-aux/src/main/scala/scala/runtime/Statics.scala
diff --git a/library/src/main/scala/scala/scalajs/concurrent/JSExecutionContext.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/concurrent/JSExecutionContext.scala
index c159dcb..c159dcb 100644
--- a/library/src/main/scala/scala/scalajs/concurrent/JSExecutionContext.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/concurrent/JSExecutionContext.scala
diff --git a/library/src/main/scala/scala/scalajs/concurrent/QueueExecutionContext.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/concurrent/QueueExecutionContext.scala
index 1f2ee6f..1f2ee6f 100644
--- a/library/src/main/scala/scala/scalajs/concurrent/QueueExecutionContext.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/concurrent/QueueExecutionContext.scala
diff --git a/library/src/main/scala/scala/scalajs/concurrent/RunNowExcecutionContext.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/concurrent/RunNowExcecutionContext.scala
index ba113b4..ba113b4 100644
--- a/library/src/main/scala/scala/scalajs/concurrent/RunNowExcecutionContext.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/concurrent/RunNowExcecutionContext.scala
diff --git a/library/src/main/scala/scala/scalajs/js/Array.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Array.scala
index 4c9cf23..4c9cf23 100644
--- a/library/src/main/scala/scala/scalajs/js/Array.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Array.scala
diff --git a/library/src/main/scala/scala/scalajs/js/ArrayOps.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/ArrayOps.scala
index f7948ca..f7948ca 100644
--- a/library/src/main/scala/scala/scalajs/js/ArrayOps.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/ArrayOps.scala
diff --git a/library/src/main/scala/scala/scalajs/js/Date.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Date.scala
index 18795c7..18795c7 100644
--- a/library/src/main/scala/scala/scalajs/js/Date.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Date.scala
diff --git a/library/src/main/scala/scala/scalajs/js/Dictionary.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Dictionary.scala
index fa68d08..fa68d08 100644
--- a/library/src/main/scala/scala/scalajs/js/Dictionary.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Dictionary.scala
diff --git a/library/src/main/scala/scala/scalajs/js/Error.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Error.scala
index 129ff41..129ff41 100644
--- a/library/src/main/scala/scala/scalajs/js/Error.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Error.scala
diff --git a/library/src/main/scala/scala/scalajs/js/Function.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Function.scala
index 4a7d1d9..4a7d1d9 100644
--- a/library/src/main/scala/scala/scalajs/js/Function.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Function.scala
diff --git a/library/src/main/scala/scala/scalajs/js/GlobalScope.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/GlobalScope.scala
index 67c09ed..67c09ed 100644
--- a/library/src/main/scala/scala/scalajs/js/GlobalScope.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/GlobalScope.scala
diff --git a/library/src/main/scala/scala/scalajs/js/JSApp.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/JSApp.scala
index fd12207..fd12207 100644
--- a/library/src/main/scala/scala/scalajs/js/JSApp.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/JSApp.scala
diff --git a/library/src/main/scala/scala/scalajs/js/JSArrayOps.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/JSArrayOps.scala
index 71f705d..71f705d 100644
--- a/library/src/main/scala/scala/scalajs/js/JSArrayOps.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/JSArrayOps.scala
diff --git a/library/src/main/scala/scala/scalajs/js/JSConverters.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/JSConverters.scala
index 1b21d61..1b21d61 100644
--- a/library/src/main/scala/scala/scalajs/js/JSConverters.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/JSConverters.scala
diff --git a/library/src/main/scala/scala/scalajs/js/JSON.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/JSON.scala
index 8404f40..8404f40 100644
--- a/library/src/main/scala/scala/scalajs/js/JSON.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/JSON.scala
diff --git a/library/src/main/scala/scala/scalajs/js/JavaScriptException.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/JavaScriptException.scala
index e4803c8..e4803c8 100644
--- a/library/src/main/scala/scala/scalajs/js/JavaScriptException.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/JavaScriptException.scala
diff --git a/library/src/main/scala/scala/scalajs/js/Math.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Math.scala
index 02caaa0..02caaa0 100644
--- a/library/src/main/scala/scala/scalajs/js/Math.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Math.scala
diff --git a/library/src/main/scala/scala/scalajs/js/Primitives.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Primitives.scala
index 1a3d88c..1a3d88c 100644
--- a/library/src/main/scala/scala/scalajs/js/Primitives.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/Primitives.scala
diff --git a/library/src/main/scala/scala/scalajs/js/PropertyDescriptor.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/PropertyDescriptor.scala
index b91e01d..b91e01d 100644
--- a/library/src/main/scala/scala/scalajs/js/PropertyDescriptor.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/PropertyDescriptor.scala
diff --git a/library/src/main/scala/scala/scalajs/js/RegExp.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/RegExp.scala
index 73f465a..73f465a 100644
--- a/library/src/main/scala/scala/scalajs/js/RegExp.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/RegExp.scala
diff --git a/library/src/main/scala/scala/scalajs/js/ThisFunction.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/ThisFunction.scala
index 2506eed..2506eed 100644
--- a/library/src/main/scala/scala/scalajs/js/ThisFunction.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/ThisFunction.scala
diff --git a/library/src/main/scala/scala/scalajs/js/UndefOr.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/UndefOr.scala
index b356e3a..b356e3a 100644
--- a/library/src/main/scala/scala/scalajs/js/UndefOr.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/UndefOr.scala
diff --git a/library/src/main/scala/scala/scalajs/js/WrappedArray.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/WrappedArray.scala
index 3626c15..3626c15 100644
--- a/library/src/main/scala/scala/scalajs/js/WrappedArray.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/WrappedArray.scala
diff --git a/library/src/main/scala/scala/scalajs/js/WrappedDictionary.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/WrappedDictionary.scala
index f215e6e..f215e6e 100644
--- a/library/src/main/scala/scala/scalajs/js/WrappedDictionary.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/WrappedDictionary.scala
diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSBracketAccess.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSBracketAccess.scala
index 596e327..596e327 100644
--- a/library/src/main/scala/scala/scalajs/js/annotation/JSBracketAccess.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSBracketAccess.scala
diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSExport.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExport.scala
index 0fa9a4e..0fa9a4e 100644
--- a/library/src/main/scala/scala/scalajs/js/annotation/JSExport.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExport.scala
diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSExportAll.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExportAll.scala
index 8174595..8174595 100644
--- a/library/src/main/scala/scala/scalajs/js/annotation/JSExportAll.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExportAll.scala
diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentClasses.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentClasses.scala
index 9f2be96..9f2be96 100644
--- a/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentClasses.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentClasses.scala
diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentObjects.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentObjects.scala
index c196b53..c196b53 100644
--- a/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentObjects.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExportDescendentObjects.scala
diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSExportNamed.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExportNamed.scala
index 718404a..718404a 100644
--- a/library/src/main/scala/scala/scalajs/js/annotation/JSExportNamed.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSExportNamed.scala
diff --git a/library/src/main/scala/scala/scalajs/js/annotation/JSName.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSName.scala
index 5401749..5401749 100644
--- a/library/src/main/scala/scala/scalajs/js/annotation/JSName.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/JSName.scala
diff --git a/library/src/main/scala/scala/scalajs/js/annotation/README.md b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/README.md
index 9ce7ebf..9ce7ebf 100644
--- a/library/src/main/scala/scala/scalajs/js/annotation/README.md
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/README.md
diff --git a/library/src/main/scala/scala/scalajs/js/annotation/RawJSType.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/RawJSType.scala
index a5bb771..a5bb771 100644
--- a/library/src/main/scala/scala/scalajs/js/annotation/RawJSType.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/annotation/RawJSType.scala
diff --git a/library/src/main/scala/scala/scalajs/js/package.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/package.scala
index 4a17ba6..4a17ba6 100644
--- a/library/src/main/scala/scala/scalajs/js/package.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/package.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBuffer.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBuffer.scala
index b8b8160..b8b8160 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBuffer.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBuffer.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBufferInputStream.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBufferInputStream.scala
index f3d2afb..f3d2afb 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBufferInputStream.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBufferInputStream.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBufferView.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBufferView.scala
index 6b25bf5..6b25bf5 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBufferView.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBufferView.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/DataView.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/DataView.scala
index d97544c..d97544c 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/DataView.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/DataView.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/Float32Array.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Float32Array.scala
index abb0dd9..abb0dd9 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/Float32Array.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Float32Array.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/Float64Array.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Float64Array.scala
index 526b376..526b376 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/Float64Array.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Float64Array.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/Int16Array.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int16Array.scala
index c71f101..c71f101 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/Int16Array.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int16Array.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/Int32Array.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int32Array.scala
index 37208e9..37208e9 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/Int32Array.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int32Array.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/Int8Array.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int8Array.scala
index 690ff07..690ff07 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/Int8Array.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int8Array.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/TypedArray.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/TypedArray.scala
index 4e33b5d..4e33b5d 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/TypedArray.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/TypedArray.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/Uint16Array.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Uint16Array.scala
index 82d2847..82d2847 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/Uint16Array.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Uint16Array.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/Uint32Array.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Uint32Array.scala
index 9742e19..9742e19 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/Uint32Array.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Uint32Array.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/Uint8Array.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Uint8Array.scala
index f54904c..f54904c 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/Uint8Array.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Uint8Array.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/Uint8ClampedArray.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Uint8ClampedArray.scala
index 601d65c..601d65c 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/Uint8ClampedArray.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Uint8ClampedArray.scala
diff --git a/library/src/main/scala/scala/scalajs/js/typedarray/package.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/package.scala
index 0ab5a05..0ab5a05 100644
--- a/library/src/main/scala/scala/scalajs/js/typedarray/package.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/package.scala
diff --git a/library/src/main/scala/scala/scalajs/niocharset/ISO_8859_1.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/ISO_8859_1.scala
index 7765f0c..7765f0c 100644
--- a/library/src/main/scala/scala/scalajs/niocharset/ISO_8859_1.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/ISO_8859_1.scala
diff --git a/library/src/main/scala/scala/scalajs/niocharset/ISO_8859_1_And_US_ASCII_Common.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/ISO_8859_1_And_US_ASCII_Common.scala
index ddc83db..ddc83db 100644
--- a/library/src/main/scala/scala/scalajs/niocharset/ISO_8859_1_And_US_ASCII_Common.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/ISO_8859_1_And_US_ASCII_Common.scala
diff --git a/library/src/main/scala/scala/scalajs/niocharset/StandardCharsets.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/StandardCharsets.scala
index 38615f6..38615f6 100644
--- a/library/src/main/scala/scala/scalajs/niocharset/StandardCharsets.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/StandardCharsets.scala
diff --git a/library/src/main/scala/scala/scalajs/niocharset/US_ASCII.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/US_ASCII.scala
index 746c75b..746c75b 100644
--- a/library/src/main/scala/scala/scalajs/niocharset/US_ASCII.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/US_ASCII.scala
diff --git a/library/src/main/scala/scala/scalajs/niocharset/UTF_16.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_16.scala
index 9d1748a..9d1748a 100644
--- a/library/src/main/scala/scala/scalajs/niocharset/UTF_16.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_16.scala
diff --git a/library/src/main/scala/scala/scalajs/niocharset/UTF_16BE.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_16BE.scala
index dece191..dece191 100644
--- a/library/src/main/scala/scala/scalajs/niocharset/UTF_16BE.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_16BE.scala
diff --git a/library/src/main/scala/scala/scalajs/niocharset/UTF_16LE.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_16LE.scala
index de469c4..de469c4 100644
--- a/library/src/main/scala/scala/scalajs/niocharset/UTF_16LE.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_16LE.scala
diff --git a/library/src/main/scala/scala/scalajs/niocharset/UTF_16_Common.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_16_Common.scala
index 3330d9c..3330d9c 100644
--- a/library/src/main/scala/scala/scalajs/niocharset/UTF_16_Common.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_16_Common.scala
diff --git a/library/src/main/scala/scala/scalajs/niocharset/UTF_8.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_8.scala
index 57f4ad6..57f4ad6 100644
--- a/library/src/main/scala/scala/scalajs/niocharset/UTF_8.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/niocharset/UTF_8.scala
diff --git a/library/src/main/scala/scala/scalajs/runtime/AnonFunctions.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/AnonFunctions.scala
index 861d81a..861d81a 100644
--- a/library/src/main/scala/scala/scalajs/runtime/AnonFunctions.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/AnonFunctions.scala
diff --git a/library/src/main/scala/scala/scalajs/runtime/Bits.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/Bits.scala
index 38b2c3e..38b2c3e 100644
--- a/library/src/main/scala/scala/scalajs/runtime/Bits.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/Bits.scala
diff --git a/library/src/main/scala/scala/scalajs/runtime/BooleanReflectiveCall.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/BooleanReflectiveCall.scala
index 0cd562a..0cd562a 100644
--- a/library/src/main/scala/scala/scalajs/runtime/BooleanReflectiveCall.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/BooleanReflectiveCall.scala
diff --git a/library/src/main/scala/scala/scalajs/runtime/IntegerReflectiveCall.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/IntegerReflectiveCall.scala
index ddf65df..ddf65df 100644
--- a/library/src/main/scala/scala/scalajs/runtime/IntegerReflectiveCall.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/IntegerReflectiveCall.scala
diff --git a/library/src/main/scala/scala/scalajs/runtime/NumberReflectiveCall.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/NumberReflectiveCall.scala
index a237861..a237861 100644
--- a/library/src/main/scala/scala/scalajs/runtime/NumberReflectiveCall.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/NumberReflectiveCall.scala
diff --git a/library/src/main/scala/scala/scalajs/runtime/RuntimeLong.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/RuntimeLong.scala
index 3bd6fb6..3bd6fb6 100644
--- a/library/src/main/scala/scala/scalajs/runtime/RuntimeLong.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/RuntimeLong.scala
diff --git a/library/src/main/scala/scala/scalajs/runtime/RuntimeString.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/RuntimeString.scala
index f65b1b5..f65b1b5 100644
--- a/library/src/main/scala/scala/scalajs/runtime/RuntimeString.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/RuntimeString.scala
diff --git a/library/src/main/scala/scala/scalajs/runtime/StackTrace.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/StackTrace.scala
index a9e2c00..a9e2c00 100644
--- a/library/src/main/scala/scala/scalajs/runtime/StackTrace.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/StackTrace.scala
diff --git a/library/src/main/scala/scala/scalajs/runtime/UndefinedBehaviorError.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/UndefinedBehaviorError.scala
index b06ed7d..b06ed7d 100644
--- a/library/src/main/scala/scala/scalajs/runtime/UndefinedBehaviorError.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/UndefinedBehaviorError.scala
diff --git a/library/src/main/scala/scala/scalajs/runtime/package.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/package.scala
index 59c774c..59c774c 100644
--- a/library/src/main/scala/scala/scalajs/runtime/package.scala
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/runtime/package.scala
diff --git a/no-ir-check-test/src/test/scala/scala/scalajs/testsuite/noircheck/DummyParentsTest.scala b/examples/scala-js/no-ir-check-test/src/test/scala/scala/scalajs/testsuite/noircheck/DummyParentsTest.scala
index 30c4172..30c4172 100644
--- a/no-ir-check-test/src/test/scala/scala/scalajs/testsuite/noircheck/DummyParentsTest.scala
+++ b/examples/scala-js/no-ir-check-test/src/test/scala/scala/scalajs/testsuite/noircheck/DummyParentsTest.scala
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/BlacklistedTests.txt b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/BlacklistedTests.txt
index 241b188..241b188 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/BlacklistedTests.txt
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/BlacklistedTests.txt
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/BuglistedTests.txt b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/BuglistedTests.txt
index 42c6146..42c6146 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/BuglistedTests.txt
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/BuglistedTests.txt
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/NoDCEWarn.txt b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/NoDCEWarn.txt
index cc5aff0..cc5aff0 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/NoDCEWarn.txt
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/NoDCEWarn.txt
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/WhitelistedTests.txt b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/WhitelistedTests.txt
index c4df1ec..c4df1ec 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/WhitelistedTests.txt
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/WhitelistedTests.txt
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/neg/t7494-no-options.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/neg/t7494-no-options.check
index 581da38..581da38 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/neg/t7494-no-options.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/neg/t7494-no-options.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-01.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-01.check
index fcda943..fcda943 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-01.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-01.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-02.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-02.check
index ab75cfd..ab75cfd 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-02.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-02.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-04.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-04.check
index fc6ad96..fc6ad96 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-04.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-04.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-08.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-08.check
index 0585d5b..0585d5b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-08.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-08.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-09.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-09.check
index c921361..c921361 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-09.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-09.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-10.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-10.check
index 847f0fa..847f0fa 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-10.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/Course-2002-10.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/bugs.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/bugs.sem
index d36898b..d36898b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/bugs.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/bugs.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/dynamic-anyval.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/dynamic-anyval.check
index c125372..c125372 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/dynamic-anyval.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/dynamic-anyval.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/impconvtimes.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/impconvtimes.check
index 082377e..082377e 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/impconvtimes.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/impconvtimes.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/imports.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/imports.check
index 1aad598..1aad598 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/imports.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/imports.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/issue192.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/issue192.sem
index 10abbf7..10abbf7 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/issue192.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/issue192.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-static.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-static.check
index e2e7628..e2e7628 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-static.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-static.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-toplevel.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-toplevel.check
index e2e7628..e2e7628 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-toplevel.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-toplevel.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-whitebox-decl.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-whitebox-decl.check
index e2e7628..e2e7628 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-whitebox-decl.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/macro-bundle-whitebox-decl.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/misc.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/misc.check
index 6043817..6043817 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/misc.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/misc.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/promotion.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/promotion.check
index 41e36c3..41e36c3 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/promotion.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/promotion.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/runtime.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/runtime.check
index 0450b94..0450b94 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/runtime.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/runtime.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/spec-self.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/spec-self.check
index fd3c81a..fd3c81a 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/spec-self.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/spec-self.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/structural.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/structural.check
index 2fec112..2fec112 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/structural.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/structural.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t0421-new.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t0421-new.check
index 00d29b7..00d29b7 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t0421-new.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t0421-new.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t0421-old.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t0421-old.check
index 00d29b7..00d29b7 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t0421-old.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t0421-old.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t1503.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t1503.sem
index d36898b..d36898b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t1503.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t1503.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t3702.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t3702.check
index 3fce987..3fce987 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t3702.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t3702.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t4148.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t4148.sem
index d36898b..d36898b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t4148.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t4148.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t4617.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t4617.check
index a6790f1..a6790f1 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t4617.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t4617.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5552.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5552.check
index 4704611..4704611 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5552.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5552.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5568.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5568.check
index 6f30cc5..6f30cc5 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5568.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5568.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5629b.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5629b.check
index c65298a..c65298a 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5629b.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5629b.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5680.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5680.check
index a3b8b64..a3b8b64 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5680.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5680.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5866.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5866.check
index 64df1ce..64df1ce 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5866.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t5866.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6102.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6102.check
index 120082e..120082e 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6102.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6102.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6318_primitives.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6318_primitives.check
index 08decef..08decef 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6318_primitives.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6318_primitives.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6662.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6662.check
index 417b7b5..417b7b5 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6662.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t6662.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t7657.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t7657.check
index 1a87c1e..1a87c1e 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t7657.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t7657.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t7763.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t7763.sem
index d36898b..d36898b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t7763.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/t7763.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/try-catch-unify.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/try-catch-unify.check
index 813f011..813f011 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/try-catch-unify.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/try-catch-unify.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/virtpatmat_switch.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/virtpatmat_switch.check
index 0900a9c..0900a9c 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/virtpatmat_switch.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/virtpatmat_switch.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/virtpatmat_typetag.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/virtpatmat_typetag.check
index e95c3d0..e95c3d0 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/virtpatmat_typetag.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.0/run/virtpatmat_typetag.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/BlacklistedTests.txt b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/BlacklistedTests.txt
index 18a1c5d..18a1c5d 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/BlacklistedTests.txt
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/BlacklistedTests.txt
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/BuglistedTests.txt b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/BuglistedTests.txt
index 42c6146..42c6146 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/BuglistedTests.txt
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/BuglistedTests.txt
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/NoDCEWarn.txt b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/NoDCEWarn.txt
index cc5aff0..cc5aff0 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/NoDCEWarn.txt
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/NoDCEWarn.txt
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/WhitelistedTests.txt b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/WhitelistedTests.txt
index 1483b1e..1483b1e 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/WhitelistedTests.txt
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/WhitelistedTests.txt
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/neg/t7494-no-options.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/neg/t7494-no-options.check
index 581da38..581da38 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/neg/t7494-no-options.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/neg/t7494-no-options.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-01.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-01.check
index fcda943..fcda943 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-01.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-01.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-02.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-02.check
index ab75cfd..ab75cfd 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-02.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-02.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-04.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-04.check
index fc6ad96..fc6ad96 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-04.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-04.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-08.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-08.check
index 0585d5b..0585d5b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-08.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-08.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-09.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-09.check
index c921361..c921361 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-09.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-09.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-10.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-10.check
index 847f0fa..847f0fa 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-10.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/Course-2002-10.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/bugs.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/bugs.sem
index d36898b..d36898b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/bugs.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/bugs.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/dynamic-anyval.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/dynamic-anyval.check
index c125372..c125372 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/dynamic-anyval.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/dynamic-anyval.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/impconvtimes.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/impconvtimes.check
index 082377e..082377e 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/impconvtimes.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/impconvtimes.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/imports.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/imports.check
index 1aad598..1aad598 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/imports.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/imports.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/issue192.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/issue192.sem
index 10abbf7..10abbf7 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/issue192.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/issue192.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-static.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-static.check
index e2e7628..e2e7628 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-static.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-static.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-toplevel.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-toplevel.check
index e2e7628..e2e7628 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-toplevel.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-toplevel.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-whitebox-decl.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-whitebox-decl.check
index e2e7628..e2e7628 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-whitebox-decl.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/macro-bundle-whitebox-decl.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/misc.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/misc.check
index 6043817..6043817 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/misc.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/misc.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/promotion.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/promotion.check
index 41e36c3..41e36c3 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/promotion.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/promotion.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/runtime.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/runtime.check
index 0450b94..0450b94 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/runtime.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/runtime.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/spec-self.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/spec-self.check
index fd3c81a..fd3c81a 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/spec-self.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/spec-self.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/structural.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/structural.check
index 2fec112..2fec112 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/structural.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/structural.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t0421-new.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t0421-new.check
index 00d29b7..00d29b7 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t0421-new.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t0421-new.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t0421-old.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t0421-old.check
index 00d29b7..00d29b7 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t0421-old.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t0421-old.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t1503.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t1503.sem
index d36898b..d36898b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t1503.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t1503.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t3702.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t3702.check
index 3fce987..3fce987 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t3702.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t3702.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t4148.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t4148.sem
index d36898b..d36898b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t4148.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t4148.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t4617.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t4617.check
index a6790f1..a6790f1 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t4617.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t4617.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5552.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5552.check
index 4704611..4704611 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5552.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5552.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5568.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5568.check
index 6f30cc5..6f30cc5 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5568.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5568.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5629b.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5629b.check
index c65298a..c65298a 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5629b.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5629b.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5680.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5680.check
index a3b8b64..a3b8b64 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5680.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5680.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5866.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5866.check
index 64df1ce..64df1ce 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5866.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t5866.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6102.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6102.check
index 120082e..120082e 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6102.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6102.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6318_primitives.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6318_primitives.check
index 08decef..08decef 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6318_primitives.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6318_primitives.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6662.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6662.check
index 417b7b5..417b7b5 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6662.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t6662.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t7657.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t7657.check
index 1a87c1e..1a87c1e 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t7657.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t7657.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t7763.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t7763.sem
index d36898b..d36898b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t7763.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t7763.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t8570a.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t8570a.check
index 417b7b5..417b7b5 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t8570a.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/t8570a.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/try-catch-unify.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/try-catch-unify.check
index 813f011..813f011 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/try-catch-unify.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/try-catch-unify.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/virtpatmat_switch.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/virtpatmat_switch.check
index 0900a9c..0900a9c 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/virtpatmat_switch.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/virtpatmat_switch.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/virtpatmat_typetag.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/virtpatmat_typetag.check
index e95c3d0..e95c3d0 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/virtpatmat_typetag.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.1/run/virtpatmat_typetag.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/BlacklistedTests.txt b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/BlacklistedTests.txt
index e04dabe..e04dabe 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/BlacklistedTests.txt
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/BlacklistedTests.txt
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/BuglistedTests.txt b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/BuglistedTests.txt
index 42c6146..42c6146 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/BuglistedTests.txt
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/BuglistedTests.txt
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/NoDCEWarn.txt b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/NoDCEWarn.txt
index cc5aff0..cc5aff0 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/NoDCEWarn.txt
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/NoDCEWarn.txt
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/WhitelistedTests.txt b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/WhitelistedTests.txt
index 5538de1..5538de1 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/WhitelistedTests.txt
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/WhitelistedTests.txt
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/neg/t7494-no-options.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/neg/t7494-no-options.check
index 581da38..581da38 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/neg/t7494-no-options.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/neg/t7494-no-options.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-01.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-01.check
index fcda943..fcda943 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-01.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-01.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-02.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-02.check
index ab75cfd..ab75cfd 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-02.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-02.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-04.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-04.check
index fc6ad96..fc6ad96 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-04.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-04.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-08.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-08.check
index 0585d5b..0585d5b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-08.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-08.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-09.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-09.check
index c921361..c921361 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-09.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-09.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-10.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-10.check
index 847f0fa..847f0fa 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-10.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/Course-2002-10.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/bugs.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/bugs.sem
index d36898b..d36898b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/bugs.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/bugs.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/dynamic-anyval.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/dynamic-anyval.check
index c125372..c125372 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/dynamic-anyval.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/dynamic-anyval.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/impconvtimes.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/impconvtimes.check
index 082377e..082377e 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/impconvtimes.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/impconvtimes.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/imports.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/imports.check
index 1aad598..1aad598 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/imports.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/imports.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/issue192.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/issue192.sem
index 10abbf7..10abbf7 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/issue192.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/issue192.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-static.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-static.check
index e2e7628..e2e7628 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-static.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-static.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-toplevel.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-toplevel.check
index e2e7628..e2e7628 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-toplevel.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-toplevel.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-whitebox-decl.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-whitebox-decl.check
index e2e7628..e2e7628 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-whitebox-decl.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/macro-bundle-whitebox-decl.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/misc.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/misc.check
index 6043817..6043817 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/misc.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/misc.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/promotion.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/promotion.check
index 41e36c3..41e36c3 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/promotion.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/promotion.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/runtime.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/runtime.check
index 0450b94..0450b94 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/runtime.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/runtime.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/spec-self.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/spec-self.check
index fd3c81a..fd3c81a 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/spec-self.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/spec-self.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/structural.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/structural.check
index 2fec112..2fec112 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/structural.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/structural.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t0421-new.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t0421-new.check
index 00d29b7..00d29b7 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t0421-new.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t0421-new.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t0421-old.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t0421-old.check
index 00d29b7..00d29b7 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t0421-old.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t0421-old.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t1503.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t1503.sem
index d36898b..d36898b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t1503.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t1503.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t3702.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t3702.check
index 3fce987..3fce987 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t3702.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t3702.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t4148.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t4148.sem
index d36898b..d36898b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t4148.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t4148.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t4617.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t4617.check
index a6790f1..a6790f1 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t4617.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t4617.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5552.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5552.check
index 4704611..4704611 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5552.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5552.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5568.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5568.check
index 6f30cc5..6f30cc5 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5568.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5568.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5629b.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5629b.check
index c65298a..c65298a 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5629b.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5629b.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5680.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5680.check
index a3b8b64..a3b8b64 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5680.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5680.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5866.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5866.check
index 64df1ce..64df1ce 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5866.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t5866.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6102.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6102.check
index 120082e..120082e 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6102.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6102.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6318_primitives.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6318_primitives.check
index 654ef1b..654ef1b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6318_primitives.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6318_primitives.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6662.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6662.check
index 417b7b5..417b7b5 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6662.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t6662.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t7657.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t7657.check
index 1a87c1e..1a87c1e 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t7657.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t7657.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t7763.sem b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t7763.sem
index d36898b..d36898b 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t7763.sem
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t7763.sem
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t8570a.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t8570a.check
index 417b7b5..417b7b5 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t8570a.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/t8570a.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/try-catch-unify.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/try-catch-unify.check
index 813f011..813f011 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/try-catch-unify.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/try-catch-unify.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/virtpatmat_switch.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/virtpatmat_switch.check
index 0900a9c..0900a9c 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/virtpatmat_switch.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/virtpatmat_switch.check
diff --git a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/virtpatmat_typetag.check b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/virtpatmat_typetag.check
index 048c3ae..048c3ae 100644
--- a/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/virtpatmat_typetag.check
+++ b/examples/scala-js/partest-suite/src/test/resources/scala/tools/partest/scalajs/2.11.2/run/virtpatmat_typetag.check
diff --git a/partest/src/main/scala/scala/tools/nsc/MainGenericRunner.scala b/examples/scala-js/partest/src/main/scala/scala/tools/nsc/MainGenericRunner.scala
index 6857142..6857142 100644
--- a/partest/src/main/scala/scala/tools/nsc/MainGenericRunner.scala
+++ b/examples/scala-js/partest/src/main/scala/scala/tools/nsc/MainGenericRunner.scala
diff --git a/partest/src/main/scala/scala/tools/partest/scalajs/PartestInterface.scala b/examples/scala-js/partest/src/main/scala/scala/tools/partest/scalajs/PartestInterface.scala
index 0dc2189..0dc2189 100644
--- a/partest/src/main/scala/scala/tools/partest/scalajs/PartestInterface.scala
+++ b/examples/scala-js/partest/src/main/scala/scala/tools/partest/scalajs/PartestInterface.scala
diff --git a/partest/src/main/scala/scala/tools/partest/scalajs/ScalaJSPartest.scala b/examples/scala-js/partest/src/main/scala/scala/tools/partest/scalajs/ScalaJSPartest.scala
index edd0ea9..edd0ea9 100644
--- a/partest/src/main/scala/scala/tools/partest/scalajs/ScalaJSPartest.scala
+++ b/examples/scala-js/partest/src/main/scala/scala/tools/partest/scalajs/ScalaJSPartest.scala
diff --git a/partest/src/main/scala/scala/tools/partest/scalajs/ScalaJSPartestOptions.scala b/examples/scala-js/partest/src/main/scala/scala/tools/partest/scalajs/ScalaJSPartestOptions.scala
index 1f1680a..1f1680a 100644
--- a/partest/src/main/scala/scala/tools/partest/scalajs/ScalaJSPartestOptions.scala
+++ b/examples/scala-js/partest/src/main/scala/scala/tools/partest/scalajs/ScalaJSPartestOptions.scala
diff --git a/project/ExternalCompile.scala b/examples/scala-js/project/ExternalCompile.scala
index 7d37c81..7d37c81 100644
--- a/project/ExternalCompile.scala
+++ b/examples/scala-js/project/ExternalCompile.scala
diff --git a/project/JavaLangObject.scala b/examples/scala-js/project/JavaLangObject.scala
index ff82b94..ff82b94 100644
--- a/project/JavaLangObject.scala
+++ b/examples/scala-js/project/JavaLangObject.scala
diff --git a/project/JavaLangString.scala b/examples/scala-js/project/JavaLangString.scala
index fc68b29..fc68b29 100644
--- a/project/JavaLangString.scala
+++ b/examples/scala-js/project/JavaLangString.scala
diff --git a/project/ScalaJSBuild.scala b/examples/scala-js/project/ScalaJSBuild.scala
index 5cbc405..5cbc405 100644
--- a/project/ScalaJSBuild.scala
+++ b/examples/scala-js/project/ScalaJSBuild.scala
diff --git a/sbt-plugin-test/project/build.properties b/examples/scala-js/project/build.properties
index 64abd37..64abd37 100644
--- a/sbt-plugin-test/project/build.properties
+++ b/examples/scala-js/project/build.properties
diff --git a/examples/scala-js/project/build.sbt b/examples/scala-js/project/build.sbt
new file mode 100644
index 0000000..b110ef2
--- /dev/null
+++ b/examples/scala-js/project/build.sbt
@@ -0,0 +1,48 @@
+resolvers += Resolver.url(
+ "bintray-sbt-plugin-releases",
+ url("http://dl.bintray.com/content/sbt/sbt-plugin-releases"))(
+ Resolver.ivyStylePatterns)
+
+addSbtPlugin("me.lessis" % "bintray-sbt" % "0.1.2")
+
+addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")
+
+libraryDependencies += "com.google.javascript" % "closure-compiler" % "v20130603"
+
+libraryDependencies += "org.mozilla" % "rhino" % "1.7R4"
+
+libraryDependencies += "org.webjars" % "envjs" % "1.2"
+
+libraryDependencies += "org.eclipse.jgit" % "org.eclipse.jgit.pgm" % "3.2.0.201312181205-r"
+
+libraryDependencies += "com.googlecode.json-simple" % "json-simple" % "1.1.1"
+
+libraryDependencies += "org.eclipse.jetty" % "jetty-websocket" % "8.1.16.v20140903"
+
+libraryDependencies += "org.eclipse.jetty" % "jetty-server" % "8.1.16.v20140903"
+
+
+unmanagedSourceDirectories in Compile ++= {
+ val root = baseDirectory.value.getParentFile
+ Seq(
+ root / "ir/src/main/scala",
+ root / "tools/shared/src/main/scala",
+ root / "tools/jvm/src/main/scala",
+ root / "sbt-plugin/src/main/scala"
+ )
+}
+
+// Add the ScalaJSEnvGenerator to the build (its in the build of the build)
+sources in Compile +=
+ baseDirectory.value / "project" / "ScalaJSEnvGenerator.scala"
+
+sourceGenerators in Compile <+= Def.task {
+ ScalaJSEnvGenerator.generateEnvHolder(
+ baseDirectory.value.getParentFile / "tools",
+ (sourceManaged in Compile).value)
+}
+
+unmanagedResourceDirectories in Compile += {
+ val root = baseDirectory.value.getParentFile
+ root / "tools/src/main/resources"
+}
diff --git a/project/project/ScalaJSEnvGenerator.scala b/examples/scala-js/project/project/ScalaJSEnvGenerator.scala
index a36479f..a36479f 100644
--- a/project/project/ScalaJSEnvGenerator.scala
+++ b/examples/scala-js/project/project/ScalaJSEnvGenerator.scala
diff --git a/sbt-plugin-test/README.md b/examples/scala-js/sbt-plugin-test/README.md
index 71414a3..71414a3 100644
--- a/sbt-plugin-test/README.md
+++ b/examples/scala-js/sbt-plugin-test/README.md
diff --git a/sbt-plugin-test/build.sbt b/examples/scala-js/sbt-plugin-test/build.sbt
index dd2e12e..dd2e12e 100644
--- a/sbt-plugin-test/build.sbt
+++ b/examples/scala-js/sbt-plugin-test/build.sbt
diff --git a/sbt-plugin-test/jetty9/src/main/resources/test.txt b/examples/scala-js/sbt-plugin-test/jetty9/src/main/resources/test.txt
index 68300b8..68300b8 100644
--- a/sbt-plugin-test/jetty9/src/main/resources/test.txt
+++ b/examples/scala-js/sbt-plugin-test/jetty9/src/main/resources/test.txt
diff --git a/sbt-plugin-test/noDOM/src/main/scala/sbttest/noDOM/Lib.scala b/examples/scala-js/sbt-plugin-test/noDOM/src/main/scala/sbttest/noDOM/Lib.scala
index 884c422..884c422 100644
--- a/sbt-plugin-test/noDOM/src/main/scala/sbttest/noDOM/Lib.scala
+++ b/examples/scala-js/sbt-plugin-test/noDOM/src/main/scala/sbttest/noDOM/Lib.scala
diff --git a/sbt-plugin-test/noDOM/src/main/scala/sbttest/noDOM/TestApp.scala b/examples/scala-js/sbt-plugin-test/noDOM/src/main/scala/sbttest/noDOM/TestApp.scala
index 16a4cbe..16a4cbe 100644
--- a/sbt-plugin-test/noDOM/src/main/scala/sbttest/noDOM/TestApp.scala
+++ b/examples/scala-js/sbt-plugin-test/noDOM/src/main/scala/sbttest/noDOM/TestApp.scala
diff --git a/sbt-plugin-test/noDOM/src/test/scala/sbttest/noDOM/LibTest.scala b/examples/scala-js/sbt-plugin-test/noDOM/src/test/scala/sbttest/noDOM/LibTest.scala
index bc24eda..bc24eda 100644
--- a/sbt-plugin-test/noDOM/src/test/scala/sbttest/noDOM/LibTest.scala
+++ b/examples/scala-js/sbt-plugin-test/noDOM/src/test/scala/sbttest/noDOM/LibTest.scala
diff --git a/sbt-plugin-test/project/Jetty9Test.scala b/examples/scala-js/sbt-plugin-test/project/Jetty9Test.scala
index 6a84114..6a84114 100644
--- a/sbt-plugin-test/project/Jetty9Test.scala
+++ b/examples/scala-js/sbt-plugin-test/project/Jetty9Test.scala
diff --git a/examples/scala-js/sbt-plugin-test/project/build.properties b/examples/scala-js/sbt-plugin-test/project/build.properties
new file mode 100644
index 0000000..64abd37
--- /dev/null
+++ b/examples/scala-js/sbt-plugin-test/project/build.properties
@@ -0,0 +1 @@
+sbt.version=0.13.6
diff --git a/sbt-plugin-test/project/build.sbt b/examples/scala-js/sbt-plugin-test/project/build.sbt
index 8419289..8419289 100644
--- a/sbt-plugin-test/project/build.sbt
+++ b/examples/scala-js/sbt-plugin-test/project/build.sbt
diff --git a/sbt-plugin-test/project/project/build.sbt b/examples/scala-js/sbt-plugin-test/project/project/build.sbt
index fb20cb7..fb20cb7 100644
--- a/sbt-plugin-test/project/project/build.sbt
+++ b/examples/scala-js/sbt-plugin-test/project/project/build.sbt
diff --git a/sbt-plugin-test/withDOM/src/main/scala/sbttest/withDOM/Lib.scala b/examples/scala-js/sbt-plugin-test/withDOM/src/main/scala/sbttest/withDOM/Lib.scala
index e431557..e431557 100644
--- a/sbt-plugin-test/withDOM/src/main/scala/sbttest/withDOM/Lib.scala
+++ b/examples/scala-js/sbt-plugin-test/withDOM/src/main/scala/sbttest/withDOM/Lib.scala
diff --git a/sbt-plugin-test/withDOM/src/main/scala/sbttest/withDOM/TestApp.scala b/examples/scala-js/sbt-plugin-test/withDOM/src/main/scala/sbttest/withDOM/TestApp.scala
index e61ed20..e61ed20 100644
--- a/sbt-plugin-test/withDOM/src/main/scala/sbttest/withDOM/TestApp.scala
+++ b/examples/scala-js/sbt-plugin-test/withDOM/src/main/scala/sbttest/withDOM/TestApp.scala
diff --git a/sbt-plugin-test/withDOM/src/test/scala/sbttest/withDOM/LibTest.scala b/examples/scala-js/sbt-plugin-test/withDOM/src/test/scala/sbttest/withDOM/LibTest.scala
index e08e6e3..e08e6e3 100644
--- a/sbt-plugin-test/withDOM/src/test/scala/sbttest/withDOM/LibTest.scala
+++ b/examples/scala-js/sbt-plugin-test/withDOM/src/test/scala/sbttest/withDOM/LibTest.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/AbstractJSDeps.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/AbstractJSDeps.scala
index 9eb7f69..9eb7f69 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/AbstractJSDeps.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/AbstractJSDeps.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/Implicits.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/Implicits.scala
index 0c1559f..0c1559f 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/Implicits.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/Implicits.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/JSUtils.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/JSUtils.scala
index a59f105..a59f105 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/JSUtils.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/JSUtils.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/LoggerJSConsole.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/LoggerJSConsole.scala
index ecfb546..ecfb546 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/LoggerJSConsole.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/LoggerJSConsole.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/OptimizerOptions.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/OptimizerOptions.scala
index 25d6178..25d6178 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/OptimizerOptions.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/OptimizerOptions.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSCrossVersion.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSCrossVersion.scala
index d813622..d813622 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSCrossVersion.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSCrossVersion.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSPlugin.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSPlugin.scala
index b33e2fb..b33e2fb 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSPlugin.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSPlugin.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSPluginInternal.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSPluginInternal.scala
index fe97f0b..fe97f0b 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSPluginInternal.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/ScalaJSPluginInternal.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/Stage.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/Stage.scala
index 7f7b916..7f7b916 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/Stage.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/Stage.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/ExternalJSEnv.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/ExternalJSEnv.scala
index e0aa557..e0aa557 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/ExternalJSEnv.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/ExternalJSEnv.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/VirtualFileMaterializer.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/VirtualFileMaterializer.scala
index fca1c47..fca1c47 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/VirtualFileMaterializer.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/VirtualFileMaterializer.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/nodejs/NodeJSEnv.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/nodejs/NodeJSEnv.scala
index dfabe23..dfabe23 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/nodejs/NodeJSEnv.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/nodejs/NodeJSEnv.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/JettyWebsocketManager.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/JettyWebsocketManager.scala
index 3dec79c..3dec79c 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/JettyWebsocketManager.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/JettyWebsocketManager.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/PhantomJSEnv.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/PhantomJSEnv.scala
index 7bb47d2..7bb47d2 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/PhantomJSEnv.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/PhantomJSEnv.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/PhantomJettyClassLoader.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/PhantomJettyClassLoader.scala
index 02c229b..02c229b 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/PhantomJettyClassLoader.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/PhantomJettyClassLoader.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/WebsocketListener.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/WebsocketListener.scala
index 4faac64..4faac64 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/WebsocketListener.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/WebsocketListener.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/WebsocketManager.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/WebsocketManager.scala
index a466841..a466841 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/WebsocketManager.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/phantomjs/WebsocketManager.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/LazyScalaJSScope.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/LazyScalaJSScope.scala
index d4cdaee..d4cdaee 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/LazyScalaJSScope.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/LazyScalaJSScope.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/RhinoJSEnv.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/RhinoJSEnv.scala
index cd35ff6..cd35ff6 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/RhinoJSEnv.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/RhinoJSEnv.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/ScalaJSCoreLib.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/ScalaJSCoreLib.scala
index e937e5b..e937e5b 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/ScalaJSCoreLib.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/ScalaJSCoreLib.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/package.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/package.scala
index 926fbb2..926fbb2 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/package.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/env/rhino/package.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/impl/DependencyBuilders.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/impl/DependencyBuilders.scala
index 32ffb94..32ffb94 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/impl/DependencyBuilders.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/impl/DependencyBuilders.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/Events.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/Events.scala
index f13c195..f13c195 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/Events.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/Events.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/JSClasspathLoader.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/JSClasspathLoader.scala
index bfe0ffc..bfe0ffc 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/JSClasspathLoader.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/JSClasspathLoader.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/SbtTestLoggerAccWrapper.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/SbtTestLoggerAccWrapper.scala
index dfebe00..dfebe00 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/SbtTestLoggerAccWrapper.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/SbtTestLoggerAccWrapper.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestException.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestException.scala
index b4cb09b..b4cb09b 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestException.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestException.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestFramework.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestFramework.scala
index ab43bfe..ab43bfe 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestFramework.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestFramework.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestOutputConsole.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestOutputConsole.scala
index 9aad956..9aad956 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestOutputConsole.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestOutputConsole.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestRunner.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestRunner.scala
index e5ca2a2..e5ca2a2 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestRunner.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestRunner.scala
diff --git a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestTask.scala b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestTask.scala
index b1cabb9..b1cabb9 100644
--- a/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestTask.scala
+++ b/examples/scala-js/sbt-plugin/src/main/scala/scala/scalajs/sbtplugin/testing/TestTask.scala
diff --git a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/AsyncTests.scala b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/AsyncTests.scala
index 422c17b..422c17b 100644
--- a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/AsyncTests.scala
+++ b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/AsyncTests.scala
diff --git a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/ComTests.scala b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/ComTests.scala
index c16decd..c16decd 100644
--- a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/ComTests.scala
+++ b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/ComTests.scala
diff --git a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/JSEnvTest.scala b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/JSEnvTest.scala
index 2a44c80..2a44c80 100644
--- a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/JSEnvTest.scala
+++ b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/JSEnvTest.scala
diff --git a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/NodeJSTest.scala b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/NodeJSTest.scala
index 9a58b5c..9a58b5c 100644
--- a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/NodeJSTest.scala
+++ b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/NodeJSTest.scala
diff --git a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/PhantomJSTest.scala b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/PhantomJSTest.scala
index 23e240d..23e240d 100644
--- a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/PhantomJSTest.scala
+++ b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/PhantomJSTest.scala
diff --git a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/RhinoJSEnvTest.scala b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/RhinoJSEnvTest.scala
index 4066c41..4066c41 100644
--- a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/RhinoJSEnvTest.scala
+++ b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/RhinoJSEnvTest.scala
diff --git a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/StoreJSConsole.scala b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/StoreJSConsole.scala
index 9c7a84a..9c7a84a 100644
--- a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/StoreJSConsole.scala
+++ b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/StoreJSConsole.scala
diff --git a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/StoreLogger.scala b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/StoreLogger.scala
index 985b149..985b149 100644
--- a/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/StoreLogger.scala
+++ b/examples/scala-js/sbt-plugin/src/test/scala/scala/scalajs/sbtplugin/test/env/StoreLogger.scala
diff --git a/scalalib/overrides-2.10/scala/Console.scala b/examples/scala-js/scalalib/overrides-2.10/scala/Console.scala
index 7fc2d50..7fc2d50 100644
--- a/scalalib/overrides-2.10/scala/Console.scala
+++ b/examples/scala-js/scalalib/overrides-2.10/scala/Console.scala
diff --git a/scalalib/overrides-2.10/scala/collection/immutable/NumericRange.scala b/examples/scala-js/scalalib/overrides-2.10/scala/collection/immutable/NumericRange.scala
index d3971ee..d3971ee 100644
--- a/scalalib/overrides-2.10/scala/collection/immutable/NumericRange.scala
+++ b/examples/scala-js/scalalib/overrides-2.10/scala/collection/immutable/NumericRange.scala
diff --git a/scalalib/overrides-2.10/scala/collection/immutable/Range.scala b/examples/scala-js/scalalib/overrides-2.10/scala/collection/immutable/Range.scala
index 5c8758d..5c8758d 100644
--- a/scalalib/overrides-2.10/scala/collection/immutable/Range.scala
+++ b/examples/scala-js/scalalib/overrides-2.10/scala/collection/immutable/Range.scala
diff --git a/scalalib/overrides-2.10/scala/collection/mutable/Buffer.scala b/examples/scala-js/scalalib/overrides-2.10/scala/collection/mutable/Buffer.scala
index ec7763b..ec7763b 100644
--- a/scalalib/overrides-2.10/scala/collection/mutable/Buffer.scala
+++ b/examples/scala-js/scalalib/overrides-2.10/scala/collection/mutable/Buffer.scala
diff --git a/scalalib/overrides-2.10/scala/compat/Platform.scala b/examples/scala-js/scalalib/overrides-2.10/scala/compat/Platform.scala
index 77bf7de..77bf7de 100644
--- a/scalalib/overrides-2.10/scala/compat/Platform.scala
+++ b/examples/scala-js/scalalib/overrides-2.10/scala/compat/Platform.scala
diff --git a/scalalib/overrides-2.10/scala/package.scala b/examples/scala-js/scalalib/overrides-2.10/scala/package.scala
index 5aad9a9..5aad9a9 100644
--- a/scalalib/overrides-2.10/scala/package.scala
+++ b/examples/scala-js/scalalib/overrides-2.10/scala/package.scala
diff --git a/scalalib/overrides-2.11/scala/Console.scala b/examples/scala-js/scalalib/overrides-2.11/scala/Console.scala
index b85f8dc..b85f8dc 100644
--- a/scalalib/overrides-2.11/scala/Console.scala
+++ b/examples/scala-js/scalalib/overrides-2.11/scala/Console.scala
diff --git a/scalalib/overrides-2.11/scala/collection/immutable/NumericRange.scala b/examples/scala-js/scalalib/overrides-2.11/scala/collection/immutable/NumericRange.scala
index 51f9f68..51f9f68 100644
--- a/scalalib/overrides-2.11/scala/collection/immutable/NumericRange.scala
+++ b/examples/scala-js/scalalib/overrides-2.11/scala/collection/immutable/NumericRange.scala
diff --git a/scalalib/overrides-2.11/scala/collection/immutable/Range.scala b/examples/scala-js/scalalib/overrides-2.11/scala/collection/immutable/Range.scala
index 45eed20..45eed20 100644
--- a/scalalib/overrides-2.11/scala/collection/immutable/Range.scala
+++ b/examples/scala-js/scalalib/overrides-2.11/scala/collection/immutable/Range.scala
diff --git a/scalalib/overrides-2.11/scala/collection/mutable/Buffer.scala b/examples/scala-js/scalalib/overrides-2.11/scala/collection/mutable/Buffer.scala
index 2171cb9..2171cb9 100644
--- a/scalalib/overrides-2.11/scala/collection/mutable/Buffer.scala
+++ b/examples/scala-js/scalalib/overrides-2.11/scala/collection/mutable/Buffer.scala
diff --git a/scalalib/overrides-2.11/scala/compat/Platform.scala b/examples/scala-js/scalalib/overrides-2.11/scala/compat/Platform.scala
index cdb6916..cdb6916 100644
--- a/scalalib/overrides-2.11/scala/compat/Platform.scala
+++ b/examples/scala-js/scalalib/overrides-2.11/scala/compat/Platform.scala
diff --git a/scalalib/overrides-2.11/scala/package.scala b/examples/scala-js/scalalib/overrides-2.11/scala/package.scala
index 21051d4..21051d4 100644
--- a/scalalib/overrides-2.11/scala/package.scala
+++ b/examples/scala-js/scalalib/overrides-2.11/scala/package.scala
diff --git a/scalalib/overrides/scala/App.scala b/examples/scala-js/scalalib/overrides/scala/App.scala
index c49817b..c49817b 100644
--- a/scalalib/overrides/scala/App.scala
+++ b/examples/scala-js/scalalib/overrides/scala/App.scala
diff --git a/scalalib/overrides/scala/Enumeration.scala b/examples/scala-js/scalalib/overrides/scala/Enumeration.scala
index bdc1701..bdc1701 100644
--- a/scalalib/overrides/scala/Enumeration.scala
+++ b/examples/scala-js/scalalib/overrides/scala/Enumeration.scala
diff --git a/scalalib/overrides/scala/Symbol.scala b/examples/scala-js/scalalib/overrides/scala/Symbol.scala
index 1af9d28..1af9d28 100644
--- a/scalalib/overrides/scala/Symbol.scala
+++ b/examples/scala-js/scalalib/overrides/scala/Symbol.scala
diff --git a/scalalib/overrides/scala/concurrent/impl/AbstractPromise.scala b/examples/scala-js/scalalib/overrides/scala/concurrent/impl/AbstractPromise.scala
index 8ea135e..8ea135e 100644
--- a/scalalib/overrides/scala/concurrent/impl/AbstractPromise.scala
+++ b/examples/scala-js/scalalib/overrides/scala/concurrent/impl/AbstractPromise.scala
diff --git a/scalalib/overrides/scala/math/ScalaNumber.scala b/examples/scala-js/scalalib/overrides/scala/math/ScalaNumber.scala
index 811346d..811346d 100644
--- a/scalalib/overrides/scala/math/ScalaNumber.scala
+++ b/examples/scala-js/scalalib/overrides/scala/math/ScalaNumber.scala
diff --git a/scalalib/overrides/scala/runtime/BoxesRunTime.scala b/examples/scala-js/scalalib/overrides/scala/runtime/BoxesRunTime.scala
index 5df7fd1..5df7fd1 100644
--- a/scalalib/overrides/scala/runtime/BoxesRunTime.scala
+++ b/examples/scala-js/scalalib/overrides/scala/runtime/BoxesRunTime.scala
diff --git a/scalalib/overrides/scala/util/control/NoStackTrace.scala b/examples/scala-js/scalalib/overrides/scala/util/control/NoStackTrace.scala
index bcc2839..bcc2839 100644
--- a/scalalib/overrides/scala/util/control/NoStackTrace.scala
+++ b/examples/scala-js/scalalib/overrides/scala/util/control/NoStackTrace.scala
diff --git a/scripts/assemble-cli.sh b/examples/scala-js/scripts/assemble-cli.sh
index 8d898e8..8d898e8 100755
--- a/scripts/assemble-cli.sh
+++ b/examples/scala-js/scripts/assemble-cli.sh
diff --git a/scripts/build-all-js.sh b/examples/scala-js/scripts/build-all-js.sh
index de0e295..de0e295 100755
--- a/scripts/build-all-js.sh
+++ b/examples/scala-js/scripts/build-all-js.sh
diff --git a/scripts/publish-to-bintray.sh b/examples/scala-js/scripts/publish-to-bintray.sh
index 3b455ea..3b455ea 100755
--- a/scripts/publish-to-bintray.sh
+++ b/examples/scala-js/scripts/publish-to-bintray.sh
diff --git a/stubs/src/main/scala/scala/scalajs/js/annotation/ExportAnnotations.scala b/examples/scala-js/stubs/src/main/scala/scala/scalajs/js/annotation/ExportAnnotations.scala
index be23596..be23596 100644
--- a/stubs/src/main/scala/scala/scalajs/js/annotation/ExportAnnotations.scala
+++ b/examples/scala-js/stubs/src/main/scala/scala/scalajs/js/annotation/ExportAnnotations.scala
diff --git a/test-bridge/src/main/scala/scala/scalajs/testbridge/Test.scala b/examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/Test.scala
index 05d3077..05d3077 100644
--- a/test-bridge/src/main/scala/scala/scalajs/testbridge/Test.scala
+++ b/examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/Test.scala
diff --git a/test-bridge/src/main/scala/scala/scalajs/testbridge/TestFramework.scala b/examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/TestFramework.scala
index f855cf6..f855cf6 100644
--- a/test-bridge/src/main/scala/scala/scalajs/testbridge/TestFramework.scala
+++ b/examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/TestFramework.scala
diff --git a/test-bridge/src/main/scala/scala/scalajs/testbridge/TestOutput.scala b/examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/TestOutput.scala
index 5f3b8b6..5f3b8b6 100644
--- a/test-bridge/src/main/scala/scala/scalajs/testbridge/TestOutput.scala
+++ b/examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/TestOutput.scala
diff --git a/test-bridge/src/main/scala/scala/scalajs/testbridge/TestOutputLog.scala b/examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/TestOutputLog.scala
index 3369592..3369592 100644
--- a/test-bridge/src/main/scala/scala/scalajs/testbridge/TestOutputLog.scala
+++ b/examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/TestOutputLog.scala
diff --git a/test-bridge/src/main/scala/scala/scalajs/testbridge/internal/ConsoleTestOutput.scala b/examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/internal/ConsoleTestOutput.scala
index c89a32e..c89a32e 100644
--- a/test-bridge/src/main/scala/scala/scalajs/testbridge/internal/ConsoleTestOutput.scala
+++ b/examples/scala-js/test-bridge/src/main/scala/scala/scalajs/testbridge/internal/ConsoleTestOutput.scala
diff --git a/test-suite/run-jasmine-tests.js b/examples/scala-js/test-suite/run-jasmine-tests.js
index 03bacf1..03bacf1 100644
--- a/test-suite/run-jasmine-tests.js
+++ b/examples/scala-js/test-suite/run-jasmine-tests.js
diff --git a/test-suite/scalajs-test-suite-2.10-fastopt.html b/examples/scala-js/test-suite/scalajs-test-suite-2.10-fastopt.html
index ee06db0..ee06db0 100644
--- a/test-suite/scalajs-test-suite-2.10-fastopt.html
+++ b/examples/scala-js/test-suite/scalajs-test-suite-2.10-fastopt.html
diff --git a/test-suite/scalajs-test-suite-2.10.html b/examples/scala-js/test-suite/scalajs-test-suite-2.10.html
index 7885784..7885784 100644
--- a/test-suite/scalajs-test-suite-2.10.html
+++ b/examples/scala-js/test-suite/scalajs-test-suite-2.10.html
diff --git a/test-suite/scalajs-test-suite-2.11-fastopt.html b/examples/scala-js/test-suite/scalajs-test-suite-2.11-fastopt.html
index 5387586..5387586 100644
--- a/test-suite/scalajs-test-suite-2.11-fastopt.html
+++ b/examples/scala-js/test-suite/scalajs-test-suite-2.11-fastopt.html
diff --git a/test-suite/scalajs-test-suite-2.11.html b/examples/scala-js/test-suite/scalajs-test-suite-2.11.html
index 038ac14..038ac14 100644
--- a/test-suite/scalajs-test-suite-2.11.html
+++ b/examples/scala-js/test-suite/scalajs-test-suite-2.11.html
diff --git a/test-suite/src/test/require-sam/scala/scalajs/testsuite/jsinterop/ArraySAMTest.scala b/examples/scala-js/test-suite/src/test/require-sam/scala/scalajs/testsuite/jsinterop/ArraySAMTest.scala
index 534d203..534d203 100644
--- a/test-suite/src/test/require-sam/scala/scalajs/testsuite/jsinterop/ArraySAMTest.scala
+++ b/examples/scala-js/test-suite/src/test/require-sam/scala/scalajs/testsuite/jsinterop/ArraySAMTest.scala
diff --git a/test-suite/src/test/resources/SourceMapTestTemplate.scala b/examples/scala-js/test-suite/src/test/resources/SourceMapTestTemplate.scala
index 2b135ef..2b135ef 100644
--- a/test-suite/src/test/resources/SourceMapTestTemplate.scala
+++ b/examples/scala-js/test-suite/src/test/resources/SourceMapTestTemplate.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/BooleanTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/BooleanTest.scala
index 8343244..8343244 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/BooleanTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/BooleanTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ByteTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ByteTest.scala
index 9f48993..9f48993 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ByteTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ByteTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/CharTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/CharTest.scala
index edc2660..edc2660 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/CharTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/CharTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/FloatTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/FloatTest.scala
index 5eda04a..5eda04a 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/FloatTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/FloatTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/InstanceTestsHijackedBoxedClassesTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/InstanceTestsHijackedBoxedClassesTest.scala
index 1379b80..1379b80 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/InstanceTestsHijackedBoxedClassesTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/InstanceTestsHijackedBoxedClassesTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/IntTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/IntTest.scala
index 60f8773..60f8773 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/IntTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/IntTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/InteroperabilityTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/InteroperabilityTest.scala
index 594345a..594345a 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/InteroperabilityTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/InteroperabilityTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/LongTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/LongTest.scala
index 01d6f6e..01d6f6e 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/LongTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/LongTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/OptimizerTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/OptimizerTest.scala
index 986c25a..986c25a 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/OptimizerTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/OptimizerTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ReflectionTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ReflectionTest.scala
index 3e1d7a2..3e1d7a2 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ReflectionTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ReflectionTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ReflectiveCallTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ReflectiveCallTest.scala
index 6020a5f..6020a5f 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ReflectiveCallTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ReflectiveCallTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/RegressionTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/RegressionTest.scala
index 19cceb2..19cceb2 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/RegressionTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/RegressionTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/RuntimeTypesTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/RuntimeTypesTest.scala
index b1a32c4..b1a32c4 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/RuntimeTypesTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/RuntimeTypesTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ShortTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ShortTest.scala
index 10746ba..10746ba 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ShortTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/ShortTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/UnitTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/UnitTest.scala
index 8e2be64..8e2be64 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/UnitTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/compiler/UnitTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ArraysTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ArraysTest.scala
index d0d97f1..d0d97f1 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ArraysTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ArraysTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/AtomicTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/AtomicTest.scala
index c4f065a..c4f065a 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/AtomicTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/AtomicTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/BooleanTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/BooleanTest.scala
index 87c65e9..87c65e9 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/BooleanTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/BooleanTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ByteTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ByteTest.scala
index b033c59..b033c59 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ByteTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ByteTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/CharacterTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/CharacterTest.scala
index f206221..f206221 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/CharacterTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/CharacterTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ClassTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ClassTest.scala
index 424edd6..424edd6 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ClassTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ClassTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/DateTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/DateTest.scala
index f62f926..f62f926 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/DateTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/DateTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/DoubleTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/DoubleTest.scala
index 59c6e10..59c6e10 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/DoubleTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/DoubleTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/FloatTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/FloatTest.scala
index e45a34a..e45a34a 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/FloatTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/FloatTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/FormatterTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/FormatterTest.scala
index e7a705c..e7a705c 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/FormatterTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/FormatterTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/IntegerTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/IntegerTest.scala
index 5a01de4..5a01de4 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/IntegerTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/IntegerTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/LongTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/LongTest.scala
index 86783c3..86783c3 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/LongTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/LongTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/MathTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/MathTest.scala
index a3c887a..a3c887a 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/MathTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/MathTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/MockByteArrayOutputStream.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/MockByteArrayOutputStream.scala
index 3356a85..3356a85 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/MockByteArrayOutputStream.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/MockByteArrayOutputStream.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ObjectTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ObjectTest.scala
index 3584454..3584454 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ObjectTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ObjectTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/OutputStreamWriterTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/OutputStreamWriterTest.scala
index 7987a4c..7987a4c 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/OutputStreamWriterTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/OutputStreamWriterTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/PrintStreamTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/PrintStreamTest.scala
index 01c872b..01c872b 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/PrintStreamTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/PrintStreamTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/PrintWriterTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/PrintWriterTest.scala
index b2b3309..b2b3309 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/PrintWriterTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/PrintWriterTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/RandomTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/RandomTest.scala
index 1794d4a..1794d4a 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/RandomTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/RandomTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ReadersTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ReadersTest.scala
index f970141..f970141 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ReadersTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ReadersTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ReferenceTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ReferenceTest.scala
index cf0fd0c..cf0fd0c 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ReferenceTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ReferenceTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/RegexTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/RegexTest.scala
index a27584a..a27584a 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/RegexTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/RegexTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ShortTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ShortTest.scala
index e59f2e9..e59f2e9 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ShortTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ShortTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StackTraceElementTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StackTraceElementTest.scala
index b02a889..b02a889 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StackTraceElementTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StackTraceElementTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StreamsTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StreamsTest.scala
index 6975614..6975614 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StreamsTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StreamsTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StringBufferTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StringBufferTest.scala
index a034ce6..a034ce6 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StringBufferTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StringBufferTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StringTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StringTest.scala
index a49e521..a49e521 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StringTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/StringTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/SystemTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/SystemTest.scala
index 4435e00..4435e00 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/SystemTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/SystemTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ThrowablesTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ThrowablesTest.scala
index 7e53975..7e53975 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ThrowablesTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ThrowablesTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/TimeUnitTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/TimeUnitTest.scala
index 79cd8a8..79cd8a8 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/TimeUnitTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/TimeUnitTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/URITest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/URITest.scala
index 65a049f..65a049f 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/URITest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/URITest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/UUIDTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/UUIDTest.scala
index b22fe02..b22fe02 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/UUIDTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/UUIDTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ArrayTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ArrayTest.scala
index 2ffd6b7..2ffd6b7 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ArrayTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ArrayTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/AsyncTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/AsyncTest.scala
index e37c89e..e37c89e 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/AsyncTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/AsyncTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/DictionaryTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/DictionaryTest.scala
index 8b45395..8b45395 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/DictionaryTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/DictionaryTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/DynamicTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/DynamicTest.scala
index 2b6942f..2b6942f 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/DynamicTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/DynamicTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ExportsTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ExportsTest.scala
index d577d8d..d577d8d 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ExportsTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ExportsTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/FunctionTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/FunctionTest.scala
index 4973e64..4973e64 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/FunctionTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/FunctionTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/MiscInteropTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/MiscInteropTest.scala
index 08211c3..08211c3 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/MiscInteropTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/MiscInteropTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/RuntimeLongTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/RuntimeLongTest.scala
index 589f379..589f379 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/RuntimeLongTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/RuntimeLongTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/StrangeNamedTests.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/StrangeNamedTests.scala
index 846c80b..846c80b 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/StrangeNamedTests.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/StrangeNamedTests.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ThisFunctionTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ThisFunctionTest.scala
index 4ac9058..4ac9058 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ThisFunctionTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/ThisFunctionTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/UndefOrTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/UndefOrTest.scala
index 28eae15..28eae15 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/UndefOrTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/jsinterop/UndefOrTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/library/ArrayOpsTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/library/ArrayOpsTest.scala
index a1957a5..a1957a5 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/library/ArrayOpsTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/library/ArrayOpsTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/library/WrappedArrayTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/library/WrappedArrayTest.scala
index e4fed0a..e4fed0a 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/library/WrappedArrayTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/library/WrappedArrayTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/library/WrappedDictionaryTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/library/WrappedDictionaryTest.scala
index 3b95f55..3b95f55 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/library/WrappedDictionaryTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/library/WrappedDictionaryTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/BaseBufferTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/BaseBufferTest.scala
index a1f1b71..a1f1b71 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/BaseBufferTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/BaseBufferTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/ByteBufferTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/ByteBufferTest.scala
index 9ec831f..9ec831f 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/ByteBufferTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/ByteBufferTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/CharBufferTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/CharBufferTest.scala
index b13c478..b13c478 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/CharBufferTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niobuffer/CharBufferTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/BaseCharsetTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/BaseCharsetTest.scala
index adda838..adda838 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/BaseCharsetTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/BaseCharsetTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/CharsetTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/CharsetTest.scala
index 15b0150..15b0150 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/CharsetTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/CharsetTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/Latin1Test.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/Latin1Test.scala
index f6ddc36..f6ddc36 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/Latin1Test.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/Latin1Test.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/USASCIITest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/USASCIITest.scala
index 2352d3e..2352d3e 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/USASCIITest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/USASCIITest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/UTF16Test.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/UTF16Test.scala
index 85d4eff..85d4eff 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/UTF16Test.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/UTF16Test.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/UTF8Test.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/UTF8Test.scala
index fbb6a9c..fbb6a9c 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/UTF8Test.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/niocharset/UTF8Test.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/EnumerationTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/EnumerationTest.scala
index f5b17d9..f5b17d9 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/EnumerationTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/EnumerationTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/RangesTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/RangesTest.scala
index 511e183..511e183 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/RangesTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/RangesTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/SymbolTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/SymbolTest.scala
index 3612629..3612629 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/SymbolTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/scalalib/SymbolTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArrayBufferInputStreamTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArrayBufferInputStreamTest.scala
index 7c49d0c..7c49d0c 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArrayBufferInputStreamTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArrayBufferInputStreamTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArrayBufferTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArrayBufferTest.scala
index 9e64c7f..9e64c7f 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArrayBufferTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArrayBufferTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArraysTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArraysTest.scala
index 1976f3f..1976f3f 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArraysTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/ArraysTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/DataViewTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/DataViewTest.scala
index 76c5639..76c5639 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/DataViewTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/DataViewTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/TypedArrayConversionTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/TypedArrayConversionTest.scala
index dc9a056..dc9a056 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/TypedArrayConversionTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/TypedArrayConversionTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/TypedArrayTest.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/TypedArrayTest.scala
index 1dfbbd4..1dfbbd4 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/TypedArrayTest.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/typedarray/TypedArrayTest.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/utils/JSUtils.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/utils/JSUtils.scala
index 4b2ac62..4b2ac62 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/utils/JSUtils.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/utils/JSUtils.scala
diff --git a/test-suite/src/test/scala/scala/scalajs/testsuite/utils/TestDetector.scala b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/utils/TestDetector.scala
index ad67a95..ad67a95 100644
--- a/test-suite/src/test/scala/scala/scalajs/testsuite/utils/TestDetector.scala
+++ b/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/utils/TestDetector.scala
diff --git a/tools/js/src/main/scala/scala/scalajs/tools/classpath/builder/NodeFileSystem.scala b/examples/scala-js/tools/js/src/main/scala/scala/scalajs/tools/classpath/builder/NodeFileSystem.scala
index d1eee10..d1eee10 100644
--- a/tools/js/src/main/scala/scala/scalajs/tools/classpath/builder/NodeFileSystem.scala
+++ b/examples/scala-js/tools/js/src/main/scala/scala/scalajs/tools/classpath/builder/NodeFileSystem.scala
diff --git a/tools/js/src/main/scala/scala/scalajs/tools/io/NodeVirtualFiles.scala b/examples/scala-js/tools/js/src/main/scala/scala/scalajs/tools/io/NodeVirtualFiles.scala
index 6a0c3ee..6a0c3ee 100644
--- a/tools/js/src/main/scala/scala/scalajs/tools/io/NodeVirtualFiles.scala
+++ b/examples/scala-js/tools/js/src/main/scala/scala/scalajs/tools/io/NodeVirtualFiles.scala
diff --git a/tools/js/src/main/scala/scala/scalajs/tools/json/Impl.scala b/examples/scala-js/tools/js/src/main/scala/scala/scalajs/tools/json/Impl.scala
index 89c7255..89c7255 100644
--- a/tools/js/src/main/scala/scala/scalajs/tools/json/Impl.scala
+++ b/examples/scala-js/tools/js/src/main/scala/scala/scalajs/tools/json/Impl.scala
diff --git a/tools/js/src/test/scala/scala/scalajs/tools/js/test/JasmineReporter.scala b/examples/scala-js/tools/js/src/test/scala/scala/scalajs/tools/js/test/JasmineReporter.scala
index 7b63871..7b63871 100644
--- a/tools/js/src/test/scala/scala/scalajs/tools/js/test/JasmineReporter.scala
+++ b/examples/scala-js/tools/js/src/test/scala/scala/scalajs/tools/js/test/JasmineReporter.scala
diff --git a/tools/js/src/test/scala/scala/scalajs/tools/js/test/QuickLinker.scala b/examples/scala-js/tools/js/src/test/scala/scala/scalajs/tools/js/test/QuickLinker.scala
index 580c4c5..580c4c5 100644
--- a/tools/js/src/test/scala/scala/scalajs/tools/js/test/QuickLinker.scala
+++ b/examples/scala-js/tools/js/src/test/scala/scala/scalajs/tools/js/test/QuickLinker.scala
diff --git a/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/JarLibClasspathBuilder.scala b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/JarLibClasspathBuilder.scala
index 5bc488c..5bc488c 100644
--- a/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/JarLibClasspathBuilder.scala
+++ b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/JarLibClasspathBuilder.scala
diff --git a/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/PartialClasspathBuilder.scala b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/PartialClasspathBuilder.scala
index 626c74c..626c74c 100644
--- a/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/PartialClasspathBuilder.scala
+++ b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/PartialClasspathBuilder.scala
diff --git a/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/PhysicalFileSystem.scala b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/PhysicalFileSystem.scala
index a0dd7a5..a0dd7a5 100644
--- a/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/PhysicalFileSystem.scala
+++ b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/classpath/builder/PhysicalFileSystem.scala
diff --git a/tools/jvm/src/main/scala/scala/scalajs/tools/io/FileVirtualFiles.scala b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/io/FileVirtualFiles.scala
index da29225..da29225 100644
--- a/tools/jvm/src/main/scala/scala/scalajs/tools/io/FileVirtualFiles.scala
+++ b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/io/FileVirtualFiles.scala
diff --git a/tools/jvm/src/main/scala/scala/scalajs/tools/json/Impl.scala b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/json/Impl.scala
index ea847e3..ea847e3 100644
--- a/tools/jvm/src/main/scala/scala/scalajs/tools/json/Impl.scala
+++ b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/json/Impl.scala
diff --git a/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ClosureAstBuilder.scala b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ClosureAstBuilder.scala
index 8d2eb2b..8d2eb2b 100644
--- a/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ClosureAstBuilder.scala
+++ b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ClosureAstBuilder.scala
diff --git a/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ClosureAstTransformer.scala b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ClosureAstTransformer.scala
index af22501..af22501 100644
--- a/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ClosureAstTransformer.scala
+++ b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ClosureAstTransformer.scala
diff --git a/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ConcurrencyUtils.scala b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ConcurrencyUtils.scala
index 471ed65..471ed65 100644
--- a/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ConcurrencyUtils.scala
+++ b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ConcurrencyUtils.scala
diff --git a/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/LoggerErrorManager.scala b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/LoggerErrorManager.scala
index d51dd7b..d51dd7b 100644
--- a/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/LoggerErrorManager.scala
+++ b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/LoggerErrorManager.scala
diff --git a/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ParIncOptimizer.scala b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ParIncOptimizer.scala
index 422238e..422238e 100644
--- a/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ParIncOptimizer.scala
+++ b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ParIncOptimizer.scala
diff --git a/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ScalaJSClosureOptimizer.scala b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ScalaJSClosureOptimizer.scala
index 146b2b8..146b2b8 100644
--- a/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ScalaJSClosureOptimizer.scala
+++ b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/optimizer/ScalaJSClosureOptimizer.scala
diff --git a/tools/jvm/src/main/scala/scala/scalajs/tools/sourcemap/SourceMapper.scala b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/sourcemap/SourceMapper.scala
index 6f856a9..6f856a9 100644
--- a/tools/jvm/src/main/scala/scala/scalajs/tools/sourcemap/SourceMapper.scala
+++ b/examples/scala-js/tools/jvm/src/main/scala/scala/scalajs/tools/sourcemap/SourceMapper.scala
diff --git a/tools/jvm/src/test/resources/test.jar b/examples/scala-js/tools/jvm/src/test/resources/test.jar
index e69de29..e69de29 100644
--- a/tools/jvm/src/test/resources/test.jar
+++ b/examples/scala-js/tools/jvm/src/test/resources/test.jar
diff --git a/tools/jvm/src/test/scala/scala/scalajs/tools/classpath/builder/test/ClasspathElementsTraverserTest.scala b/examples/scala-js/tools/jvm/src/test/scala/scala/scalajs/tools/classpath/builder/test/ClasspathElementsTraverserTest.scala
index 72d01e4..72d01e4 100644
--- a/tools/jvm/src/test/scala/scala/scalajs/tools/classpath/builder/test/ClasspathElementsTraverserTest.scala
+++ b/examples/scala-js/tools/jvm/src/test/scala/scala/scalajs/tools/classpath/builder/test/ClasspathElementsTraverserTest.scala
diff --git a/tools/jvm/src/test/scala/scala/scalajs/tools/classpath/builder/test/JarBuilderTest.scala b/examples/scala-js/tools/jvm/src/test/scala/scala/scalajs/tools/classpath/builder/test/JarBuilderTest.scala
index 6ed68fc..6ed68fc 100644
--- a/tools/jvm/src/test/scala/scala/scalajs/tools/classpath/builder/test/JarBuilderTest.scala
+++ b/examples/scala-js/tools/jvm/src/test/scala/scala/scalajs/tools/classpath/builder/test/JarBuilderTest.scala
diff --git a/tools/scalajsenv.js b/examples/scala-js/tools/scalajsenv.js
index 01a84ba..01a84ba 100644
--- a/tools/scalajsenv.js
+++ b/examples/scala-js/tools/scalajsenv.js
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/CompleteClasspath.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/CompleteClasspath.scala
index 6646a7b..6646a7b 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/CompleteClasspath.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/CompleteClasspath.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/ComplianceRequirement.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/ComplianceRequirement.scala
index f6ec36f..f6ec36f 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/ComplianceRequirement.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/ComplianceRequirement.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/Exceptions.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/Exceptions.scala
index 62bf75f..62bf75f 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/Exceptions.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/Exceptions.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/IRClasspath.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/IRClasspath.scala
index a92293b..a92293b 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/IRClasspath.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/IRClasspath.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/LinkedClasspath.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/LinkedClasspath.scala
index 3ace785..3ace785 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/LinkedClasspath.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/LinkedClasspath.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/PartialClasspath.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/PartialClasspath.scala
index 949cd6e..949cd6e 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/PartialClasspath.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/PartialClasspath.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/ResolvedJSDependency.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/ResolvedJSDependency.scala
index 12ae8dc..12ae8dc 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/ResolvedJSDependency.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/ResolvedJSDependency.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/AbstractJarLibClasspathBuilder.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/AbstractJarLibClasspathBuilder.scala
index 77f8509..77f8509 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/AbstractJarLibClasspathBuilder.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/AbstractJarLibClasspathBuilder.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/AbstractPartialClasspathBuilder.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/AbstractPartialClasspathBuilder.scala
index 9889f4c..9889f4c 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/AbstractPartialClasspathBuilder.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/AbstractPartialClasspathBuilder.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/ClasspathContentHandler.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/ClasspathContentHandler.scala
index 71106c2..71106c2 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/ClasspathContentHandler.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/ClasspathContentHandler.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/ClasspathElementsTraverser.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/ClasspathElementsTraverser.scala
index 9403ce3..9403ce3 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/ClasspathElementsTraverser.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/ClasspathElementsTraverser.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/DirTraverser.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/DirTraverser.scala
index 6609b29..6609b29 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/DirTraverser.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/DirTraverser.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/FileSystem.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/FileSystem.scala
index 99a8ca2..99a8ca2 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/FileSystem.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/FileSystem.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/JarTraverser.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/JarTraverser.scala
index bbf5270..bbf5270 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/JarTraverser.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/classpath/builder/JarTraverser.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/corelib/CoreJSLibs.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/corelib/CoreJSLibs.scala
index ecbea1f..ecbea1f 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/corelib/CoreJSLibs.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/corelib/CoreJSLibs.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/env/AsyncJSEnv.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/AsyncJSEnv.scala
index d439ae2..d439ae2 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/env/AsyncJSEnv.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/AsyncJSEnv.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/env/AsyncJSRunner.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/AsyncJSRunner.scala
index 09e2dda..09e2dda 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/env/AsyncJSRunner.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/AsyncJSRunner.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/env/ComJSEnv.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/ComJSEnv.scala
index 882e46a..882e46a 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/env/ComJSEnv.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/ComJSEnv.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/env/ComJSRunner.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/ComJSRunner.scala
index 44302b8..44302b8 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/env/ComJSRunner.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/ComJSRunner.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/env/ConsoleJSConsole.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/ConsoleJSConsole.scala
index 5b3d055..5b3d055 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/env/ConsoleJSConsole.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/ConsoleJSConsole.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/env/JSConsole.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/JSConsole.scala
index a93768f..a93768f 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/env/JSConsole.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/JSConsole.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/env/JSEnv.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/JSEnv.scala
index f1fbf44..f1fbf44 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/env/JSEnv.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/JSEnv.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/env/JSRunner.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/JSRunner.scala
index 460fff0..460fff0 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/env/JSRunner.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/JSRunner.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/env/NullJSConsole.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/NullJSConsole.scala
index 8147bbe..8147bbe 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/env/NullJSConsole.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/env/NullJSConsole.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/io/CacheUtils.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/io/CacheUtils.scala
index 14773f8..14773f8 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/io/CacheUtils.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/io/CacheUtils.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/io/IO.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/io/IO.scala
index b69b07c..b69b07c 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/io/IO.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/io/IO.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/io/MemFiles.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/io/MemFiles.scala
index 68f66dc..68f66dc 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/io/MemFiles.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/io/MemFiles.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/io/VirtualFiles.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/io/VirtualFiles.scala
index c62ab5c..c62ab5c 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/io/VirtualFiles.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/io/VirtualFiles.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/javascript/JSDesugaring.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/JSDesugaring.scala
index b4d4005..b4d4005 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/javascript/JSDesugaring.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/JSDesugaring.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/javascript/LongImpl.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/LongImpl.scala
index 70b81a3..70b81a3 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/javascript/LongImpl.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/LongImpl.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/javascript/Printers.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/Printers.scala
index 264c548..264c548 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/javascript/Printers.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/Printers.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/javascript/ScalaJSClassEmitter.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/ScalaJSClassEmitter.scala
index b249f88..b249f88 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/javascript/ScalaJSClassEmitter.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/ScalaJSClassEmitter.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/javascript/TreeDSL.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/TreeDSL.scala
index 3ac54d8..3ac54d8 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/javascript/TreeDSL.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/TreeDSL.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/javascript/Trees.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/Trees.scala
index 0b86d1b..0b86d1b 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/javascript/Trees.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/javascript/Trees.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/Exceptions.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/Exceptions.scala
index dd7f635..dd7f635 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/Exceptions.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/Exceptions.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/FlatJSDependency.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/FlatJSDependency.scala
index 0c55e88..0c55e88 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/FlatJSDependency.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/FlatJSDependency.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/JSDependency.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/JSDependency.scala
index 2e6f8d1..2e6f8d1 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/JSDependency.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/JSDependency.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/JSDependencyManifest.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/JSDependencyManifest.scala
index 24491b4..24491b4 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/JSDependencyManifest.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/JSDependencyManifest.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/Origin.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/Origin.scala
index a2c6b2d..a2c6b2d 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/Origin.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/Origin.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/ResolutionInfo.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/ResolutionInfo.scala
index 2aa177e..2aa177e 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/ResolutionInfo.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/jsdep/ResolutionInfo.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/json/AbstractJSONImpl.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/AbstractJSONImpl.scala
index ad5d79e..ad5d79e 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/json/AbstractJSONImpl.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/AbstractJSONImpl.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONDeserializer.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONDeserializer.scala
index e854e9a..e854e9a 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONDeserializer.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONDeserializer.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONObjBuilder.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONObjBuilder.scala
index dd98f49..dd98f49 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONObjBuilder.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONObjBuilder.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONObjExtractor.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONObjExtractor.scala
index e49f7e4..e49f7e4 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONObjExtractor.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONObjExtractor.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONSerializer.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONSerializer.scala
index e26c92a..e26c92a 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONSerializer.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/JSONSerializer.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/json/package.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/package.scala
index 551893a..551893a 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/json/package.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/json/package.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/logging/Level.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/logging/Level.scala
index fbbf39d..fbbf39d 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/logging/Level.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/logging/Level.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/logging/Logger.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/logging/Logger.scala
index 3664f51..3664f51 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/logging/Logger.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/logging/Logger.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/logging/NullLogger.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/logging/NullLogger.scala
index 0e36f89..0e36f89 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/logging/NullLogger.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/logging/NullLogger.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/logging/ScalaConsoleLogger.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/logging/ScalaConsoleLogger.scala
index e2c9efc..e2c9efc 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/logging/ScalaConsoleLogger.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/logging/ScalaConsoleLogger.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/Analyzer.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/Analyzer.scala
index 9cdd764..9cdd764 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/Analyzer.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/Analyzer.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/GenIncOptimizer.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/GenIncOptimizer.scala
index 47e1f87..47e1f87 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/GenIncOptimizer.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/GenIncOptimizer.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/IRChecker.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/IRChecker.scala
index 6329826..6329826 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/IRChecker.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/IRChecker.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/IncOptimizer.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/IncOptimizer.scala
index d115618..d115618 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/IncOptimizer.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/IncOptimizer.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/JSTreeBuilder.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/JSTreeBuilder.scala
index 3d37a56..3d37a56 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/JSTreeBuilder.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/JSTreeBuilder.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/OptimizerCore.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/OptimizerCore.scala
index 364038b..364038b 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/OptimizerCore.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/OptimizerCore.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/ScalaJSOptimizer.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/ScalaJSOptimizer.scala
index 646484b..646484b 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/ScalaJSOptimizer.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/optimizer/ScalaJSOptimizer.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/sem/CheckedBehavior.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/sem/CheckedBehavior.scala
index 4668b3c..4668b3c 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/sem/CheckedBehavior.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/sem/CheckedBehavior.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/sem/Semantics.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/sem/Semantics.scala
index 9d17b06..9d17b06 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/sem/Semantics.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/sem/Semantics.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/sourcemap/JSFileBuilder.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/sourcemap/JSFileBuilder.scala
index 1bf2254..1bf2254 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/sourcemap/JSFileBuilder.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/sourcemap/JSFileBuilder.scala
diff --git a/tools/shared/src/main/scala/scala/scalajs/tools/sourcemap/SourceMapWriter.scala b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/sourcemap/SourceMapWriter.scala
index 5d8bdb1..5d8bdb1 100644
--- a/tools/shared/src/main/scala/scala/scalajs/tools/sourcemap/SourceMapWriter.scala
+++ b/examples/scala-js/tools/shared/src/main/scala/scala/scalajs/tools/sourcemap/SourceMapWriter.scala
diff --git a/examples/workbench-example-app/.gitignore b/examples/workbench-example-app/.gitignore
new file mode 100644
index 0000000..c41cff3
--- /dev/null
+++ b/examples/workbench-example-app/.gitignore
@@ -0,0 +1,5 @@
+target/
+.cache
+.classpath
+.project
+.settings/
diff --git a/examples/workbench-example-app/README.md b/examples/workbench-example-app/README.md
new file mode 100644
index 0000000..d674f09
--- /dev/null
+++ b/examples/workbench-example-app/README.md
@@ -0,0 +1,39 @@
+# Example Scala.js application
+
+This is a slightly less barebone example of an application written in
+[Scala.js](http://www.scala-js.org/). In particular, it links
+in libraries that are indispensible in being productive working with Scala.js.
+
+## Get started
+
+To get started, run `sbt ~fastOptJS` in this example project. This should
+download dependencies and prepare the relevant javascript files. If you open
+`localhost:12345/target/scala-2.11/classes/index-dev.html` in your browser, it will show you an animated [Sierpinski
+triangle](http://en.wikipedia.org/wiki/Sierpinski_triangle) ([live demo](http://lihaoyi.github.io/workbench-example-app/triangle.html)). You can then
+edit the application and see the updates be sent live to the browser
+without needing to refresh the page.
+
+## The optimized version
+
+Run `sbt fullOptJS` and open up `index-opt.html` for an optimized (~200kb) version
+of the final application, useful for final publication.
+
+## Dodge the Dots
+
+Take a look at the `dodge-the-dots` branch in the git repository if you
+want to see a slightly more complex application that was made in 30 minutes
+using this skeleton. Similar steps can be used for development or
+publication. There's a live demo [here](http://lihaoyi.github.io/workbench-example-app/dodge.html).
+
+## Space Invaders
+
+There's also a `space-invaders` branch, also made in 30 minutes, with its own
+[live demo](http://lihaoyi.github.io/workbench-example-app/invaders.html).
+
+## TodoMVC
+
+The `todomvc` branch contains an implementation of the [TodoMVC example application](http://todomvc.com/), which is used to compare how the exact same application would be implemented using different languages and frameworks. This application makes heavy use of [Scalatags](https://github.com/lihaoyi/scalatags) and [Scala.Rx](https://github.com/lihaoyi/scala.rx), with heavy use of the DOM via [scala-js-dom](https://github.com/scala-js/scala-js-dom), making it a good example of how reactive web pages could be built using ScalaJS, as well as use of standalone ScalaJS libraries.
+
+## Ray Tracer
+
+The `ray-tracer` branch contains a simple ray-tracer written using Scala.js, with a [live demo](http://lihaoyi.github.io/workbench-example-app/raytracer.html).
diff --git a/examples/workbench-example-app/build.sbt b/examples/workbench-example-app/build.sbt
new file mode 100644
index 0000000..4f7e197
--- /dev/null
+++ b/examples/workbench-example-app/build.sbt
@@ -0,0 +1,21 @@
+import scala.scalajs.sbtplugin.ScalaJSPlugin._
+import com.lihaoyi.workbench.Plugin._
+
+scalaJSSettings
+
+workbenchSettings
+
+name := "Example"
+
+version := "0.1-SNAPSHOT"
+
+scalaVersion := "2.11.2"
+
+libraryDependencies ++= Seq(
+ "org.scala-lang.modules.scalajs" %%% "scalajs-dom" % "0.6"
+)
+
+bootSnippet := "ScalaJSExample().main(document.getElementById('canvas'));"
+
+updateBrowsers <<= updateBrowsers.triggeredBy(ScalaJSKeys.fastOptJS in Compile)
+
diff --git a/examples/workbench-example-app/project/build.properties b/examples/workbench-example-app/project/build.properties
new file mode 100644
index 0000000..0974fce
--- /dev/null
+++ b/examples/workbench-example-app/project/build.properties
@@ -0,0 +1 @@
+sbt.version=0.13.0
diff --git a/examples/workbench-example-app/project/build.sbt b/examples/workbench-example-app/project/build.sbt
new file mode 100644
index 0000000..7ed0b3e
--- /dev/null
+++ b/examples/workbench-example-app/project/build.sbt
@@ -0,0 +1,3 @@
+addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.5")
+
+addSbtPlugin("com.lihaoyi" % "workbench" % "0.2.3")
diff --git a/examples/workbench-example-app/src/main/resources/index-dev.html b/examples/workbench-example-app/src/main/resources/index-dev.html
new file mode 100644
index 0000000..3c03bc1
--- /dev/null
+++ b/examples/workbench-example-app/src/main/resources/index-dev.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Example Scala.js application</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+</head>
+<body style="margin: 0px">
+
+<div>
+ <canvas style="display: block" id="canvas" width="255" height="255"/>
+</div>
+
+<script type="text/javascript" src="../example-fastopt.js"></script>
+<script type="text/javascript" src="/workbench.js"></script>
+<script>
+ ScalaJSExample().main(document.getElementById('canvas'));
+</script>
+</body>
+</html>
diff --git a/examples/workbench-example-app/src/main/resources/index-opt.html b/examples/workbench-example-app/src/main/resources/index-opt.html
new file mode 100644
index 0000000..4f1f784
--- /dev/null
+++ b/examples/workbench-example-app/src/main/resources/index-opt.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Example Scala.js application</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+</head>
+<body style="margin: 0px">
+
+<div>
+ <canvas style="display: block" id="canvas" width="255" height="255"/>
+</div>
+
+<script type="text/javascript" src="../example-opt.js"></script>
+<script>
+ ScalaJSExample().main(document.getElementById('canvas'));
+</script>
+</body>
+</html>
diff --git a/examples/workbench-example-app/src/main/scala/example/ScalaJSExample.scala b/examples/workbench-example-app/src/main/scala/example/ScalaJSExample.scala
new file mode 100644
index 0000000..e7e5326
--- /dev/null
+++ b/examples/workbench-example-app/src/main/scala/example/ScalaJSExample.scala
@@ -0,0 +1,43 @@
+package example
+import scala.scalajs.js.annotation.JSExport
+import org.scalajs.dom
+import scala.util.Random
+
+case class Point(x: Int, y: Int){
+ def +(p: Point) = Point(x + p.x, y + p.y)
+ def /(d: Int) = Point(x / d, y / d)
+}
+
+@JSExport
+object ScalaJSExample {
+ @JSExport
+ def main(canvas: dom.HTMLCanvasElement): Unit = {
+ val ctx = canvas.getContext("2d")
+ .asInstanceOf[dom.CanvasRenderingContext2D]
+
+ var count = 0
+ var p = Point(0, 0)
+ val corners = Seq(Point(255, 255), Point(0, 255), Point(128, 0))
+
+ def clear() = {
+ ctx.fillStyle = "black"
+ ctx.fillRect(0, 0, 255, 255)
+ }
+
+ def run = for (i <- 0 until 10){
+ if (count % 3000 == 0) clear()
+ count += 1
+ p = (p + corners(Random.nextInt(3))) / 2
+
+ val height = 512.0 / (255 + p.y)
+ val r = (p.x * height).toInt
+ val g = ((255-p.x) * height).toInt
+ val b = p.y
+ ctx.fillStyle = s"rgb($g, $r, $b)"
+
+ ctx.fillRect(p.x, p.y, 1, 1)
+ }
+
+ dom.setInterval(() => run, 50)
+ }
+}
diff --git a/project/build.properties b/project/build.properties
index 64abd37..be6c454 100644
--- a/project/build.properties
+++ b/project/build.properties
@@ -1 +1 @@
-sbt.version=0.13.6
+sbt.version=0.13.5
diff --git a/project/build.sbt b/project/build.sbt
index b110ef2..1fbce95 100644
--- a/project/build.sbt
+++ b/project/build.sbt
@@ -1,48 +1,3 @@
-resolvers += Resolver.url(
- "bintray-sbt-plugin-releases",
- url("http://dl.bintray.com/content/sbt/sbt-plugin-releases"))(
- Resolver.ivyStylePatterns)
+addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.5")
-addSbtPlugin("me.lessis" % "bintray-sbt" % "0.1.2")
-
-addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")
-
-libraryDependencies += "com.google.javascript" % "closure-compiler" % "v20130603"
-
-libraryDependencies += "org.mozilla" % "rhino" % "1.7R4"
-
-libraryDependencies += "org.webjars" % "envjs" % "1.2"
-
-libraryDependencies += "org.eclipse.jgit" % "org.eclipse.jgit.pgm" % "3.2.0.201312181205-r"
-
-libraryDependencies += "com.googlecode.json-simple" % "json-simple" % "1.1.1"
-
-libraryDependencies += "org.eclipse.jetty" % "jetty-websocket" % "8.1.16.v20140903"
-
-libraryDependencies += "org.eclipse.jetty" % "jetty-server" % "8.1.16.v20140903"
-
-
-unmanagedSourceDirectories in Compile ++= {
- val root = baseDirectory.value.getParentFile
- Seq(
- root / "ir/src/main/scala",
- root / "tools/shared/src/main/scala",
- root / "tools/jvm/src/main/scala",
- root / "sbt-plugin/src/main/scala"
- )
-}
-
-// Add the ScalaJSEnvGenerator to the build (its in the build of the build)
-sources in Compile +=
- baseDirectory.value / "project" / "ScalaJSEnvGenerator.scala"
-
-sourceGenerators in Compile <+= Def.task {
- ScalaJSEnvGenerator.generateEnvHolder(
- baseDirectory.value.getParentFile / "tools",
- (sourceManaged in Compile).value)
-}
-
-unmanagedResourceDirectories in Compile += {
- val root = baseDirectory.value.getParentFile
- root / "tools/src/main/resources"
-}
+addSbtPlugin("com.lihaoyi" % "utest-js-plugin" % "0.2.4")
diff --git a/scalaParser/src/main/scala/scalaParser/ScalaSyntax.scala b/scalaParser/src/main/scala/scalaParser/ScalaSyntax.scala
new file mode 100644
index 0000000..de9f039
--- /dev/null
+++ b/scalaParser/src/main/scala/scalaParser/ScalaSyntax.scala
@@ -0,0 +1,416 @@
+package scalaParser
+import acyclic.file
+import language.implicitConversions
+import syntax._
+import org.parboiled2._
+
+/**
+ * Parser for Scala syntax.
+ *
+ * The `G` parameter that gets passed in to each rule stands for
+ * "Greedy", and determines whether or not that rule is to consume
+ * newlines after the last terminal in that rule. We need to pass it
+ * everywhere so it can go all the way to the last terminal deep
+ * inside the parse tree, which can then decide whether or not to
+ * consume whitespace.
+ *
+ * The vast majority of terminals will consume newlines; only rules
+ * which occur in {} blocks won't have their terminals consume newlines,
+ * and only the *last* terminal in the rule will be affected.
+ * That's why the parser does terminals-consume-newlines-by-default,
+ * and leaves it up to the dev to thread the `G` variable where-ever
+ * we want the opposite behavior.
+ */
+class ScalaSyntax(val input: ParserInput) extends Parser with Basic with Identifiers with Literals {
+ // Aliases for common things. These things are used in almost every parser
+ // in the file, so it makes sense to keep them short.
+ type B = Boolean
+ val t = true
+ type R0 = Rule0
+ /**
+ * Parses all whitespace, excluding newlines. This is only
+ * really useful in e.g. {} blocks, where we want to avoid
+ * capturing newlines so semicolon-inference would work
+ */
+ def WS = rule { zeroOrMore(Basic.WhitespaceChar | Literals.Comment) }
+
+ /**
+ * Parses whitespace, including newlines.
+ * This is the default for most things
+ */
+ def WL = rule{ zeroOrMore(Basic.WhitespaceChar | Literals.Comment | Basic.Newline) }
+
+
+
+ /**
+ * By default, all strings and characters greedily
+ * capture all whitespace immediately after the token.
+ */
+ implicit private[this] def wspStr(s: String): R0 = rule { WL ~ str(s) }
+ implicit private[this] def wspChar(s: Char): R0 = rule { WL ~ ch(s) }
+
+ /**
+ * Most keywords don't just require the correct characters to match,
+ * they have to ensure that subsequent characters *don't* match in
+ * order for it to be a keyword. This enforces that rule for key-words
+ * (W) and key-operators (O) which have different non-match criteria.
+ */
+ object K {
+ def W(s: String) = rule {
+ WL ~ Key.W(s)
+ }
+
+ def O(s: String) = rule {
+ WL ~ Key.O(s)
+ }
+ }
+
+
+ def pos = cursor -> cursorChar
+
+ /**
+ * helper printing function
+ */
+ def pr(s: String) = rule { run(println(s"LOGGING $cursor: $s")) }
+
+ def Id = rule { WL ~ Identifiers.Id }
+ def VarId = rule { WL ~ Identifiers.VarId }
+ def Literal = rule { WL ~ Literals.Literal }
+ def Semi = rule { WS ~ Basic.Semi }
+ def Semis = rule { oneOrMore(Semi) }
+ def Newline = rule { WL ~ Basic.Newline }
+
+ def QualId = rule { WL ~ oneOrMore(Id).separatedBy('.') }
+ def Ids = rule { oneOrMore(Id) separatedBy ',' }
+
+ def Path: R0 = rule {
+ zeroOrMore(Id ~ '.') ~ K.W("this") ~ zeroOrMore(Id).separatedBy('.') |
+ StableId
+ }
+ def StableId: R0 = rule {
+ zeroOrMore(Id ~ '.') ~ (K.W("this") | K.W("super") ~ optional(ClassQualifier)) ~ '.' ~ oneOrMore(Id).separatedBy('.') |
+ Id ~ zeroOrMore(WL ~ '.' ~ WL ~ Id)
+ }
+
+ def ClassQualifier = rule { '[' ~ Id ~ ']' }
+
+ def Type: R0 = rule {
+ FunctionArgTypes ~ K.O("=>") ~ Type | InfixType ~ optional(WL ~ ExistentialClause)
+ }
+ def FunctionArgTypes = rule {
+ InfixType | '(' ~ optional(oneOrMore(ParamType) separatedBy ',') ~ ')'
+ }
+
+ def ExistentialClause = rule { "forSome" ~ '{' ~ oneOrMore(ExistentialDcl).separatedBy(Semi) }
+ def ExistentialDcl = rule { K.W("type") ~ TypeDcl | K.W("val") ~ ValDcl }
+
+ def InfixType = rule {
+ CompoundType ~ zeroOrMore(WL ~ Id ~ optional(Newline) ~ CompoundType)
+ }
+ def CompoundType = rule {
+ oneOrMore(AnnotType).separatedBy(WL ~ K.W("with")) ~ optional(Refinement)
+ }
+ def AnnotType = rule {
+ SimpleType ~ zeroOrMore(WL ~ Annotation)
+ }
+ def SimpleType: R0 = rule {
+ BasicType ~
+ optional(WL ~ '#' ~ Id) ~
+ optional(WL ~ TypeArgs)
+ }
+ def BasicType: R0 = rule {
+ '(' ~ Types ~ ')' |
+ Path ~ '.' ~ K.W("type") |
+ StableId
+ }
+ def TypeArgs = rule { '[' ~ Types ~ "]" }
+ def Types = rule { oneOrMore(Type).separatedBy(',') }
+ def Refinement = rule {
+ optional(Newline) ~ '{' ~ oneOrMore(RefineStat).separatedBy(Semi) ~ "}"
+ }
+ def RefineStat = rule { "type" ~ TypeDef | Dcl | MATCH }
+ def TypePat = rule { CompoundType }
+ def Ascription = rule {
+ ":" ~ ("_" ~ "*" | InfixType | oneOrMore(Annotation))
+ }
+
+ def ParamType = rule { K.O("=>") ~ Type | Type ~ "*" | Type }
+
+ def Expr: R0 = rule {
+ (Bindings | optional(K.W("implicit")) ~ Id | "_") ~ K.O("=>") ~ Expr |
+ Expr1
+ }
+ def Expr1: R0 = rule {
+ IfCFlow |
+ WhileCFlow |
+ TryCFlow |
+ DoWhileCFlow |
+ ForCFlow |
+ K.W("throw") ~ Expr |
+ K.W("return") ~ optional(Expr) |
+ SimpleExpr ~ K.O("=") ~ Expr |
+ PostfixExpr ~ optional("match" ~ '{' ~ CaseClauses ~ "}" | Ascription)
+
+ }
+ def IfCFlow = rule { "if" ~ '(' ~ Expr ~ ')' ~ zeroOrMore(Newline) ~ Expr ~ optional(optional(Semi) ~ K.W("else") ~ Expr) }
+ def WhileCFlow = rule { "while" ~ '(' ~ Expr ~ ')' ~ zeroOrMore(Newline) ~ Expr }
+ def TryCFlow = rule {
+ K.W("try") ~ Expr ~
+ optional(WL ~ K.W("catch") ~ Expr) ~
+ optional(WL ~ K.W("finally") ~ Expr)
+ }
+
+ def DoWhileCFlow = rule { K.W("do") ~ Expr ~ optional(Semi) ~ "while" ~ '(' ~ Expr ~ ")" }
+ def ForCFlow = rule {
+ "for" ~
+ ('(' ~ Enumerators ~ ')' | '{' ~ Enumerators ~ '}') ~
+ zeroOrMore(Newline) ~
+ optional(K.W("yield")) ~
+ Expr }
+ def NotNewline: R0 = rule{ &( WS ~ noneOf("\n") )}
+ def PostfixExpr: R0 = rule { InfixExpr ~ optional(NotNewline ~ Id ~ optional(Newline)) }
+ def InfixExpr: R0 = rule {
+ PrefixExpr ~
+ zeroOrMore(
+ NotNewline ~
+ Id ~
+ optional(Newline) ~
+ PrefixExpr
+ )
+ }
+ def PrefixExpr = rule { optional(WL ~ anyOf("-+~!")) ~ SimpleExpr }
+
+ def SimpleExpr: R0 = rule {
+ SimpleExpr1 ~
+ zeroOrMore(WL ~ ('.' ~ Id | TypeArgs | ArgumentExprs)) ~
+ optional(WL ~ "_")
+ }
+
+ def SimpleExpr1 = rule{
+ K.W("new") ~ (ClassTemplate | TemplateBody) |
+ BlockExpr |
+ Literal |
+ Path |
+ K.W("_") |
+ '(' ~ optional(Exprs) ~ ")"
+ }
+
+
+
+ def Exprs: R0 = rule { oneOrMore(Expr).separatedBy(',') }
+ def ArgumentExprs: R0 = rule {
+ '(' ~ optional(Exprs ~ optional(K.O(":") ~ K.W("_") ~ '*')) ~ ")" |
+ optional(Newline) ~ BlockExpr
+ }
+
+ def BlockExpr: R0 = rule { '{' ~ (CaseClauses | Block) ~ "}" }
+ def BlockEnd: R0 = rule{ optional(Semis) ~ &("}" | "case") }
+ def Block: R0 = rule {
+ optional(Semis) ~
+ (
+ BlockStats ~ optional(Semis ~ ResultExpr) ~ BlockEnd |
+ ResultExpr ~ BlockEnd |
+ MATCH ~ BlockEnd
+ )
+ }
+ def BlockStats: R0 = rule{
+ oneOrMore(BlockStat).separatedBy(Semis)
+ }
+ def BlockStat: R0 = rule {
+ Import |
+ zeroOrMore(Annotation) ~ (optional(K.W("implicit") | K.W("lazy")) ~ Def | zeroOrMore(LocalModifier) ~ TmplDef) |
+ Expr1
+ }
+ def ResultExpr: R0 = rule {
+ (Bindings | optional(K.W("implicit")) ~ Id | "_") ~ K.W("=>") ~ Block | Expr1
+ }
+ def Enumerators: R0 = rule { Generator ~ zeroOrMore(Semi ~ Enumerator) ~ WL }
+ def Enumerator: R0 = rule { Generator | Guard | Pattern1 ~ K.O("=") ~ Expr }
+ def Generator: R0 = rule { Pattern1 ~ K.O("<-") ~ Expr ~ optional(WL ~ Guard) }
+ def CaseClauses: R0 = rule { oneOrMore(CaseClause) }
+ def CaseClause: R0 = rule { K.W("case") ~ Pattern ~ optional(Guard) ~ K.O("=>") ~ Block }
+ def Guard: R0 = rule { K.W("if") ~ PostfixExpr }
+ def Pattern: R0 = rule {
+ oneOrMore(Pattern1).separatedBy('|')
+ }
+ def Pattern1: R0 = rule {
+ K.W("_") ~ K.O(":") ~ TypePat | VarId ~ K.O(":") ~ TypePat | Pattern2
+ }
+ def Pattern2: R0 = rule {
+ VarId ~ "@" ~ Pattern3 | Pattern3 | VarId
+ }
+ def Pattern3: R0 = rule {
+ SimplePattern ~ zeroOrMore(Id ~ SimplePattern)
+ }
+ def SimplePattern: R0 = rule {
+ K.W("_") |
+ Literal |
+ '(' ~ optional(Patterns) ~ ')' |
+ (
+ StableId ~
+ optional(
+ '(' ~
+ (optional(Patterns ~ ',') ~ optional(VarId ~ '@') ~ K.W("_") ~ '*' | optional(Patterns)) ~
+ ')'
+ )
+ ) |
+ VarId
+ }
+ def Patterns: R0 = rule { K.W("_") ~ '*' | oneOrMore(Pattern).separatedBy(',') }
+
+ def TypeParamClause: R0 = rule { '[' ~ oneOrMore(VariantTypeParam).separatedBy(',') ~ ']' }
+ def FunTypeParamClause: R0 = rule { '[' ~ oneOrMore(TypeParam).separatedBy(',') ~ ']' }
+ def VariantTypeParam: R0 = rule { zeroOrMore(Annotation) ~ optional(anyOf("+-")) ~ TypeParam }
+ def TypeParam: R0 = rule {
+ (Id | K.W("_")) ~
+ optional(TypeParamClause) ~
+ optional(K.O(">:") ~ Type) ~
+ optional(K.O("<:") ~ Type) ~
+ zeroOrMore(K.O("<%") ~ Type) ~
+ zeroOrMore(K.O(":") ~ Type)
+ }
+ def ParamClauses: R0 = rule { zeroOrMore(ParamClause) ~ optional(optional(Newline) ~ '(' ~ K.W("implicit") ~ Params ~ ')') }
+ def ParamClause: R0 = rule { optional(Newline) ~ '(' ~ optional(Params) ~ ')' }
+ def Params: R0 = rule { zeroOrMore(Param).separatedBy(',') }
+ def Param: R0 = rule { zeroOrMore(Annotation) ~ Id ~ optional(K.O(":") ~ ParamType) ~ optional(K.O("=") ~ Expr) }
+ def ClassParamClauses: R0 = rule { zeroOrMore(ClassParamClause) ~ optional(optional(Newline) ~ '(' ~ K.W("implicit") ~ ClassParam ~ ")") }
+ def ClassParamClause: R0 = rule { optional(Newline) ~ '(' ~ optional(ClassParams) ~ ")" }
+ def ClassParams: R0 = rule { oneOrMore(ClassParam).separatedBy(',') }
+ def ClassParam: R0 = rule { zeroOrMore(Annotation) ~ optional(zeroOrMore(Modifier) ~ (K.W("val") | K.W("var"))) ~ Id ~ K.O(":") ~ ParamType ~ optional(K.O("=") ~ Expr) }
+
+ def Bindings: R0 = rule { '(' ~ zeroOrMore(Binding).separatedBy(',') ~ ')' }
+ def Binding: R0 = rule { (Id | K.W("_")) ~ optional(K.O(":") ~ Type) }
+
+ def Modifier: R0 = rule { LocalModifier | AccessModifier | K.W("override") }
+ def LocalModifier: R0 = rule { K.W("abstract") | K.W("final") | K.W("sealed") | K.W("implicit") | K.W("lazy") }
+ def AccessModifier: R0 = rule { (K.W("private") | K.W("protected")) ~ optional(AccessQualifier) }
+ def AccessQualifier: R0 = rule { '[' ~ (K.W("this") | Id) ~ ']' }
+
+ def Annotation: R0 = rule { '@' ~ SimpleType ~ zeroOrMore(WL ~ ArgumentExprs) }
+ def ConstrAnnotation: R0 = rule { '@' ~ SimpleType ~ ArgumentExprs }
+
+ def TemplateBody: R0 = rule {
+ '{' ~
+ optional(SelfType) ~
+ zeroOrMore(TemplateStat).separatedBy(Semis) ~
+ '}'
+ }
+ def TemplateStat: R0 = rule {
+ Import |
+ zeroOrMore(Annotation ~ optional(Newline)) ~ zeroOrMore(Modifier) ~ (Def | Dcl) |
+ Expr
+ }
+
+ def SelfType: R0 = rule { K.W("this") ~ K.O(":") ~ Type ~ K.O("=>") | Id ~ optional(K.O(":") ~ Type) ~ K.O("=>") }
+
+ def Import: R0 = rule { K.W("import") ~ oneOrMore(ImportExpr).separatedBy(',') }
+
+ def ImportExpr: R0 = rule {
+ StableId ~ optional('.' ~ ("_" | ImportSelectors))
+ }
+ def ImportSelectors: R0 = rule { '{' ~ zeroOrMore(ImportSelector ~ ',') ~ (ImportSelector | K.W("_")) ~ "}" }
+ def ImportSelector: R0 = rule { Id ~ optional(K.O("=>") ~ (Id | K.W("_"))) }
+
+ def Dcl: R0 = rule {
+ K.W("val") ~ ValDcl |
+ K.W("var") ~ VarDcl |
+ K.W("def") ~ FunDcl |
+ K.W("type") ~ zeroOrMore(Newline) ~ TypeDcl
+ }
+ def ValDcl: R0 = rule { Ids ~ K.O(":") ~ Type }
+ def VarDcl: R0 = rule { Ids ~ K.O(":") ~ Type }
+ def FunDcl: R0 = rule { FunSig ~ optional(WL ~ K.O(":") ~ Type) }
+ def FunSig: R0 = rule { Id ~ optional(FunTypeParamClause) ~ ParamClauses }
+ def TypeDcl: R0 = rule {
+ Id ~
+ optional(WL ~ TypeParamClause) ~
+ optional(WL ~ K.O(">:") ~ Type) ~
+ optional(WL ~ K.O("<:") ~ Type)
+ }
+
+ def PatVarDef: R0 = rule { K.W("val") ~ PatDef | K.W("var") ~ VarDef }
+ def Def: R0 = rule { K.W("def") ~ FunDef | K.W("type") ~ zeroOrMore(Newline) ~ TypeDef | PatVarDef | TmplDef }
+ def PatDef: R0 = rule { oneOrMore(Pattern2).separatedBy(',') ~ optional(K.O(":") ~ Type) ~ K.O("=") ~ Expr }
+ def VarDef: R0 = rule { Ids ~ K.O(":") ~ Type ~ K.O("=") ~ K.W("_") | PatDef }
+ def FunDef: R0 = rule {
+ K.W("this") ~ ParamClause ~ ParamClauses ~ (K.O("=") ~ ConstrExpr | optional(Newline) ~ ConstrBlock) |
+ FunSig ~
+ (
+ optional(K.O(":") ~ Type) ~ K.O("=") ~ optional(K.W("macro")) ~ Expr |
+ optional(Newline) ~ '{' ~ Block ~ "}"
+ )
+ }
+ def TypeDef: R0 = rule { Id ~ optional(TypeParamClause) ~ K.O("=") ~ Type }
+
+ def TmplDef: R0 = rule {
+ K.W("trait") ~ TraitDef |
+ optional(K.W("case")) ~ (K.W("class") ~ ClassDef |
+ K.W("object") ~ ObjectDef)
+ }
+ def ClassDef: R0 = rule {
+ Id ~
+ optional(TypeParamClause) ~
+ zeroOrMore(ConstrAnnotation) ~
+ optional(AccessModifier) ~
+ ClassParamClauses ~
+ ClassTemplateOpt
+ }
+ def TraitDef: R0 = rule { Id ~ optional(TypeParamClause) ~ TraitTemplateOpt }
+ def ObjectDef: R0 = rule { Id ~ ClassTemplateOpt }
+ def ClassTemplateOpt: R0 = rule {
+ WL ~ K.W("extends") ~ ClassTemplate |
+ optional(WL ~ optional(K.W("extends")) ~ TemplateBody)
+ }
+ def TraitTemplateOpt: R0 = rule { K.W("extends") ~ TraitTemplate | optional(optional(K.W("extends")) ~ TemplateBody) }
+ def ClassTemplate: R0 = rule {
+ optional(EarlyDefs) ~
+ ClassParents ~
+ optional(WL ~ TemplateBody)
+ }
+
+ def TraitTemplate: R0 = rule {
+ optional(EarlyDefs) ~ TraitParents ~ optional(TemplateBody)
+ }
+ def ClassParents: R0 = rule {
+ Constr ~ zeroOrMore(WL ~ K.W("with") ~ AnnotType)
+ }
+ def TraitParents: R0 = rule {
+ AnnotType ~ zeroOrMore(WL ~ K.W("with") ~ AnnotType)
+ }
+ def Constr: R0 = rule {
+ AnnotType ~ zeroOrMore(WL ~ ArgumentExprs)
+ }
+ def EarlyDefs: R0 = rule {
+ '{' ~ optional(oneOrMore(EarlyDef).separatedBy(Semis)) ~ '}' ~ K.W("with")
+ }
+ def EarlyDef: R0 = rule {
+ zeroOrMore(Annotation ~ optional(Newline)) ~ zeroOrMore(Modifier) ~ PatVarDef
+ }
+ def ConstrExpr: R0 = rule { ConstrBlock | SelfInvocation }
+ def ConstrBlock: R0 = rule { '{' ~ SelfInvocation ~ zeroOrMore(Semis ~ BlockStat) ~ '}' }
+ def SelfInvocation: R0 = rule { K.W("this") ~ oneOrMore(ArgumentExprs) }
+
+ def TopStatSeq: R0 = rule { oneOrMore(TopStat).separatedBy(Semis) }
+ def TopStat: R0 = rule {
+ Packaging |
+ PackageObject |
+ Import |
+ zeroOrMore(Annotation ~ optional(Newline)) ~ zeroOrMore(Modifier) ~ TmplDef
+ }
+ def Packaging: R0 = rule { K.W("package") ~ QualId ~ '{' ~ TopStatSeq ~ '}' }
+ def PackageObject: R0 = rule { K.W("package") ~ K.W("object") ~ ObjectDef }
+ def TopPackageSeq: R0 = rule{
+ oneOrMore(K.W("package") ~ QualId).separatedBy(Semis)
+ }
+ def CompilationUnit: Rule1[String] = rule {
+ capture(
+ pr("CompulationUnit 0") ~
+ optional(Semis) ~
+ pr("CompulationUnit 1") ~
+ (TopPackageSeq ~ optional(Semis ~ TopStatSeq) | TopStatSeq) ~
+ optional(Semis) ~
+ WL
+
+ )
+ }
+}
diff --git a/scalaParser/src/main/scala/scalaParser/syntax/Basic.scala b/scalaParser/src/main/scala/scalaParser/syntax/Basic.scala
new file mode 100644
index 0000000..8d3232a
--- /dev/null
+++ b/scalaParser/src/main/scala/scalaParser/syntax/Basic.scala
@@ -0,0 +1,51 @@
+package scalaParser
+package syntax
+import acyclic.file
+import org.parboiled2._
+
+trait Basic { self: Parser =>
+ object Basic{
+ def UnicodeExcape = rule { "\\u" ~ 4.times(HexDigit) }
+
+
+ //Numbers and digits
+ def HexDigit = rule { Digit | "a" - "f" | "A" - "Z" }
+ def Digit = rule { "0" | NonZeroDigit }
+ def NonZeroDigit = rule { "1" - "9" }
+ def HexNumeral = rule { "0x" ~ oneOrMore(HexDigit) }
+ def DecimalNumeral = rule(oneOrMore(Digit))
+ def ExponentPart = rule { anyOf("Ee") ~ optional(anyOf("+-")) ~ oneOrMore(Digit) }
+ def FloatType = rule { anyOf("FfDd") }
+
+ def Parentheses = rule { "(" | ")" | "[" | "]" | "{" | "}" }
+ def DelimiterChar = rule { "'" | "\"" | "." | ";" | "," }
+
+ def WhitespaceChar = rule { "\u0020" | "\u0009" }
+ def Newline = rule { "\r\n" | "\n" }
+ def Semi = rule { ';' | oneOrMore(Newline) }
+ def OperatorChar = rule {
+ anyOf("""!#$%&*+-/:<=>?@\^|~""") |
+ CharPredicate.from(_.getType match {
+ case Character.OTHER_SYMBOL | Character.MATH_SYMBOL => true; case _ => false
+ })
+ }
+ def Letter = rule { Upper | Lower | CharPredicate.from(c => c.isLetter | c.isDigit) }
+ def Lower = rule { "a" - "z" | "$" | "_" | CharPredicate.from(_.isLower) }
+ def Upper = rule { "A" - "Z" | CharPredicate.from(_.isUpper) }
+ }
+ /**
+ * Most keywords don't just require the correct characters to match,
+ * they have to ensure that subsequent characters *don't* match in
+ * order for it to be a keyword. This enforces that rule for key-words
+ * (W) and key-operators (O) which have different non-match criteria.
+ */
+ object Key {
+ def W(s: String) = rule {
+ str(s) ~ !(Basic.Letter | Basic.Digit)
+ }
+
+ def O(s: String) = rule {
+ str(s) ~ !Basic.OperatorChar
+ }
+ }
+}
diff --git a/scalaParser/src/main/scala/scalaParser/syntax/Identifiers.scala b/scalaParser/src/main/scala/scalaParser/syntax/Identifiers.scala
new file mode 100644
index 0000000..4bc972f
--- /dev/null
+++ b/scalaParser/src/main/scala/scalaParser/syntax/Identifiers.scala
@@ -0,0 +1,35 @@
+package scalaParser
+package syntax
+import acyclic.file
+import org.parboiled2._
+
+trait Identifiers { self: Parser with Basic =>
+ object Identifiers{
+ import Basic._
+ def Operator = rule(oneOrMore(OperatorChar))
+
+ def VarId = rule {
+ !(Keywords ~ (WhitespaceChar | Newline | "//" | "/*")) ~ Lower ~ IdRest
+ }
+ def PlainId = rule { Upper ~ IdRest | VarId | !(Keywords ~ (WhitespaceChar | Newline | "//" | "/*")) ~ Operator }
+ def Id = rule { PlainId | ("`" ~ oneOrMore(noneOf("`")) ~ "`") }
+ def IdRest = rule {
+ zeroOrMore(zeroOrMore("_") ~ oneOrMore(!"_" ~ Letter | Digit)) ~
+ optional(oneOrMore("_") ~ optional(Operator))
+ }
+
+
+ def AlphabetKeywords = rule {
+ "abstract" | "case" | "catch" | "class" | "def" | "do" | "else" | "extends" | "false" | "finally" | "final" | "finally" | "forSome" | "for" | "if" |
+ "implicit" | "import" | "lazy" | "match" | "new" | "null" | "object" | "override" | "package" | "private" | "protected" | "return" |
+ "sealed" | "super" | "this" | "throw" | "trait" | "try" | "true" | "type" | "val" | "var" | "while" | "with" | "yield" | "_"
+ }
+ def SymbolicKeywords = rule{
+ ":" | ";" | "=>" | "=" | "<-" | "<:" | "<%" | ">:" | "#" | "@" | "\u21d2" | "\u2190"
+ }
+ def Keywords = rule {
+ AlphabetKeywords ~ !Letter | SymbolicKeywords ~ !OperatorChar
+
+ }
+ }
+}
diff --git a/scalaParser/src/main/scala/scalaParser/syntax/Literals.scala b/scalaParser/src/main/scala/scalaParser/syntax/Literals.scala
new file mode 100644
index 0000000..9fd9d5b
--- /dev/null
+++ b/scalaParser/src/main/scala/scalaParser/syntax/Literals.scala
@@ -0,0 +1,58 @@
+package scalaParser
+package syntax
+import acyclic.file
+import org.parboiled2._
+
+trait Literals { self: Parser with Basic with Identifiers =>
+ object Literals{
+ import Basic._
+ def FloatingPointLiteral = rule {
+
+ "." ~ oneOrMore(Digit) ~ optional(ExponentPart) ~ optional(FloatType) |
+ oneOrMore(Digit) ~ (
+ "." ~ oneOrMore(Digit) ~ optional(ExponentPart) ~ optional(FloatType) |
+ ExponentPart ~ optional(FloatType) |
+ optional(ExponentPart) ~ FloatType
+ )
+ }
+
+ def IntegerLiteral = rule { (DecimalNumeral | HexNumeral) ~ optional(anyOf("Ll")) }
+
+ def BooleanLiteral = rule { Key.W("true") | Key.W("false") }
+
+ def MultilineComment: Rule0 = rule { "/*" ~ zeroOrMore(MultilineComment | !"*/" ~ ANY) ~ "*/" }
+ def Comment: Rule0 = rule {
+ MultilineComment |
+ "//" ~ zeroOrMore(!Basic.Newline ~ ANY) ~ &(Basic.Newline | EOI)
+ }
+
+ def Literal = rule {
+ (optional("-") ~ (FloatingPointLiteral | IntegerLiteral)) |
+ BooleanLiteral |
+ CharacterLiteral |
+ StringLiteral |
+ SymbolLiteral |
+ (Key.W("null") ~ !(Basic.Letter | Basic.Digit))
+ }
+
+
+ def EscapedChars = rule { '\\' ~ anyOf("rnt\\\"") }
+
+ // Note that symbols can take on the same values as keywords!
+ def SymbolLiteral = rule { ''' ~ (Identifiers.PlainId | Identifiers.Keywords) }
+
+ def CharacterLiteral = rule { ''' ~ (UnicodeExcape | EscapedChars | !'\\' ~ CharPredicate.from(isPrintableChar)) ~ ''' }
+
+ def MultiLineChars = rule { zeroOrMore(optional('"') ~ optional('"') ~ noneOf("\"")) }
+ def StringLiteral = rule {
+ (optional(Identifiers.Id) ~ "\"\"\"" ~ MultiLineChars ~ ("\"\"\"" ~ zeroOrMore('"'))) |
+ (optional(Identifiers.Id) ~ '"' ~ zeroOrMore("\\\"" | noneOf("\n\"")) ~ '"')
+ }
+
+ def isPrintableChar(c: Char): Boolean = {
+ val block = Character.UnicodeBlock.of(c)
+ !Character.isISOControl(c) && !Character.isSurrogate(c) && block != null && block != Character.UnicodeBlock.SPECIALS
+ }
+ }
+}
+
diff --git a/scalaParser/src/test/scala/scalaParser/SyntaxTest.scala b/scalaParser/src/test/scala/scalaParser/SyntaxTest.scala
new file mode 100644
index 0000000..fe5fc2c
--- /dev/null
+++ b/scalaParser/src/test/scala/scalaParser/SyntaxTest.scala
@@ -0,0 +1,448 @@
+package scalaParser
+
+import org.parboiled2.ParseError
+import utest._
+import utest.framework.Test
+import utest.util.Tree
+
+import scala.util.{Failure, Success}
+
+object SyntaxTest extends TestSuite{
+ def check[T](input: String) = {
+ println("Checking...")
+ new ScalaSyntax(input).CompilationUnit.run() match{
+ case Failure(f: ParseError) =>
+ println(f.position)
+ println(f.formatExpectedAsString)
+ println(f.formatTraces)
+ throw new Exception(f.position + "\t" + f.formatTraces)
+ case Success(parsed) =>
+ assert(parsed == input)
+ }
+ }
+ println("running")
+ def tests = TestSuite{
+ 'unit {
+ * - check(
+ "package torimatomeru"
+
+ )
+ * - check(
+ """package torimatomeru
+ |
+ |package lols
+ """.stripMargin
+ )
+ * - check(
+ """package torimatomeru
+ |import a
+ |import b
+ """.stripMargin
+ )
+ * - check(
+ """
+ |package torimatomeru
+ |
+ |import org.parboiled2.ParseError
+ |import utest._
+ |import utest.framework.Test
+ |import utest.util.Tree
+ |
+ |import scala.util.{Failure, Success}
+ |
+ |object SyntaxTest extends TestSuite
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object SyntaxTest extends TestSuite{
+ | def check[T](input: String) = {
+ |
+ | }
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object SyntaxTest{
+ | a()
+ | throw 1
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object SyntaxTest extends TestSuite{
+ | {
+ | println
+ | throw 1
+ | }
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """package scalatex
+ |
+ |
+ |import org.parboiled2._
+ |import torimatomeru.ScalaSyntax
+ |
+ |import scalatex.stages.{Trim, Parser, Ast}
+ |import scalatex.stages.Ast.Block.{IfElse, For, Text}
+ |import Ast.Chain.Args
+ |
+ |object ParserTests extends utest.TestSuite{
+ | import Ast._
+ | import utest._
+ | def check[T](input: String, parse: Parser => scala.util.Try[T], expected: T) = {
+ | val parsed = parse(new Parser(input)).get
+ | assert(parsed == expected)
+ | }
+ | def tests = TestSuite{}
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object Moo{
+ | a
+ | .b
+ |
+ | c
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object Moo{
+ | filename
+ | .asInstanceOf[Literal]
+ |10
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object Cow{
+ | ().mkString
+ |
+ | 1
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object O{
+ | private[this] val applyMacroFull = 1
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object O{
+ | private[this] def applyMacroFull(c: Context)
+ | (expr: c.Expr[String],
+ | runtimeErrors: Boolean,
+ | debug: Boolean)
+ | : c.Expr[Frag] = {
+ | }
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object O{
+ | class DebugFailure extends Exception
+ |
+ | 1
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |package torimatomeru
+ |
+ |package syntax
+ |
+ |import org.parboiled2._
+ |
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object Foo{
+ | 0 match {
+ | case A | B => 0
+ | }
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object Compiler{
+ |
+ | def apply = {
+ | def rec = t match {
+ | case 0 => 0
+ | }
+ |
+ | rec(tree)
+ | }
+ |}
+ |
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object O {
+ | A(A(A(A(A(A(A(A())))))))
+ |}
+ |
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object O{
+ | A(A(A(A(A(A(A(A(A(A(A(A(A(A(A(A())))))))))))))))
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object L{
+ | a.b = c
+ | a().b = c
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object L{
+ | a b c
+ | d = 1
+ |}
+ """.stripMargin
+ )
+
+ * - check(
+ """/* __ *\
+ |** ________ ___ / / ___ __ ____ Scala.js CLI **
+ |** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2014, LAMP/EPFL **
+ |** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-js.org/ **
+ |** /____/\___/_/ |_/____/_/ | |__/ /____/ **
+ |** |/____/ **
+ |\* */
+ |
+ |package scala.scalajs.cli
+ |
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object O{
+ | for {
+ | a <- b
+ | c <- d
+ | } {
+ | 1
+ | }
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object O{
+ | val jarFile =
+ | try { 1 }
+ | catch { case _: F => G }
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object F{
+ | func{ case _: F => fail }
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object Foo{
+ | val a = d // g
+ | val b = e // h
+ | val c = f
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object L{
+ | x match{
+ | case y.Y(z) => z
+ | }
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """object K{
+ | val a: B {
+ | val c: D
+ | }
+ |
+ | 1
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object LOLS{
+ | def run() {}
+ |
+ | def apply() {}
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object O{
+ | a =:= b.c
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object K{
+ | a(
+ | 1: _*
+ | )
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object P{
+ | tree match {
+ | case stats :+ expr => 1
+ | }
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object K{
+ | val trueA = 1
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object K{
+ | val nullo :: cow = 1
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object K{
+ | val omg_+ = 1
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object K{
+ | val + = 1
+ | var * = 2
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |object O{
+ | c match {
+ | case b_ => 1
+ | }
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |trait Basic {
+ | b match {
+ | case C => true; case _ => false
+ | }
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """trait Basic {
+ | !a.b
+ |}
+ """.stripMargin
+ )
+ * - check(
+ """
+ |class Parser {
+ | {() => }
+ |}
+ |
+ """.stripMargin
+ )
+ * - check(
+ """
+ |
+ |
+ |
+ |package omg
+ |;
+ |
+ |;
+ |
+ |;
+ |class Parser
+ |;
+ |
+ |;
+ |
+ |;
+ """.stripMargin
+ )
+ }
+ def checkFile(path: String) = check(io.Source.fromFile(path).mkString)
+ 'file{
+
+ * - checkFile("test.txt")
+ * - checkFile("scalaParser/src/main/scala/scalaParser/syntax/Basic.scala")
+ * - checkFile("scalaParser/src/main/scala/scalaParser/syntax/Identifiers.scala")
+ * - checkFile("scalaParser/src/main/scala/scalaParser/syntax/Literals.scala")
+ * - checkFile("scalaParser/src/main/scala/scalaParser/ScalaSyntax.scala")
+
+ * - checkFile("scalaParser/src/test/scala/scalaParser/SyntaxTest.scala")
+
+
+ * - checkFile("scalatexApi/src/main/scala/scalatex/stages/Compiler.scala")
+ * - checkFile("scalatexApi/src/main/scala/scalatex/stages/Parser.scala")
+ * - checkFile("scalatexApi/src/main/scala/scalatex/stages/Trim.scala")
+ * - checkFile("scalatexApi/src/main/scala/scalatex/package.scala")
+
+ * - checkFile("scalatexApi/src/test/scala/scalatex/ParserTests.scala")
+ * - checkFile("scalatexApi/src/test/scala/scalatex/BasicTests.scala")
+ * - checkFile("scalatexApi/src/test/scala/scalatex/ErrorTests.scala")
+ * - checkFile("scalatexApi/src/test/scala/scalatex/TestUtil.scala")
+
+ * - checkFile("scalatexPlugin/src/main/scala/scalatex/ScalaTexPlugin.scala")
+ }
+
+// 'omg{
+// val root = new java.io.File("../scala-js/")
+// def listFiles(s: java.io.File): Iterator[String] = {
+// val (dirs, files) = s.listFiles().toIterator.partition(_.isDirectory)
+// files.map(_.getPath) ++ dirs.flatMap(listFiles)
+// }
+// for(f <- listFiles(root).filter(_.endsWith(".scala"))){
+// println("CHECKING " + f)
+// checkFile(f)
+// }
+// }
+ }
+} \ No newline at end of file
diff --git a/scalatexApi/src/main/scala/scalatex/package.scala b/scalatexApi/src/main/scala/scalatex/package.scala
new file mode 100644
index 0000000..1f13e63
--- /dev/null
+++ b/scalatexApi/src/main/scala/scalatex/package.scala
@@ -0,0 +1,98 @@
+import scala.reflect.internal.util.{BatchSourceFile, SourceFile, OffsetPosition}
+import scala.reflect.io.{PlainFile, AbstractFile}
+import scala.reflect.macros.{TypecheckException, Context}
+import scalatags.Text.all._
+import scalatex.stages.{Parser, Compiler}
+import scala.language.experimental.macros
+import acyclic.file
+
+package object scalatex {
+ /**
+ * Wraps the given string as a twist fragment.
+ */
+ def tw(expr: String): Frag = macro Internals.applyMacro
+ def twf(filename: String): Frag = macro Internals.applyMacroFile
+ object Internals {
+
+ def twRuntimeErrors(expr: String): Frag = macro applyMacroRuntimeErrors
+ def twDebug(expr: String): Frag = macro applyMacroDebug
+
+ def applyMacro(c: Context)(expr: c.Expr[String]): c.Expr[Frag] = applyMacroFull(c)(expr, false, false)
+ def applyMacroDebug(c: Context)(expr: c.Expr[String]): c.Expr[Frag] = applyMacroFull(c)(expr, false, true)
+
+ def applyMacroRuntimeErrors(c: Context)(expr: c.Expr[String]): c.Expr[Frag] = applyMacroFull(c)(expr, true, false)
+
+ def applyMacroFile(c: Context)(filename: c.Expr[String]): c.Expr[Frag] = {
+ import c.universe._
+ val fileName = filename.tree
+ .asInstanceOf[Literal]
+ .value
+ .value
+ .asInstanceOf[String]
+ val txt = io.Source.fromFile(fileName).mkString
+ val sourceFile = new BatchSourceFile(
+ new PlainFile(fileName),
+ txt.toCharArray
+ )
+
+ compileThing(c)(txt, sourceFile, 0, false, false)
+ }
+
+ case class DebugFailure(msg: String, pos: String) extends Exception(msg)
+
+ private[this] def applyMacroFull(c: Context)
+ (expr: c.Expr[String],
+ runtimeErrors: Boolean,
+ debug: Boolean)
+ : c.Expr[Frag] = {
+ import c.universe._
+ val scalatexFragment = expr.tree
+ .asInstanceOf[Literal]
+ .value
+ .value
+ .asInstanceOf[String]
+ val stringStart =
+ expr.tree
+ .pos
+ .lineContent
+ .drop(expr.tree.pos.column)
+ .take(2)
+ compileThing(c)(
+ scalatexFragment,
+ expr.tree.pos.source,
+ expr.tree.pos.point + (if (stringStart == "\"\"") 1 else -1),
+ runtimeErrors,
+ debug
+ )
+ }
+ }
+
+ def compileThing(c: Context)
+ (scalatexSource: String,
+ source: SourceFile,
+ point: Int,
+ runtimeErrors: Boolean,
+ debug: Boolean) = {
+ import c.universe._
+ def compile(s: String): c.Tree = {
+ val realPos = new OffsetPosition(source, point).asInstanceOf[c.universe.Position]
+
+ Compiler(c)(realPos, Parser.tupled(stages.Trim(s)))
+ }
+
+
+ import c.Position
+ try {
+ val compiled = compile(scalatexSource)
+ if (debug) println(compiled)
+ c.Expr[Frag](c.typeCheck(compiled))
+ } catch {
+ case e@TypecheckException(pos: Position, msg) =>
+ if (!runtimeErrors) c.abort(pos, msg)
+ else {
+ val posMsg = pos.lineContent + "\n" + (" " * pos.column) + "^"
+ c.Expr( q"""throw scalatex.Internals.DebugFailure($msg, $posMsg)""")
+ }
+ }
+ }
+}
diff --git a/scalatexApi/src/main/scala/scalatex/stages/Compiler.scala b/scalatexApi/src/main/scala/scalatex/stages/Compiler.scala
new file mode 100644
index 0000000..3df8da7
--- /dev/null
+++ b/scalatexApi/src/main/scala/scalatex/stages/Compiler.scala
@@ -0,0 +1,103 @@
+package scalatex
+package stages
+
+import acyclic.file
+
+import scala.reflect.macros.whitebox.Context
+import scala.reflect.internal.util.{Position, OffsetPosition}
+
+/**
+ * Walks the parsed AST, converting it into a structured Scala c.Tree
+ */
+object Compiler{
+
+ def apply(c: Context)(fragPos: c.Position, template: Ast.Block): c.Tree = {
+
+ import c.universe._
+ def fragType = tq"scalatags.Text.all.Frag"
+
+ def incPosRec(trees: c.Tree, offset: Int): trees.type = {
+
+ trees.foreach(incPos(_, offset))
+ trees
+ }
+ def incPos(tree: c.Tree, offset: Int): tree.type = {
+
+ val current = if (tree.pos == NoPosition) 0 else tree.pos.point
+ c.internal.setPos(tree,
+ new OffsetPosition(
+ fragPos.source,
+ offset + current + fragPos.point
+ ).asInstanceOf[c.universe.Position]
+ )
+ tree
+ }
+
+ def compileChain(code: String, parts: Seq[Ast.Chain.Sub], offset: Int): c.Tree = {
+
+ val out = parts.foldLeft(incPosRec(c.parse(code), offset + 1)){
+ case (curr, Ast.Chain.Prop(str, offset2)) =>
+ incPos(q"$curr.${TermName(str)}", offset2 + 1)
+ case (curr, Ast.Chain.Args(str, offset2)) =>
+ val Apply(fun, args) = c.parse(s"omg$str")
+ incPos(Apply(curr, args.map(incPosRec(_, offset2 - 2))), offset2)
+ case (curr, Ast.Chain.TypeArgs(str, offset2)) =>
+ val TypeApply(fun, args) = c.parse(s"omg$str")
+ incPos(TypeApply(curr, args.map(incPosRec(_, offset2 - 2))), offset2)
+ case (curr, Ast.Block(parts, offset1)) =>
+ incPos(q"$curr(..${compileBlock(parts, offset1)})", offset1)
+ case (curr, Ast.Header(header, block, offset1)) =>
+ incPos(q"$curr(${compileHeader(header, block, offset1)})", offset1)
+ }
+
+ out
+ }
+ def compileBlock(parts: Seq[Ast.Block.Sub], offset: Int): Seq[c.Tree] = {
+ val res = parts.map{
+ case Ast.Block.Text(str, offset1) =>
+ incPos(q"$str", offset1)
+ case Ast.Chain(code, parts, offset1) =>
+ compileChain(code, parts, offset1)
+ case Ast.Header(header, block, offset1) =>
+ compileHeader(header, block, offset1)
+ case Ast.Block.IfElse(condString, Ast.Block(parts2, offset2), elseBlock, offset1) =>
+ val If(cond, _, _) = c.parse(condString + "{}")
+ val elseCompiled = elseBlock match{
+ case Some(Ast.Block(parts3, offset3)) => compileBlockWrapped(parts3, offset3)
+ case None => EmptyTree
+ }
+
+ val res = If(incPosRec(cond, offset1 + 2), compileBlockWrapped(parts2, offset2), elseCompiled)
+
+ incPos(res, offset1)
+ res
+ case Ast.Block.For(generators, Ast.Block(parts2, offset2), offset1) =>
+ val fresh = c.fresh()
+
+ val tree = incPosRec(c.parse(s"$generators yield $fresh"), offset1 + 2)
+
+ def rec(t: Tree): Tree = t match {
+ case a @ Apply(fun, List(f @ Function(vparams, body))) =>
+ val f2 = Function(vparams, rec(body))
+ val a2 = Apply(fun, List(f2))
+ a2
+ case Ident(x: TermName) if x.decoded == fresh =>
+ compileBlockWrapped(parts2, offset2)
+ }
+
+ rec(tree)
+ }
+ res
+ }
+ def compileBlockWrapped(parts: Seq[Ast.Block.Sub], offset: Int): c.Tree = {
+ incPos(q"Seq[$fragType](..${compileBlock(parts, offset)})", offset)
+ }
+ def compileHeader(header: String, block: Ast.Block, offset: Int): c.Tree = {
+ val Block(stmts, expr) = c.parse(s"{$header\n ()}")
+ Block(stmts, compileBlockWrapped(block.parts, block.offset))
+ }
+
+ val res = compileBlockWrapped(template.parts, template.offset)
+ res
+ }
+} \ No newline at end of file
diff --git a/scalatexApi/src/main/scala/scalatex/stages/Parser.scala b/scalatexApi/src/main/scala/scalatex/stages/Parser.scala
new file mode 100644
index 0000000..0b87d97
--- /dev/null
+++ b/scalatexApi/src/main/scala/scalatex/stages/Parser.scala
@@ -0,0 +1,170 @@
+package scalatex
+package stages
+import acyclic.file
+import org.parboiled2._
+import scalaParser.ScalaSyntax
+
+/**
+ * Parses the input text into a roughly-structured AST. This AST
+ * is much simpler than the real Scala AST, but serves us well
+ * enough until we stuff the code-strings into the real Scala
+ * parser later
+ */
+object Parser extends ((String, Int) => Ast.Block){
+ def apply(input: String, offset: Int = 0): Ast.Block = {
+ new Parser(input, offset).Body.run().get
+ }
+}
+class Parser(input: ParserInput, indent: Int = 0, offset: Int = 0) extends scalaParser.ScalaSyntax(input) {
+ def offsetCursor = offset + cursor
+ val txt = input.sliceString(0, input.length)
+ val indentTable = txt.split('\n').map{ s =>
+ if (s.trim == "") -1
+ else s.takeWhile(_ == ' ').length
+ }
+ val nextIndentTable = (0 until indentTable.length).map { i =>
+ val index = indentTable.indexWhere(_ != -1, i + 1)
+ if (index == -1) 100000
+ else indentTable(index)
+ }
+ def cursorNextIndent() = {
+ nextIndentTable(txt.take(cursor).count(_ == '\n'))
+ }
+
+ def TextNot(chars: String) = rule {
+ push(offsetCursor) ~ capture(oneOrMore(noneOf(chars + "\n") | "@@")) ~> {
+ (i, x) => Ast.Block.Text(x.replace("@@", "@"), i)
+ }
+ }
+ def Text = TextNot("@")
+ def Code = rule {
+ "@" ~ capture(Identifiers.Id | BlockExpr2 | ('(' ~ optional(Exprs) ~ ')'))
+ }
+ def Header = rule {
+ "@" ~ capture(Def | Import)
+ }
+
+ def HeaderBlock: Rule1[Ast.Header] = rule{
+ Header ~ zeroOrMore(capture(WL) ~ Header ~> (_ + _)) ~ runSubParser{new Parser(_, indent, cursor).Body0} ~> {
+ (start: String, heads: Seq[String], body: Ast.Block) => Ast.Header(start + heads.mkString, body)
+ }
+ }
+
+ def BlankLine = rule{ '\n' ~ zeroOrMore(' ') ~ &('\n') }
+ def IndentSpaces = rule{ indent.times(' ') ~ zeroOrMore(' ') }
+ def Indent = rule{ '\n' ~ IndentSpaces }
+ def LoneScalaChain: Rule2[Ast.Block.Text, Ast.Chain] = rule {
+ (push(offsetCursor) ~ capture(Indent) ~> ((i, x) => Ast.Block.Text(x, i))) ~
+ ScalaChain ~
+ IndentBlock ~> {
+ (chain: Ast.Chain, body: Ast.Block) => chain.copy(parts = chain.parts :+ body)
+ }
+ }
+ def IndentBlock = rule{
+ &("\n") ~
+ test(cursorNextIndent() > indent) ~
+ runSubParser(new Parser(_, cursorNextIndent(), cursor).Body)
+ }
+ def IfHead = rule{ "@" ~ capture("if" ~ "(" ~ Expr ~ ")") }
+ def IfElse1 = rule{
+ push(offsetCursor) ~ IfHead ~ BraceBlock ~ optional("else" ~ (BraceBlock | IndentBlock))
+ }
+ def IfElse2 = rule{
+ Indent ~ push(offsetCursor) ~ IfHead ~ IndentBlock ~ optional(Indent ~ "@else" ~ (BraceBlock | IndentBlock))
+ }
+ def IfElse = rule{
+ (IfElse1 | IfElse2) ~> ((a, b, c, d) => Ast.Block.IfElse(b, c, d, a))
+ }
+
+ def ForHead = rule{
+ push(offsetCursor) ~ "@" ~ capture("for" ~ '(' ~ Enumerators ~ ')')
+ }
+ def ForLoop = rule{
+ ForHead ~
+ BraceBlock ~> ((a, b, c) => Ast.Block.For(b, c, a))
+ }
+ def LoneForLoop = rule{
+ (push(offsetCursor) ~ capture(Indent) ~> ((i, t) => Ast.Block.Text(t, i))) ~
+ ForHead ~
+ IndentBlock ~>
+ ((a, b, c) => Ast.Block.For(b, c, a))
+ }
+
+ def ScalaChain = rule {
+ push(offsetCursor) ~ Code ~ zeroOrMore(Extension) ~> { (a, b, c) => Ast.Chain(b, c, a)}
+ }
+ def Extension: Rule1[Ast.Chain.Sub] = rule {
+ (push(offsetCursor) ~ '.' ~ capture(Identifiers.Id) ~> ((x, y) => Ast.Chain.Prop(y, x))) |
+ (push(offsetCursor) ~ capture(TypeArgs2) ~> ((x, y) => Ast.Chain.TypeArgs(y, x))) |
+ (push(offsetCursor) ~ capture(ArgumentExprs2) ~> ((x, y) => Ast.Chain.Args(y, x))) |
+ BraceBlock
+ }
+ def Ws = WL
+ // clones of the version in ScalaSyntax, but without tailing whitespace or newlines
+ def TypeArgs2 = rule { '[' ~ Ws ~ Types ~ ']' }
+ def ArgumentExprs2 = rule {
+ '(' ~ Ws ~
+ (optional(Exprs ~ ',' ~ Ws) ~ PostfixExpr ~ ':' ~ Ws ~ '_' ~ Ws ~ '*' ~ Ws | optional(Exprs) ) ~
+ ')'
+ }
+ def BlockExpr2: Rule0 = rule { '{' ~ Ws ~ (CaseClauses | Block) ~ Ws ~ '}' }
+ def BraceBlock: Rule1[Ast.Block] = rule{ '{' ~ BodyNoBrace ~ '}' }
+
+ def BodyItem(exclusions: String): Rule1[Seq[Ast.Block.Sub]] = rule{
+ ForLoop ~> (Seq(_)) |
+ LoneForLoop ~> (Seq(_, _)) |
+ IfElse ~> (Seq(_)) |
+ LoneScalaChain ~> (Seq(_, _)) |
+ HeaderBlock ~> (Seq(_)) |
+ TextNot("@" + exclusions) ~> (Seq(_)) |
+ (push(offsetCursor) ~ capture(Indent) ~> ((i, x) => Seq(Ast.Block.Text(x, i)))) |
+ (push(offsetCursor) ~ capture(BlankLine) ~> ((i, x) => Seq(Ast.Block.Text(x, i)))) |
+ ScalaChain ~> (Seq(_: Ast.Block.Sub))
+ }
+ def Body = rule{ BodyEx() }
+ def BodyNoBrace = rule{ BodyEx("}") }
+ def BodyEx(exclusions: String = "") = rule{
+ push(offsetCursor) ~ oneOrMore(BodyItem(exclusions)) ~> {(i, x) =>
+ Ast.Block(x.flatten, i)
+ }
+ }
+ def Body0 = rule{
+ push(offsetCursor) ~ zeroOrMore(BodyItem("")) ~> {(i, x) =>
+ Ast.Block(x.flatten, i)
+ }
+ }
+}
+
+trait Ast{
+ def offset: Int
+}
+object Ast{
+
+ /**
+ * @param parts The various bits of text and other things which make up this block
+ * @param offset
+ */
+ case class Block(parts: Seq[Block.Sub],
+ offset: Int = 0)
+ extends Chain.Sub with Block.Sub
+ object Block{
+ trait Sub extends Ast
+ case class Text(txt: String, offset: Int = 0) extends Block.Sub
+ case class For(generators: String, block: Block, offset: Int = 0) extends Block.Sub
+ case class IfElse(condition: String, block: Block, elseBlock: Option[Block], offset: Int = 0) extends Block.Sub
+ }
+ case class Header(front: String, block: Block, offset: Int = 0) extends Block.Sub with Chain.Sub
+
+ /**
+ * @param lhs The first expression in this method-chain
+ * @param parts A list of follow-on items chained to the first
+ * @param offset
+ */
+ case class Chain(lhs: String, parts: Seq[Chain.Sub], offset: Int = 0) extends Block.Sub
+ object Chain{
+ trait Sub extends Ast
+ case class Prop(str: String, offset: Int = 0) extends Sub
+ case class TypeArgs(str: String, offset: Int = 0) extends Sub
+ case class Args(str: String, offset: Int = 0) extends Sub
+ }
+}
diff --git a/scalatexApi/src/main/scala/scalatex/stages/Trim.scala b/scalatexApi/src/main/scala/scalatex/stages/Trim.scala
new file mode 100644
index 0000000..8993734
--- /dev/null
+++ b/scalatexApi/src/main/scala/scalatex/stages/Trim.scala
@@ -0,0 +1,29 @@
+package scalatex.stages
+import acyclic.file
+
+/**
+ * Preprocesses the input string to normalize things related to whitespace
+ *
+ * Find the "first" non-whitespace-line of the text and remove the front
+ * of every line to align that first line with the left margin.
+ *
+ * Remove all trailing whitespace from each line.
+ */
+object Trim extends (String => (String, Int)){
+ def apply(str: String) = {
+ val lines = str.split("\n", -1)
+ val offset = lines.iterator
+ .filter(_.length > 0)
+ .next()
+ .takeWhile(_ == ' ')
+ .length
+ val res = lines.iterator
+ .map(_.replaceFirst("\\s+$", ""))
+ .mkString("\n")
+ (res, offset)
+ }
+ def old(str: String) = {
+ val (res, offset) = this.apply(str)
+ res.split("\n", -1).map(_.drop(offset)).mkString("\n")
+ }
+}
diff --git a/scalatexApi/src/test/scala/scalatex/AdvancedTests.scala b/scalatexApi/src/test/scala/scalatex/AdvancedTests.scala
new file mode 100644
index 0000000..cbca40a
--- /dev/null
+++ b/scalatexApi/src/test/scala/scalatex/AdvancedTests.scala
@@ -0,0 +1,120 @@
+//package scalatex
+//
+//import utest._
+//import scalatex.stages._
+//import scalatags.Text.all._
+//
+//
+///**
+//* Created by haoyi on 7/14/14.
+//*/
+//object AdvancedTests extends TestSuite{
+// import TestUtil._
+//
+// val tests = TestSuite{
+// 'localDef{
+// check(
+// tw("""
+// @lol(n: Int) = @{
+// "omg" * n
+// }
+//
+// @lol(2)
+// """),
+// "omgomg"
+// )
+// }
+// 'innerTemplate{
+// check(
+// tw("""
+// @lol(f: Int) =
+// omg @f
+//
+// @lol(1)
+// @lol(2: Int)
+// @lol(3 + 1)
+// """),
+// tw("""
+// @lol(f: Int) ={
+// omg @f
+// }
+// @lol(1)
+// @lol(2: Int)
+// @lol(3 + 1)
+// """),
+// tw("""
+// @lol(f: Int) = {
+// omg @f
+// }
+// @lol(1)
+// @lol(2: Int)
+// @lol(3 + 1)
+// """),
+// """
+// omg1omg2omg4
+// """
+// )
+// }
+// 'innerInnerTemplate{
+// check(
+// tw("""
+// @lol(f: Int) =
+// @wtf(g: Int) =
+// wtf @g
+//
+// @wtf(1 + 2 + 3)
+// @wtf(f)
+//
+// @lol(1)
+// @lol(2: Int)
+// @lol(3 + 1)
+// """),
+// tw("""
+// @lol(f: Int) = {
+// @wtf(g: Int) = {
+// wtf @g
+// }
+// @wtf(1 + 2 + 3)
+// @wtf(f)
+// }
+// @lol(1)
+// @lol(2: Int)
+// @lol(3 + 1)
+// """),
+// tw("""
+// @lol(f: Int) = {
+// @wtf(g: Int) =
+// wtf @g
+//
+// @wtf(1 + 2 + 3)
+// @wtf(f)
+// }
+// @lol(1)
+// @lol(2: Int)
+// @lol(3 + 1)
+// """),
+// tw("""
+// @lol(f: Int) =
+// @wtf(g: Int) = {
+// wtf @g
+// }
+// @wtf(1 + 2 + 3)
+// @wtf(f)
+//
+// @lol(1)
+// @lol(2: Int)
+// @lol(3 + 1)
+// """),
+// """
+// wtf6
+// wtf1
+// wtf6
+// wtf2
+// wtf6
+// wtf4
+// """
+// )
+// }
+//
+// }
+//}
diff --git a/scalatexApi/src/test/scala/scalatex/BasicTests.scala b/scalatexApi/src/test/scala/scalatex/BasicTests.scala
new file mode 100644
index 0000000..4bc362c
--- /dev/null
+++ b/scalatexApi/src/test/scala/scalatex/BasicTests.scala
@@ -0,0 +1,468 @@
+package scalatex
+import utest._
+import scala.collection.mutable.ArrayBuffer
+import scalatex.stages._
+import scalatags.Text.all._
+
+
+/**
+* Created by haoyi on 7/14/14.
+*/
+object BasicTests extends TestSuite{
+ import TestUtil._
+
+ val tests = TestSuite{
+
+ 'helloWorld{
+ object omg {
+ def wtf(s: Frag*): Frag = Seq[Frag]("|", s, "|")
+ }
+ def str = "hear me moo"
+ check(
+ tw("""
+ @omg.wtf
+ i @b{am} cow @str
+ """),
+ "|i<b>am</b>cowhearmemoo|"
+ )
+ }
+ 'interpolation{
+ 'chained-check(
+ tw("omg @scala.math.pow(0.5, 3) wtf"),
+ "omg 0.125 wtf"
+ )
+ 'parens-check(
+ tw("omg @(1 + 2 + 3 + 4) wtf"),
+ "omg 10 wtf"
+ )
+ 'block-check(
+ tw("""
+ @{"lol" * 3}
+ @{
+ val omg = "omg"
+ omg * 2
+ }
+ """),
+ """
+ lollollol
+ omgomg
+ """
+ )
+ }
+ 'definitions{
+ 'imports{
+ object Whee{
+ def func(x: Int) = x * 2
+ }
+ check(
+ tw("""
+ @import math._
+ @import Whee.func
+ @abs(-10)
+ @p
+ @max(1, 2)
+ @func(2)
+ """),
+ """
+ 10
+ <p>
+ 2
+ 4
+ </p>
+ """
+ )
+ }
+ 'valDefVar{
+ check(
+ tw("""
+ Hello
+ @val x = 1
+ World @x
+ @def y = "omg"
+ mooo
+ @y
+ """),
+ """
+ Hello
+ World 1
+ mooo
+ omg
+ """
+ )
+ }
+ 'classObjectTrait{
+ check(
+ tw("""
+ @trait Trait{
+ def tt = 2
+ }
+ Hello
+ @case object moo extends Trait{
+ val omg = "wtf"
+ }
+
+ @moo.toString
+ @moo.omg
+ @case class Foo(i: Int, s: String, b: Boolean)
+ TT is @moo.tt
+ @Foo(10, "10", true).toString
+ """),
+ """
+ Hello
+ moo
+ wtf
+ TT is 2
+ Foo(10, 10, true)
+ """
+ )
+ }
+ }
+ 'parenArgumentLists{
+ 'attributes{
+ check(
+ tw("""
+ @div(id:="my-id"){ omg }
+ @div(id:="my-id")
+ omg
+ """),
+ """
+ <divid="my-id">omg</div>
+ <divid="my-id">omg</div>
+ """
+ )
+ }
+// 'multiline{
+//
+// check(
+// tw("""
+// @div(
+// h1("Hello World"),
+// p("I am a ", b{"cow"})
+// )
+// """),
+// """
+// <div>
+// <h1>Hello World</h1>
+// <p>I am a <b>cow</b></p>
+// </div>
+// """
+// )
+// }
+ }
+ 'grouping{
+ 'negative{
+ // The indentation for "normal" text is ignored; we only
+ // create blocks from the indentation following a scala
+ // @xxx expression
+ check(
+ tw("""
+ I am cow hear me moo
+ I weigh twice as much as you
+ And I look good on the barbecue
+ Yoghurt curds cream cheese and butter
+ Comes from liquids from my udder
+ I am cow I am cow hear me moooooo
+ """),
+ """
+ I am cow hear me moo
+ I weigh twice as much as you
+ And I look good on the barbecue
+ Yoghurt curds cream cheese and butter
+ Comes from liquids from my udder
+ I am cow I am cow hear me moooooo
+ """
+ )
+ }
+ 'indentation{
+ 'simple{
+ val world = "World2"
+
+ check(
+ tw("""
+ @h1
+ Hello World
+ @h2
+ hello @world
+ @h3
+ Cow
+ """),
+ """
+ <h1>HelloWorld</h1>
+ <h2>helloWorld2</h2>
+ <h3>Cow</h3>
+ """
+ )
+ }
+ 'linearNested{
+ check(
+ tw("""
+ @h1 @span @a Hello World
+ @h2 @span @a hello
+ @b world
+ @h3 @i
+ @div Cow
+ """),
+ """
+ <h1></h1><span></span><a></a>HelloWorld
+ <h2></h2><span></span><a></a>hello<b></b>world
+ <h3></h3><i></i><div></div>Cow
+ """
+ )
+ }
+ 'crasher{
+ tw("""
+@html
+ @head
+ @meta
+ @div
+ @a
+ @span
+ """)
+ }
+ }
+ 'curlies{
+ 'simple{
+ val world = "World2"
+
+ check(
+ tw("""@div{Hello World}"""),
+ """<div>HelloWorld</div>"""
+ )
+ }
+ 'multiline{
+ check(
+ tw("""
+ @div{
+ Hello
+ }
+ """),
+ """
+ <div>Hello</div>
+ """
+ )
+ }
+ }
+ 'mixed{
+ check(
+ tw("""
+ @div{
+ Hello
+ @div
+ @h1
+ WORLD @b{!!!}
+ lol
+ @p{
+ @h2{Header 2}
+ }
+ }
+ """),
+ """
+ <div>
+ Hello
+ <div>
+ <h1>WORLD<b>!!!</b>lol</h1>
+ <p><h2>Header2</h2></p>
+ </div>
+ </div>
+ """
+ )
+ }
+//
+// 'args{
+// val things = Seq(1, 2, 3)
+// check(
+// tw("""
+// @ul
+// @things.map { x =>
+// @li
+// @x
+// }
+// """),
+// tw("""
+// @ul
+// @things.map x =>
+// @li
+// @x
+//
+// """),
+// """
+// <ul>
+// <li>1</li>
+// <li>2</li>
+// <li>3</li>
+// </ul>
+// """
+// )
+// }
+ }
+//
+ 'loops {
+//
+ * - check(
+ tw("""
+ @for(x <- 0 until 3)
+ lol
+ """),
+ tw("""
+ @for(x <- 0 until 3){
+ lol
+ }
+ """),
+ "lollollol"
+ )
+
+
+ * - check(
+ tw("""
+ @p
+ @for(x <- 0 until 2)
+ @for(y <- 0 until 2)
+ lol@x@y
+ """),
+ tw( """
+ @p
+ @for(x <- 0 until 2){
+ @for(y <- 0 until 2)
+ lol@x@y
+ }
+ """),
+ tw("""
+ @p
+ @for(x <- 0 until 2)
+ @for(y <- 0 until 2){
+ lol@x@y
+ }
+ """),
+ "<p>lol00lol01lol10lol11</p>"
+ )
+ check(
+ tw("""
+ @p
+ @for(x <- 0 until 2)
+ @for(y <- 0 until 2)
+ lol@x@y
+ """),
+ "<p>lol00lol01lol10lol11</p>"
+ )
+
+ * - check(
+ tw(
+ """
+ @for(x <- 0 until 2; y <- 0 until 2)
+ @div{@x@y}
+
+ """),
+ """<div>00</div><div>01</div><div>10</div><div>11</div>"""
+ )
+ }
+
+ 'ifElse{
+ 'basicExamples{
+ * - check(
+ tw("""
+ @if(false)
+ Hello
+ @else
+ lols
+ @p
+ """),
+ "lols<p></p>"
+ )
+
+ * - check(
+ tw("""
+ @div
+ @if(true)
+ Hello
+ @else
+ lols
+ """),
+ "<div>Hello</div>"
+ )
+
+ * - check(
+ tw("""
+ @div
+ @if(true)
+ Hello
+ @else
+ lols
+ """),
+ "<div>Hello</div>"
+ )
+ * - check(
+ tw("""
+ @if(false)
+ Hello
+ @else
+ lols
+ """),
+ "lols"
+ )
+ * - check(
+ tw("""
+ @if(false)
+ Hello
+ @else
+ lols
+ @img
+ """),
+ "lols<img/>"
+ )
+ * - check(
+ tw("""
+ @p
+ @if(true)
+ Hello
+ @else
+ lols
+ """),
+ tw("""
+ @p
+ @if(true){
+ Hello
+ }else{
+ lols
+ }
+ """),
+ "<p>Hello</p>"
+ )
+ }
+// 'funkyExpressions{
+// * - check(
+// tw("""
+// @p
+// @if(true == false == (true.==(false)))
+// @if(true == false == (true.==(false)))
+// Hello1
+// @else
+// lols1
+// @else
+// @if(true == false == (true.==(false)))
+// Hello2
+// @else
+// lols2
+// """),
+// "<p>Hello1</p>"
+// )
+// * - check(
+// tw("""
+// @p
+// @if(true == false != (true.==(false)))
+// @if(true == false != (true.==(false)))
+// Hello1
+// @else
+// lols1
+// @else
+// @if(true == false != (true.==(false)))
+// Hello2
+// @else
+// lols2
+// """),
+// "<p>lols2</p>"
+// )
+// }
+ }
+ }
+
+}
diff --git a/scalatexApi/src/test/scala/scalatex/ErrorTests.scala b/scalatexApi/src/test/scala/scalatex/ErrorTests.scala
new file mode 100644
index 0000000..d8cd4f5
--- /dev/null
+++ b/scalatexApi/src/test/scala/scalatex/ErrorTests.scala
@@ -0,0 +1,373 @@
+package scalatex
+
+import utest._
+import scalatex.stages._
+import scalatags.Text.all._
+import scalatex.Internals.{DebugFailure, twRuntimeErrors}
+
+/**
+* Created by haoyi on 7/14/14.
+*/
+object ErrorTests extends TestSuite{
+ def check(x: => Unit, expectedMsg: String, expectedError: String) = {
+ val DebugFailure(msg, pos) = intercept[DebugFailure](x)
+ def format(str: String) = {
+ val whitespace = " \t\n".toSet
+ "\n" + str.dropWhile(_ == '\n')
+ .reverse
+ .dropWhile(whitespace.contains)
+ .reverse
+ }
+ // Format these guys nicely to normalize them and make them
+ // display nicely in the assert error message if it blows up
+ val formattedPos = format(pos)
+ val formattedExpectedPos = format(expectedError)
+
+ assert(msg.contains(expectedMsg))
+ assert(formattedPos == formattedExpectedPos)
+
+ }
+ val tests = TestSuite{
+
+
+ 'simple - check(
+ twRuntimeErrors("omg @notInScope lol"),
+ """not found: value notInScope""",
+ """
+ twRuntimeErrors("omg @notInScope lol"),
+ ^
+ """
+ )
+
+ 'chained{
+ 'properties {
+ * - check(
+ twRuntimeErrors("omg @math.lol lol"),
+ """object lol is not a member of package math""",
+ """
+ twRuntimeErrors("omg @math.lol lol"),
+ ^
+ """
+ )
+
+ * - check(
+ twRuntimeErrors("omg @math.E.lol lol"),
+ """value lol is not a member of Double""",
+ """
+ twRuntimeErrors("omg @math.E.lol lol"),
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("omg @_root_.scala.math.lol lol"),
+ """object lol is not a member of package math""",
+ """
+ twRuntimeErrors("omg @_root_.scala.math.lol lol"),
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("omg @_root_.scala.gg.lol lol"),
+ """object gg is not a member of package scala""",
+ """
+ twRuntimeErrors("omg @_root_.scala.gg.lol lol"),
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("omg @_root_.ggnore.math.lol lol"),
+ """object ggnore is not a member of package <root>""",
+ """
+ twRuntimeErrors("omg @_root_.ggnore.math.lol lol"),
+ ^
+ """
+ )
+ }
+ 'calls{
+ * - check(
+ twRuntimeErrors("@scala.QQ.abs(-10).tdo(10).sum.z"),
+ """object QQ is not a member of package scala""",
+ """
+ twRuntimeErrors("@scala.QQ.abs(-10).tdo(10).sum.z"),
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("@scala.math.abs(-10).tdo(10).sum.z"),
+ "value tdo is not a member of Int",
+ """
+ twRuntimeErrors("@scala.math.abs(-10).tdo(10).sum.z"),
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("@scala.math.abs(-10).to(10).sum.z"),
+ "value z is not a member of Int",
+ """
+ twRuntimeErrors("@scala.math.abs(-10).to(10).sum.z"),
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("@scala.math.abs(-10).to(10).sum.z()"),
+ "value z is not a member of Int",
+ """
+ twRuntimeErrors("@scala.math.abs(-10).to(10).sum.z()"),
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("@scala.math.abs(-10).cow.sum.z"),
+ "value cow is not a member of Int",
+ """
+ twRuntimeErrors("@scala.math.abs(-10).cow.sum.z"),
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("@scala.smath.abs.cow.sum.z"),
+ "object smath is not a member of package scala",
+ """
+ twRuntimeErrors("@scala.smath.abs.cow.sum.z"),
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("@scala.math.cos('omg)"),
+ "type mismatch",
+ """
+ twRuntimeErrors("@scala.math.cos('omg)"),
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("@scala.math.cos[omg]('omg)"),
+ "not found: type omg",
+ """
+ twRuntimeErrors("@scala.math.cos[omg]('omg)"),
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("""
+ I am cow hear me moo
+ @scala.math.abs(-10).tdo(10).sum.z
+ I weigh twice as much as you
+ """),
+ "value tdo is not a member of Int",
+ """
+ @scala.math.abs(-10).tdo(10).sum.z
+ ^
+ """
+ )
+ }
+ 'curlies{
+ * - check(
+ twRuntimeErrors("@p{@Seq(1, 2, 3).foldLeft(0)}"),
+ "missing arguments for method foldLeft",
+ """
+ twRuntimeErrors("@p{@Seq(1, 2, 3).foldLeft(0)}"),
+ ^
+ """
+ )
+
+ * - check(
+ twRuntimeErrors("@Nil.foldLeft{XY}"),
+ "missing arguments for method foldLeft",
+ """
+ twRuntimeErrors("@Nil.foldLeft{XY}"),
+ ^
+ """
+ )
+
+// * - check(
+// twRuntimeErrors("@Seq(1).map{(y: String) => omg}"),
+// "type mismatch",
+// """
+// twRuntimeErrors("@Seq(1).map{(y: String) => omg}"),
+// ^
+// """
+// )
+// * - check(
+// twRuntimeErrors("@Nil.map{ omg}"),
+// "too many arguments for method map",
+// """
+// twRuntimeErrors("@Nil.map{ omg}"),
+// ^
+// """
+// )
+ }
+ 'callContents{
+ * - check(
+ twRuntimeErrors("@scala.math.abs((1, 2).wtf)"),
+ "value wtf is not a member of (Int, Int)",
+ """
+ twRuntimeErrors("@scala.math.abs((1, 2).wtf)"),
+ ^
+ """
+ )
+
+ * - check(
+ twRuntimeErrors("@scala.math.abs((1, 2).swap._1.toString().map(_.toString.wtf))"),
+ "value wtf is not a member of String",
+ """
+ twRuntimeErrors("@scala.math.abs((1, 2).swap._1.toString().map(_.toString.wtf))"),
+ ^
+ """
+ )
+ }
+ }
+ 'ifElse{
+ 'oneLine {
+ * - check(
+ twRuntimeErrors("@if(math > 10){ 1 }else{ 2 }"),
+ "object > is not a member of package math",
+ """
+ twRuntimeErrors("@if(math > 10){ 1 }else{ 2 }"),
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("@if(true){ (@math.pow(10)) * 10 }else{ 2 }"),
+ "Unspecified value parameter y",
+ """
+ twRuntimeErrors("@if(true){ (@math.pow(10)) * 10 }else{ 2 }"),
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("@if(true){ * 10 }else{ @math.sin(3, 4, 5) }"),
+ "too many arguments for method sin: (x: Double)Double",
+ """
+ twRuntimeErrors("@if(true){ * 10 }else{ @math.sin(3, 4, 5) }"),
+ ^
+ """
+ )
+ }
+ 'multiLine{
+ * - check(
+ twRuntimeErrors("""
+ Ho Ho Ho
+
+ @if(math != 10)
+ I am a cow
+ @else
+ You are a cow
+ GG
+ """),
+ "object != is not a member of package math",
+ """
+ @if(math != 10)
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("""
+ Ho Ho Ho
+
+ @if(4 != 10)
+ I am a cow @math.lols
+ @else
+ You are a cow
+ GG
+ """),
+ "object lols is not a member of package math",
+ """
+ I am a cow @math.lols
+ ^
+ """
+ )
+ * - check(
+ twRuntimeErrors("""
+ Ho Ho Ho
+
+ @if(12 != 10)
+ I am a cow
+ @else
+ @math.E.toString.gog(1)
+ GG
+ """),
+ "value gog is not a member of String",
+ """
+ @math.E.toString.gog(1)
+ ^
+ """
+ )
+ }
+ }
+ 'forLoop{
+ 'oneLine{
+ 'header - check(
+ twRuntimeErrors("omg @for(x <- (0 + 1 + 2) omglolol (10 + 11 + 2)){ hello }"),
+ """value omglolol is not a member of Int""",
+ """
+ twRuntimeErrors("omg @for(x <- (0 + 1 + 2) omglolol (10 + 11 + 2)){ hello }"),
+ ^
+ """
+ )
+
+ 'body - check(
+ twRuntimeErrors("omg @for(x <- 0 until 10){ @((x, 2) + (1, 2)) }"),
+ """too many arguments for method +""",
+ """
+ twRuntimeErrors("omg @for(x <- 0 until 10){ @((x, 2) + (1, 2)) }"),
+ ^
+ """
+ )
+ }
+ 'multiLine{
+ 'body - check(
+ twRuntimeErrors("""
+ omg
+ @for(x <- 0 until 10)
+ I am cow hear me moo
+ I weigh twice as much as @x.kkk
+ """),
+ """value kkk is not a member of Int""",
+ """
+ I weigh twice as much as @x.kkk
+ ^
+ """
+ )
+ }
+ }
+ 'multiLine{
+ 'missingVar - check(
+ twRuntimeErrors("""
+ omg @notInScope lol
+ """),
+ """not found: value notInScope""",
+ """
+ omg @notInScope lol
+ ^
+ """
+ )
+// 'wrongType - check(
+// twRuntimeErrors("""
+// omg @{() => ()} lol
+// """),
+// """type mismatch""",
+// """
+// omg @{() => ()} lol
+// ^
+// """
+// )
+
+ 'bigExpression - check(
+ twRuntimeErrors("""
+ @{
+ val x = 1 + 2
+ val y = new Object()
+ val z = y * x
+ x
+ }
+ """),
+ "value * is not a member of Object",
+ """
+ val z = y * x
+ ^
+ """
+ )
+ }
+ }
+}
diff --git a/scalatexApi/src/test/scala/scalatex/ParserTests.scala b/scalatexApi/src/test/scala/scalatex/ParserTests.scala
new file mode 100644
index 0000000..9a4ee63
--- /dev/null
+++ b/scalatexApi/src/test/scala/scalatex/ParserTests.scala
@@ -0,0 +1,424 @@
+package scalatex
+
+
+import org.parboiled2._
+import scalaParser.ScalaSyntax
+
+import scalatex.stages.{Trim, Parser, Ast}
+import scalatex.stages.Ast.Block.{IfElse, For, Text}
+import Ast.Chain.Args
+
+object ParserTests extends utest.TestSuite{
+ import Ast._
+ import utest._
+ def check[T](input: String, parse: Parser => scala.util.Try[T], expected: T) = {
+ val parsed = parse(new Parser(input)).get
+ assert(parsed == expected)
+ }
+ def tests = TestSuite{
+ 'Trim{
+ def wrap(s: String) = "|" + s + "|"
+ * - {
+ val trimmed = wrap(stages.Trim.old("""
+ i am cow
+ hear me moo
+ i weigh twice as much as you
+ """))
+ val expected = wrap("""
+ |i am cow
+ | hear me moo
+ | i weigh twice as much as you
+ |""".stripMargin)
+ assert(trimmed == expected)
+
+ }
+ * - {
+ val trimmed = wrap(stages.Trim.old(
+ """
+ @{"lol" * 3}
+ @{
+ val omg = "omg"
+ omg * 2
+ }
+ """
+ ))
+ val expected = wrap(
+ """
+ |@{"lol" * 3}
+ |@{
+ | val omg = "omg"
+ | omg * 2
+ |}
+ |""".stripMargin
+ )
+ assert(trimmed == expected)
+ }
+ 'dropTrailingWhitespace - {
+
+ val trimmed = wrap(stages.Trim.old(
+ Seq(
+ " i am a cow ",
+ " hear me moo ",
+ " i weigh twice as much as you"
+ ).mkString("\n")
+ ))
+ val expected = wrap(
+ Seq(
+ "i am a cow",
+ " hear me moo",
+ " i weigh twice as much as you"
+ ).mkString("\n")
+ )
+ assert(trimmed == expected)
+ }
+ }
+ 'Text {
+ * - check("i am a cow", _.Text.run(), Block.Text("i am a cow"))
+ * - check("i am a @cow", _.Text.run(), Block.Text("i am a "))
+ * - check("i am a @@cow", _.Text.run(), Block.Text("i am a @cow"))
+ * - check("i am a @@@cow", _.Text.run(), Block.Text("i am a @"))
+ * - check("i am a @@@@cow", _.Text.run(), Block.Text("i am a @@cow"))
+
+ }
+ 'Code{
+ 'identifier - check("@gggg ", _.Code.run(), "gggg")
+ 'parens - check("@(1 + 1)lolsss\n", _.Code.run(), "(1 + 1)")
+ 'curlies - check("@{{1} + (1)} ", _.Code.run(), "{{1} + (1)}")
+ 'blocks - check("@{val x = 1; 1} ", _.Code.run(), "{val x = 1; 1}")
+ 'weirdBackticks - check("@{`{}}{()@`}\n", _.Code.run(), "{`{}}{()@`}")
+ }
+ 'MiscCode{
+ 'imports{
+ * - check("@import math.abs", _.Header.run(), "import math.abs")
+ * - check("@import math.{abs, sin}", _.Header.run(), "import math.{abs, sin}")
+ }
+ 'headerblocks{
+ check(
+ """@import math.abs
+ |@import math.sin
+ |
+ |hello world
+ |""".stripMargin,
+ _.HeaderBlock.run(),
+ Ast.Header(
+ "import math.abs\nimport math.sin",
+ Ast.Block(
+ Seq(Text("\n", 33), Text("\n", 34), Text("hello world", 35), Text("\n", 46)),
+ 33
+ )
+ )
+ )
+ }
+ 'caseclass{
+ check(
+ """@case class Foo(i: Int, s: String)
+ """.stripMargin,
+ _.Header.run(),
+ "case class Foo(i: Int, s: String)"
+ )
+ }
+
+ }
+ 'Block{
+ * - check("{i am a cow}", _.BraceBlock.run(), Block(Seq(Block.Text("i am a cow", 1)), 1))
+ * - check("{i @am a @cow}", _.BraceBlock.run(),
+ Block(Seq(
+ Block.Text("i ", 1),
+ Chain("am",Seq(), 3),
+ Block.Text(" a ", 6),
+ Chain("cow",Seq(), 9)
+ ), 1)
+ )
+ }
+ 'Chain{
+ * - check("@omg.bbq[omg].fff[fff](123) ", _.ScalaChain.run(),
+ Chain("omg",Seq(
+ Chain.Prop("bbq", 4),
+ Chain.TypeArgs("[omg]", 8),
+ Chain.Prop("fff", 13),
+ Chain.TypeArgs("[fff]", 17),
+ Chain.Args("(123)", 22)
+ ))
+ )
+ * - check("@omg{bbq}.cow(moo){a @b}\n", _.ScalaChain.run(),
+ Chain("omg",Seq(
+ Block(Seq(Text("bbq", 5)), 5),
+ Chain.Prop("cow", 9),
+ Chain.Args("(moo)", 13),
+ Block(Seq(Text("a ", 19), Chain("b", Nil, 21)), 19)
+ ))
+ )
+ }
+ 'ControlFlow{
+ 'for {
+ 'for - check(
+ "@for(x <- 0 until 3){lol}",
+ _.ForLoop.run(),
+ For("for(x <- 0 until 3)", Block(Seq(Text("lol", 21)), 21))
+ )
+ 'forBlock - check(
+ """
+ |@for(x <- 0 until 3)
+ | lol""".stripMargin,
+ _.Body.run(),
+ Block(Seq(
+ Text("\n"),
+ For(
+ "for(x <- 0 until 3)",
+ Block(Seq(Text("\n ", 21), Text("lol", 24)), 21),
+ 1
+ )
+ ))
+ )
+ 'forBlockBraces - check(
+ """
+ |@for(x <- 0 until 3){
+ | lol
+ |}""".stripMargin,
+ _.Body.run(),
+ Block(Seq(
+ Text("\n"),
+ For(
+ "for(x <- 0 until 3)",
+ Block(Seq(Text("\n ", 22), Text("lol", 25), Text("\n", 28)), 22),
+ 1
+ )
+ ))
+ )
+ }
+ 'ifElse {
+ 'if - check(
+ "@if(true){lol}",
+ _.IfElse.run(),
+ IfElse("if(true)", Block(Seq(Text("lol", 10)), 10), None)
+ )
+ 'ifElse - check(
+ "@if(true){lol}else{ omg }",
+ _.IfElse.run(),
+ IfElse("if(true)", Block(Seq(Text("lol", 10)), 10), Some(Block(Seq(Text(" omg ", 19)), 19)))
+ )
+ 'ifBlock - check(
+ """
+ |@if(true)
+ | omg""".stripMargin,
+ _.IfElse.run(),
+ IfElse("if(true)", Block(Seq(Text("\n ", 10), Text("omg", 13)), 10), None, 1)
+ )
+ 'ifBlockElseBlock - check(
+ """
+ |@if(true)
+ | omg
+ |@else
+ | wtf""".stripMargin,
+ _.IfElse.run(),
+ IfElse(
+ "if(true)",
+ Block(Seq(Text("\n ", 10), Text("omg", 13)), 10),
+ Some(Block(Seq(Text("\n ", 22), Text("wtf", 25)), 22)),
+ 1
+ )
+ )
+ 'ifBlockElseBraceBlock - check(
+ """@if(true){
+ | omg
+ |}else{
+ | wtf
+ |}""".stripMargin,
+ _.IfElse.run(),
+ IfElse(
+ "if(true)",
+ Block(Seq(Text("\n ", 10), Text("omg", 13), Text("\n", 16)), 10),
+ Some(Block(Seq(Text("\n ", 23), Text("wtf", 26), Text("\n", 29)), 23)),
+ 0
+ )
+ )
+ 'ifBlockElseBraceBlockNested - {
+ val res = Parser(Trim.old(
+ """
+ @p
+ @if(true){
+ Hello
+ }else{
+ lols
+ }
+ """))
+ val expected =
+ Block(Vector(
+ Text("\n"),
+ Chain("p",Vector(Block(Vector(
+ Text("\n ", 3),
+ IfElse("if(true)",
+ Block(Vector(
+ Text("\n ", 16), Text("Hello", 21), Text("\n ", 26)
+ ), 16),
+ Some(Block(Vector(
+ Text("\n ", 35), Text("lols", 40), Text("\n ", 44)
+ ), 35)),
+ 6
+ )), 3)), 1),
+ Text("\n", 48)
+ ))
+ assert(res == expected)
+ }
+ 'ifElseBlock - check(
+ """@if(true){
+ | omg
+ |}else
+ | wtf""".stripMargin,
+ _.IfElse.run(),
+ IfElse(
+ "if(true)",
+ Block(Seq(Text("\n ", 10), Text("omg", 13), Text("\n", 16)), 10),
+ Some(Block(Seq(Text("\n ", 22), Text("wtf", 25)), 22))
+ )
+ )
+ }
+
+ }
+ 'Body{
+ 'indents - check(
+ """
+ |@omg
+ | @wtf
+ | @bbq
+ | @lol""".stripMargin,
+ _.Body.run(),
+ Block(Seq(
+ Text("\n"),
+ Chain("omg",Seq(Block(Seq(
+ Text("\n ", 5),
+ Chain("wtf",Seq(Block(Seq(
+ Text("\n ", 7),
+ Chain("bbq",Seq(Block(Seq(
+ Text("\n ", 9),
+ Chain("lol",Seq(), 16)
+ ), 9)), 12)
+ ), 7)), 8)
+ ), 5)), 1)
+ ))
+ )
+ 'dedents - check(
+ """
+ |@omg
+ | @wtf
+ |@bbq""".stripMargin,
+ _.Body.run(),
+ Block(Seq(
+ Text("\n"),
+ Chain("omg",Seq(Block(
+ Seq(
+ Text("\n ", 5),
+ Chain("wtf",Seq(), 8)
+ ),
+ 5
+ )), 1),
+ Text("\n", 12),
+ Chain("bbq", Seq(), 13)
+ ))
+ )
+ 'braces - check(
+ """
+ |@omg{
+ | @wtf
+ |}
+ |@bbq""".stripMargin,
+ _.Body.run(),
+ Block(Seq(
+ Text("\n"),
+ Chain("omg",Seq(Block(
+ Seq(
+ Text("\n ", 6),
+ Chain("wtf",Seq(), 9),
+ Text("\n", 13)
+ ),
+ 6
+ )), 1),
+ Text("\n", 15),
+ Chain("bbq", Seq(), 16)
+ ))
+ )
+ 'dedentText - check(
+ """
+ |@omg("lol", 1, 2)
+ | @wtf
+ |bbq""".stripMargin,
+ _.Body.run(),
+ Block(Seq(
+ Text("\n"),
+ Chain("omg",Seq(
+ Args("""("lol", 1, 2)""", 5),
+ Block(Seq(
+ Text("\n ", 18),
+ Chain("wtf",Seq(), 21)
+ ), 18)
+ ), 1),
+ Text("\n", 25),
+ Text("bbq", 26)
+ ))
+ )
+ * - check(
+ """
+ |@omg("lol",
+ |1,
+ | 2
+ | )
+ | wtf
+ |bbq""".stripMargin,
+ _.Body.run(),
+ Block(Seq(
+ Text("\n", 0),
+ Chain("omg",Seq(
+ Args("(\"lol\",\n1,\n 2\n )", 5),
+ Block(Seq(
+ Text("\n ", 30), Text("wtf", 33)
+ ), 30)
+ ), 1),
+ Text("\n", 36),
+ Text("bbq", 37)
+ ), 0)
+ )
+ 'codeBlock - check(
+ """@{
+ | val omg = "omg"
+ | omg * 2
+ |}""".stripMargin,
+ _.Code.run(),
+ """{
+ | val omg = "omg"
+ | omg * 2
+ |}""".stripMargin
+ )
+ 'codeBlocks - check(
+ """
+ |@{"lol" * 3}
+ |@{
+ | val omg = "omg"
+ | omg * 2
+ |}""".stripMargin,
+ _.Body.run(),
+ Block(Seq(
+ Text("\n"),
+ Chain("{\"lol\" * 3}", Seq(), 1),
+ Text("\n", 13),
+ Chain("""{
+ | val omg = "omg"
+ | omg * 2
+ |}""".stripMargin,
+ Seq(),
+ 14
+ )
+ ))
+ )
+ }
+// 'Test{
+// check(
+// "@{() => ()}",
+// _.Code.run(),
+// ""
+// )
+// }
+ }
+}
+
+
+
diff --git a/scalatexApi/src/test/scala/scalatex/TestUtil.scala b/scalatexApi/src/test/scala/scalatex/TestUtil.scala
new file mode 100644
index 0000000..5a72677
--- /dev/null
+++ b/scalatexApi/src/test/scala/scalatex/TestUtil.scala
@@ -0,0 +1,16 @@
+package scalatex
+
+import utest._
+
+
+object TestUtil {
+ implicit def stringify(f: scalatags.Text.all.Frag) = f.render
+ def check(rendered: String*) = {
+ val collapsed = rendered.map(collapse)
+ val first = collapsed(0)
+ assert(collapsed.forall(_ == first))
+ }
+ def collapse(s: String): String = {
+ s.replaceAll("[ \n]", "")
+ }
+}
diff --git a/scalatexPlugin/src/main/resources/scalac-plugin.xml b/scalatexPlugin/src/main/resources/scalac-plugin.xml
new file mode 100755
index 0000000..d4062fa
--- /dev/null
+++ b/scalatexPlugin/src/main/resources/scalac-plugin.xml
@@ -0,0 +1,4 @@
+<plugin>
+ <name>demo-plugin</name>
+ <classname>scalatex.ScalaTexPlugin</classname>
+</plugin> \ No newline at end of file
diff --git a/scalatexPlugin/src/main/scala/scalatex/ScalaTexPlugin.scala b/scalatexPlugin/src/main/scala/scalatex/ScalaTexPlugin.scala
new file mode 100755
index 0000000..6686258
--- /dev/null
+++ b/scalatexPlugin/src/main/scala/scalatex/ScalaTexPlugin.scala
@@ -0,0 +1,66 @@
+package scalatex
+
+import java.nio.file.Paths
+
+import scala.reflect.internal.util.BatchSourceFile
+import scala.reflect.io.VirtualFile
+import scala.tools.nsc.{ Global, Phase }
+import scala.tools.nsc.plugins.{ Plugin, PluginComponent }
+
+class ScalaTexPlugin(val global: Global) extends Plugin {
+ import global._
+ println(options)
+ val name = "scalatex-plugin"
+ val description = "Enforces coding standards"
+ val components = List[PluginComponent](DemoComponent)
+ private object DemoComponent extends PluginComponent {
+ val global = ScalaTexPlugin.this.global
+ import global._
+
+ override val runsAfter = List("parser")
+ override val runsBefore = List("namer")
+
+ val phaseName = "Demo"
+ val scalatexRoot = "book/src/main/scalatex"
+ override def newPhase(prev: Phase) = new GlobalPhase(prev) {
+ override def run() = {
+ def recursiveListFiles(f: java.io.File): Array[java.io.File] = {
+ val (dirs, files) = f.listFiles().partition(_.isDirectory)
+ files ++ dirs.flatMap(recursiveListFiles)
+ }
+ for (file <- recursiveListFiles(new java.io.File(scalatexRoot))) {
+ val txt = io.Source.fromFile(file).mkString
+ val fakeJfile = new java.io.File(file.getName)
+ val virtualFile = new VirtualFile(file.getName) {
+ override def file = fakeJfile
+ }
+ val sourceFile = new BatchSourceFile(virtualFile, txt)
+ val unit = new CompilationUnit(sourceFile)
+ val name = file.getName
+ val objectName = name.slice(name.lastIndexOf('/'), name.lastIndexOf('.'))
+ val pkgName =
+ Paths.get(scalatexRoot)
+ .relativize(file.getParentFile.toPath)
+ .toString
+ .split("/")
+ .map(s => s"package $s")
+ .mkString("\n")
+
+ val shim = s"""
+ $pkgName
+ import scalatags.Text.all._
+ object $objectName{
+ def apply() = scalatex.twf("${file.getPath}")
+ }
+ """
+ unit.body = global.newUnitParser(shim).parse()
+ global.currentRun.compileLate(unit)
+ }
+ }
+
+ def name: String = phaseName
+
+ def apply(unit: global.CompilationUnit): Unit = {}
+ }
+ }
+}
diff --git a/test.txt b/test.txt
new file mode 100644
index 0000000..a36a573
--- /dev/null
+++ b/test.txt
@@ -0,0 +1,3 @@
+class Parser {
+ {() => }
+}