Skip to content

Instantly share code, notes, and snippets.

View sjrd's full-sized avatar

Sébastien Doeraene sjrd

View GitHub Profile
diff --git "a/C:\\Users\\Sepi\\Documents\\Projets\\scalajs-test-suite-test-fastopt.js" "b/C:\\Users\\Sepi\\Documents\\Projets\\scalajs\\test-suite\\js\\target\\scala-2.11\\scalajs-test-suite-test-fastopt.js"
index 1b121cd..24aedbb 100644
--- "a/C:\\Users\\Sepi\\Documents\\Projets\\scalajs-test-suite-test-fastopt.js"
+++ "b/C:\\Users\\Sepi\\Documents\\Projets\\scalajs\\test-suite\\js\\target\\scala-2.11\\scalajs-test-suite-test-fastopt.js"
@@ -31557,6 +31557,7 @@ $c_Lorg_scalajs_testsuite_compiler_OptimizerTest.prototype.side$undeffect$unddis
})
})(this, b);
var x$2 = $uI(this.org$scalajs$testsuite$compiler$OptimizerTest$$get$1__O__scm_ArrayBuilder__O(1, b));
+ $uI(f());
this.mockPrintln$1__p1__O__scm_ArrayBuilder__V(((x$2 + $uI(f())) | 0), b);
@sjrd
sjrd / scalajs-test-suite-test-fastopt.js.diff
Created June 20, 2016 11:33
Test suite diff for #2478
--- ../scalajs-test-suite-test-fastopt.js 2016-06-20 11:59:45.273513648 +0200
+++ test-suite/js/target/scala-2.11/scalajs-test-suite-test-fastopt.js 2016-06-20 13:17:40.497416775 +0200
@@ -1238,18 +1238,11 @@
if ($m_Lorg_scalajs_testsuite_compiler_TC$().is__I__Z(42)) {
throw new $c_Lorg_scalajs_testsuite_compiler_TestException().init___I(238)
};
- if ((kv !== null)) {
- var k = $as_T(kv.$$und1__O());
- var v$1 = $as_Lorg_scalajs_testsuite_compiler_JsValue(kv.$$und2__O());
- var x$3_$_$$und1$f = k;
@sjrd
sjrd / scalajs-test-suite-test-fastopt.js.diff
Created June 20, 2016 12:49
Test suite diff of #2479
--- ../scalajs-test-suite-test-fastopt.js 2016-06-20 11:59:45.273513648 +0200
+++ test-suite/js/target/scala-2.11/scalajs-test-suite-test-fastopt.js 2016-06-20 14:35:19.945320230 +0200
@@ -8937,7 +8937,7 @@
source.addAll__ju_Collection__Z($s_sc_convert_WrapAsJava$class__seqAsJavaList__sc_convert_WrapAsJava__sc_Seq__ju_List(this$45, seq$3));
var this$53 = $m_Lorg_junit_Assert$();
var this$46 = $$this.range__sci_Range();
- var expected$2 = $imul(2, this$46.length__I());
+ var expected$2 = (this$46.length__I() << 1);
var targetSize$4 = target.size__I();
if ((targetSize$4 === 0)) {
@sjrd
sjrd / test-suite-fastopt.js.diff
Created June 28, 2016 22:37
RuntimeLong optimizations
This file has been truncated, but you can view the full file.
diff --git "a/C:\\Users\\Sepi\\Documents\\Projets\\scalajs-test-suite-test-fastopt.js" "b/C:\\Users\\Sepi\\Documents\\Projets\\scalajs\\test-suite\\js\\target\\scala-2.11\\scalajs-test-suite-test-fastopt.js"
index 6ac58c3..edb5b0f 100644
--- "a/C:\\Users\\Sepi\\Documents\\Projets\\scalajs-test-suite-test-fastopt.js"
+++ "b/C:\\Users\\Sepi\\Documents\\Projets\\scalajs\\test-suite\\js\\target\\scala-2.11\\scalajs-test-suite-test-fastopt.js"
@@ -1366,15 +1366,17 @@ function $s_Lorg_scalajs_testsuite_javalib_io_CommonStreamsTests$class__should$u
};
stream.reset__V();
var this$21 = $m_Lorg_junit_Assert$();
- var actual$5 = stream.skip__J__J(new $c_sjsr_RuntimeLong().init___I__I(40, 0));
- this$21.assertEquals__T__O__O__V(null, new $c_sjsr_RuntimeLong().init___I__I(40, 0), actual$5);
@sjrd
sjrd / compile-errors.txt
Created September 9, 2016 12:03
Compile errors with 2.12.0-RC1
> ;++2.12.0-RC1;testSuiteJVM/test
[info] Setting version to 2.12.0-RC1
[info] Reapplying settings...
[info] Set current project to scalajs-java-time (in build file:/localhome/doeraene/projects/scalajs-java-time/)
[info] Compiling 23 Scala sources to /localhome/doeraene/projects/scalajs-java-time/testSuite/jvm/target/scala-2.12.0-RC1/test-classes...
[error] /localhome/doeraene/projects/scalajs-java-time/testSuite/shared/src/test/scala/org/scalajs/testsuite/javalib/time/PeriodTest.scala:32: value getYears is not a member of java.time.temporal.TemporalAmount
[error] assertEquals(p.getYears.toLong, p.get(YEARS))
[error] ^
[error] /localhome/doeraene/projects/scalajs-java-time/testSuite/shared/src/test/scala/org/scalajs/testsuite/javalib/time/PeriodTest.scala:33: value getMonths is not a member of java.time.temporal.TemporalAmount
[error] assertEquals(p.getMonths.toLong, p.get(MONTHS))
@sjrd
sjrd / ImprovedInference.scala
Last active September 9, 2016 13:27
Scala 2.12.0-RC1's new inference improves JS interop!
package helloworld
import scala.scalajs.js
import js.|
import js.annotation._
@ScalaJSDefined
trait Foo extends js.Object {
val bar: Int | String
val baz: js.UndefOr[Int]
(function(){
'use strict';
/* Scala.js runtime support
* Copyright 2013 LAMP/EPFL
* Author: Sébastien Doeraene
*/
/* ---------------------------------- *
* The top-level Scala.js environment *
* ---------------------------------- */
diff --git a/src/main/scala/org/scalajs/dom/experimental/push/PushManager.scala b/src/main/scala/org/scalajs/dom/experimental/push/PushManager.scala
index f721e20..da5005b 100644
--- a/src/main/scala/org/scalajs/dom/experimental/push/PushManager.scala
+++ b/src/main/scala/org/scalajs/dom/experimental/push/PushManager.scala
@@ -41,7 +41,8 @@ trait PushManager extends js.Object {
* MDN
*/
def permissionState(
- options: PushSubscriptionOptions = js.native): js.Promise[PushPermissionState] = js.native
+ options: PushSubscriptionOptions = js.native): js.Promise[
@inline
def *(b: RuntimeLong): RuntimeLong = {
val alo = a.lo
val blo = b.lo
val a0 = alo & 0xffff
val a1 = alo >>> 16
val b0 = blo & 0xffff
val b1 = blo >>> 16
@sjrd
sjrd / ScalaJSRewrites.scala
Created March 21, 2017 09:38
scalafix rewrites for Scala.js: migrate facades to using @jsglobal, new in Scala.js 0.6.15
package scalafix.rewrite
import scala.collection.immutable.Seq
import scala.meta._
import scala.meta.contrib._
import scalafix.util.Patch
import scalafix.util.TokenPatch._
import scalafix.util.TreePatch.AddGlobalImport
import scalafix.util.TreePatch.Rename