Skip to content

Instantly share code, notes, and snippets.

View sjrd's full-sized avatar

Sébastien Doeraene sjrd

View GitHub Profile
@sjrd
sjrd / CompatParColls.scala
Created March 22, 2017 12:54
Compat code for parallel collections across 2.10/2.11/2.12 and 2.13
package test
private[test] object CompatParColls {
val Converters = {
import Compat._
{
import scala.collection.parallel._
CollectionConverters
@sjrd
sjrd / WithGlobals.scala
Created April 30, 2017 22:20
I wrote a monad
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js tools **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2017, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-js.org/ **
** /____/\___/_/ |_/____/_/ | |__/ /____/ **
** |/____/ **
\* */
package org.scalajs.core.tools.linker.backend.emitter
@sjrd
sjrd / build.sbt
Created May 28, 2017 08:24
CrossProject Pure with Eclipse, requires 'set every EclipseKeys.useProjectId := true'
scalaVersion in ThisBuild := "2.11.11"
version in ThisBuild := "0.1-SNAPSHOT"
lazy val foo = crossProject.crossType(CrossType.Pure).
settings(
)
lazy val fooJS = foo.js
lazy val fooJVM = foo.jvm
diff --cc ci/matrix.xml
index ca9989d,6772179..0000000
--- a/ci/matrix.xml
+++ b/ci/matrix.xml
@@@ -99,13 -155,16 +99,13 @@@
<task id="test-suite-ecma-script6"><![CDATA[
setJavaVersion $java
+ npm install &&
sbtretry 'set scalaJSOutputMode in $testSuite := org.scalajs.core.tools.linker.backend.OutputMode.ECMAScript6' \
diff --cc compiler/src/main/scala/org/scalajs/core/compiler/GenJSCode.scala
index 08efc4c,502a57b..0000000
--- a/compiler/src/main/scala/org/scalajs/core/compiler/GenJSCode.scala
+++ b/compiler/src/main/scala/org/scalajs/core/compiler/GenJSCode.scala
@@@ -4302,22 -4265,55 +4291,55 @@@ abstract class GenJSCode extends plugin
}
}
- def genSelectGet(propName: js.Tree): js.Tree =
+ def genSelectGet(propName: js.Tree): js.Tree = {
[info] * Attributed(/localhome/doeraene/projects/scalajs/tools/jvm/target/scala-2.12/scalajs-tools_2.12-0.6.19-SNAPSHOT.jar)
[info] * Attributed(/localhome/doeraene/projects/scalajs/ir/target/scala-2.12/scalajs-ir_2.12-0.6.19-SNAPSHOT.jar)
[info] * Attributed(/localhome/doeraene/projects/scalajs/js-envs/target/scala-2.12/classes)
[info] * Attributed(/localhome/doeraene/projects/scalajs/test-adapter/target/scala-2.12/classes)
[info] * Attributed(/home/doeraene/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.12.2.jar)
[info] * Attributed(/home/doeraene/.ivy2/cache/org.scala-js/closure-compiler-java-6/jars/closure-compiler-java-6-v20160517.jar)
[info] * Attributed(/home/doeraene/.ivy2/cache/org.scala-js/closure-compiler-externs-java-6/jars/closure-compiler-externs-java-6-v20160517.jar)
[info] * Attributed(/home/doeraene/.ivy2/cache/args4j/args4j/bundles/args4j-2.0.26.jar)
[info] * Attributed(/home/doeraene/.ivy2/cache/com.google.guava/guava/bundles/guava-19.0.jar)
[info] * Attributed(/home/doeraene
master
warm, compile
[info] [generate JavaScript code from ASTs in 4051ms]
4057ms
3886ms
cold, batch
diff --cc ir/src/main/scala/org/scalajs/core/ir/ScalaJSVersions.scala
index f7c6b68,d9f10f9..0000000
--- a/ir/src/main/scala/org/scalajs/core/ir/ScalaJSVersions.scala
+++ b/ir/src/main/scala/org/scalajs/core/ir/ScalaJSVersions.scala
diff --cc project/Build.scala
index d985a48,1cb00ad..0000000
--- a/project/Build.scala
+++ b/project/Build.scala
@@@ -2,12 -3,6 +2,9 @@@ import scala.language.implicitConversio
> pineJS/test:compile
[info] Updating {file:/C:/Users/Sepi/Documents/Projets/pine/}pineJS...
[info] Resolving org.eclipse.jetty#jetty-continuation;8.1.16.v20140903 ...
[info] Done updating.
[info] Compiling 29 Scala sources to C:\Users\Sepi\Documents\Projets\pine\js\target\scala-2.12\classes...
[warn] there was one deprecation warning (since DOM Level 2)
[warn] there was one deprecation warning (since HTML 4)
[warn] there was one deprecation warning (since HTML 4.01)
[warn] there were three deprecation warnings (since HTML 5)
[warn] there were 6 deprecation warnings in total; re-run with -deprecation for details
@sjrd
sjrd / scalajs-testsuite-fastopt.js.diff
Created November 14, 2017 14:44
Intrinsify `js.Dictionary.apply` and `js.Dynamic.literal`
--- ../scalajs-test-suite-test-fastopt.js 2017-11-14 13:16:00.385812067 +0100
+++ test-suite/js/target/scala-2.12/scalajs-test-suite-test-fastopt.js 2017-11-14 15:26:23.517059382 +0100
@@ -4168,22 +4168,25 @@
return passedThis$2
})
})($thiz));
+ var y = (function(arg$outer) {
+ return (function() {
+ return this
+ })