Created
September 3, 2018 12:37
-
-
Save sjrd/5ee853e05fde880e01e0b15cb25ddee8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --cc ci/checksizes.sh | |
index ea2bc7b11,38da8916e..000000000 | |
--- a/ci/checksizes.sh | |
+++ b/ci/checksizes.sh | |
@@@ -17,7 -20,10 +17,10 @@@ case $FULLVER i | |
2.13.0-M4) | |
VER=2.13.0-M4 | |
;; | |
+ 2.13.0-M5) | |
+ VER=2.13.0-M5 | |
+ ;; | |
- 2.10.3|2.10.4|2.10.5|2.10.6|2.10.7|2.11.0|2.11.1|2.11.2|2.11.4|2.11.5|2.11.6|2.11.7|2.11.8|2.11.11|2.12.0|2.12.1|2.12.2|2.12.3|2.12.4|2.12.5) | |
+ 2.11.0|2.11.1|2.11.2|2.11.4|2.11.5|2.11.6|2.11.7|2.11.8|2.11.11|2.12.1|2.12.2|2.12.3|2.12.4|2.12.5) | |
echo "Ignoring checksizes for Scala $FULLVER" | |
exit 0 | |
;; | |
@@@ -36,30 -42,42 +39,36 @@@ REVERSI_PREOPT_GZ_SIZE=$(stat '-c%s' "$ | |
REVERSI_OPT_GZ_SIZE=$(stat '-c%s' "$REVERSI_OPT.gz") | |
case $FULLVER in | |
- 2.10.2) | |
- REVERSI_PREOPT_EXPECTEDSIZE=533000 | |
- REVERSI_OPT_EXPECTEDSIZE=122000 | |
- REVERSI_PREOPT_GZ_EXPECTEDSIZE=71000 | |
- REVERSI_OPT_GZ_EXPECTEDSIZE=31000 | |
- ;; | |
2.11.12) | |
- REVERSI_PREOPT_EXPECTEDSIZE=530000 | |
- REVERSI_OPT_EXPECTEDSIZE=124000 | |
- REVERSI_PREOPT_GZ_EXPECTEDSIZE=72000 | |
- REVERSI_OPT_GZ_EXPECTEDSIZE=32000 | |
+ REVERSI_PREOPT_EXPECTEDSIZE=509000 | |
+ REVERSI_OPT_EXPECTEDSIZE=116000 | |
+ REVERSI_PREOPT_GZ_EXPECTEDSIZE=69000 | |
+ REVERSI_OPT_GZ_EXPECTEDSIZE=30000 | |
;; | |
2.12.6) | |
- REVERSI_PREOPT_EXPECTEDSIZE=618000 | |
- REVERSI_OPT_EXPECTEDSIZE=144000 | |
- REVERSI_PREOPT_GZ_EXPECTEDSIZE=74000 | |
- REVERSI_OPT_GZ_EXPECTEDSIZE=32000 | |
+ REVERSI_PREOPT_EXPECTEDSIZE=593000 | |
+ REVERSI_OPT_EXPECTEDSIZE=135000 | |
+ REVERSI_PREOPT_GZ_EXPECTEDSIZE=71000 | |
+ REVERSI_OPT_GZ_EXPECTEDSIZE=30000 | |
;; | |
2.13.0-M3) | |
- REVERSI_PREOPT_EXPECTEDSIZE=630000 | |
- REVERSI_OPT_EXPECTEDSIZE=147000 | |
- REVERSI_PREOPT_GZ_EXPECTEDSIZE=77000 | |
- REVERSI_OPT_GZ_EXPECTEDSIZE=33000 | |
+ REVERSI_PREOPT_EXPECTEDSIZE=605000 | |
+ REVERSI_OPT_EXPECTEDSIZE=138000 | |
+ REVERSI_PREOPT_GZ_EXPECTEDSIZE=74000 | |
+ REVERSI_OPT_GZ_EXPECTEDSIZE=32000 | |
;; | |
2.13.0-M4) | |
- REVERSI_PREOPT_EXPECTEDSIZE=581000 | |
- REVERSI_OPT_EXPECTEDSIZE=136000 | |
- REVERSI_PREOPT_GZ_EXPECTEDSIZE=78000 | |
- REVERSI_OPT_GZ_EXPECTEDSIZE=34000 | |
+ REVERSI_PREOPT_EXPECTEDSIZE=559000 | |
+ REVERSI_OPT_EXPECTEDSIZE=128000 | |
+ REVERSI_PREOPT_GZ_EXPECTEDSIZE=75000 | |
+ REVERSI_OPT_GZ_EXPECTEDSIZE=33000 | |
;; | |
+ 2.13.0-M5) | |
- REVERSI_PREOPT_EXPECTEDSIZE=613000 | |
- REVERSI_OPT_EXPECTEDSIZE=143000 | |
- REVERSI_PREOPT_GZ_EXPECTEDSIZE=81000 | |
- REVERSI_OPT_GZ_EXPECTEDSIZE=36000 | |
++ REVERSI_PREOPT_EXPECTEDSIZE=597000 | |
++ REVERSI_OPT_EXPECTEDSIZE=137000 | |
++ REVERSI_PREOPT_GZ_EXPECTEDSIZE=80000 | |
++ REVERSI_OPT_GZ_EXPECTEDSIZE=35000 | |
+ ;; | |
esac | |
echo "Checksizes: Scala version: $FULLVER" | |
diff --cc javalanglib/src/main/scala/java/lang/Throwables.scala | |
index efe76e157,b5d737c7e..000000000 | |
--- a/javalanglib/src/main/scala/java/lang/Throwables.scala | |
+++ b/javalanglib/src/main/scala/java/lang/Throwables.scala | |
@@@ -1,17 -1,25 +1,27 @@@ | |
package java.lang | |
import scala.scalajs.js | |
+import scala.scalajs.js.annotation.JSExport | |
- class Throwable(s: String, private var e: Throwable) extends Object with java.io.Serializable { | |
+ class Throwable protected (s: String, private var e: Throwable, | |
+ enableSuppression: scala.Boolean, writableStackTrace: scala.Boolean) | |
+ extends Object with java.io.Serializable { | |
+ | |
+ def this(message: String, cause: Throwable) = this(message, cause, true, true) | |
def this() = this(null, null) | |
def this(s: String) = this(s, null) | |
def this(e: Throwable) = this(if (e == null) null else e.toString, e) | |
+ private[this] var stackTraceStateInternal: Any = _ | |
private[this] var stackTrace: Array[StackTraceElement] = _ | |
- fillInStackTrace() | |
+ /* We use an Array rather than, say, a List, so that Throwable does not | |
+ * depend on the Scala collections. | |
+ */ | |
+ private[this] var suppressed: Array[Throwable] = _ | |
+ | |
+ if (writableStackTrace) | |
+ fillInStackTrace() | |
def initCause(cause: Throwable): Throwable = { | |
e = cause | |
@@@ -27,21 -35,13 +37,25 @@@ | |
this | |
} | |
+ /* Not part of the JDK API, used internally in java.lang and accessible | |
+ * through reflection. | |
+ */ | |
+ def getStackTraceStateInternal(): Any = | |
+ stackTraceStateInternal | |
+ | |
+ /* Not part of the JDK API, used internally in java.lang and accessible | |
+ * through reflection. | |
+ */ | |
+ def setStackTraceStateInternal(e: Any): Unit = | |
+ stackTraceStateInternal = e | |
+ | |
def getStackTrace(): Array[StackTraceElement] = { | |
- if (stackTrace eq null) | |
- stackTrace = StackTrace.extract(this) | |
+ if (stackTrace eq null) { | |
+ if (writableStackTrace) | |
- stackTrace = scala.scalajs.runtime.StackTrace.extract(this) | |
++ stackTrace = StackTrace.extract(this) | |
+ else | |
+ stackTrace = new Array[StackTraceElement](0) | |
+ } | |
stackTrace | |
} | |
@@@ -136,22 -134,31 +152,48 @@@ | |
else className + ": " + message | |
} | |
+ def addSuppressed(exception: Throwable): Unit = { | |
+ if (exception eq null) | |
+ throw new NullPointerException | |
+ if (exception eq this) | |
+ throw new IllegalArgumentException | |
+ | |
+ if (enableSuppression) { | |
+ if (suppressed eq null) { | |
+ suppressed = Array(exception) | |
+ } else { | |
+ val length = suppressed.length | |
+ val newSuppressed = new Array[Throwable](length + 1) | |
+ System.arraycopy(suppressed, 0, newSuppressed, 0, length) | |
+ newSuppressed(length) = exception | |
+ suppressed = newSuppressed | |
+ } | |
+ } | |
+ } | |
+ | |
+ def getSuppressed(): Array[Throwable] = { | |
+ if (suppressed eq null) | |
+ new Array(0) | |
+ else | |
+ suppressed.clone() | |
+ } | |
++ | |
+ /* A JavaScript Error object should have a `name` property containing a | |
+ * string representation of the class of the error. | |
+ */ | |
+ @JSExport("name") | |
+ @inline | |
+ protected def js_name: String = getClass.getName | |
+ | |
+ /* A JavaScript Error object should have a `message` property containing a | |
+ * string representation of the message associated with the error. | |
+ */ | |
+ @JSExport("message") | |
+ @inline | |
+ protected def js_message: String = { | |
+ val m = getMessage() | |
+ if (m eq null) "" else m | |
+ } | |
} | |
class ThreadDeath() extends Error() | |
diff --cc library/src/main/scala-new-collections/scala/scalajs/js/Any.scala | |
index 2fc52f692,56d2af60f..000000000 | |
--- a/library/src/main/scala-new-collections/scala/scalajs/js/Any.scala | |
+++ b/library/src/main/scala-new-collections/scala/scalajs/js/Any.scala | |
@@@ -57,184 -56,151 +59,202 @@@ trait Any extends scala.AnyRe | |
/** Provides implicit conversions from Scala values to JavaScript values. */ | |
object Any extends LowPrioAnyImplicits { | |
- @inline implicit def fromUnit(value: Unit): Any = | |
- value.asInstanceOf[Any] | |
- @inline implicit def fromBoolean(value: Boolean): Any = | |
- value.asInstanceOf[Any] | |
- @inline implicit def fromByte(value: Byte): Any = | |
- value.asInstanceOf[Any] | |
- @inline implicit def fromShort(value: Short): Any = | |
- value.asInstanceOf[Any] | |
- @inline implicit def fromInt(value: Int): Any = | |
- value.asInstanceOf[Any] | |
- @inline implicit def fromLong(value: Long): Any = | |
- value.toDouble.asInstanceOf[Any] | |
- @inline implicit def fromFloat(value: Float): Any = | |
- value.asInstanceOf[Any] | |
- @inline implicit def fromDouble(value: Double): Any = | |
- value.asInstanceOf[Any] | |
- @inline implicit def fromString(s: String): Any = | |
- s.asInstanceOf[Any] | |
- | |
- implicit def jsArrayOps[A](array: Array[A]): ArrayOps[A] = | |
+ @inline implicit def fromUnit(value: Unit): js.Any = | |
+ value.asInstanceOf[js.Any] | |
+ @inline implicit def fromBoolean(value: Boolean): js.Any = | |
+ value.asInstanceOf[js.Any] | |
+ @inline implicit def fromByte(value: Byte): js.Any = | |
+ value.asInstanceOf[js.Any] | |
+ @inline implicit def fromShort(value: Short): js.Any = | |
+ value.asInstanceOf[js.Any] | |
+ @inline implicit def fromInt(value: Int): js.Any = | |
+ value.asInstanceOf[js.Any] | |
+ @inline implicit def fromFloat(value: Float): js.Any = | |
+ value.asInstanceOf[js.Any] | |
+ @inline implicit def fromDouble(value: Double): js.Any = | |
+ value.asInstanceOf[js.Any] | |
+ @inline implicit def fromString(s: String): js.Any = | |
+ s.asInstanceOf[js.Any] | |
+ | |
+ /* The following overload makes sure that the developer does not | |
+ * inadvertently convert a Long to a Double to fit it in a js.Any. | |
+ */ | |
+ @deprecated( | |
+ "A Long is converted to Double to be cast to js.Any. " + | |
+ "This is almost certainly not what you want. " + | |
+ "Use `.toDouble` explicitly if you need it.", | |
+ "forever") | |
+ @inline | |
+ implicit def fromLong(value: Long): js.Any = | |
+ value.toDouble.asInstanceOf[js.Any] | |
+ | |
+ implicit def jsArrayOps[A](array: js.Array[A]): js.ArrayOps[A] = | |
new ArrayOps(array) | |
- implicit def buildFromArray[A]: BuildFrom[Array[_], A, Array[A]] = { | |
+ implicit def buildFromArray[A]: BuildFrom[js.Array[_], A, js.Array[A]] = { | |
@inline | |
- class BuildFromArray extends BuildFrom[Array[_], A, Array[A]] { | |
- def fromSpecific(from: Array[_])( | |
- it: scala.collection.IterableOnce[A]): Array[A] = { | |
+ class BuildFromArray extends BuildFrom[js.Array[_], A, js.Array[A]] { | |
- def fromSpecificIterable(from: js.Array[_])( | |
- it: scala.collection.Iterable[A]): js.Array[A] = { | |
++ def fromSpecific(from: js.Array[_])( | |
++ it: scala.collection.IterableOnce[A]): js.Array[A] = { | |
val b = newBuilder(from) | |
b.sizeHint(it) | |
b ++= it | |
b.result() | |
} | |
- def newBuilder(from: Array[_]): mutable.Builder[A, Array[A]] = | |
+ def newBuilder(from: js.Array[_]): mutable.Builder[A, js.Array[A]] = | |
- new js.ArrayOps[A] | |
+ new ArrayBuilder[A]() | |
} | |
new BuildFromArray | |
} | |
+ @inline | |
+ private class ArrayBuilder[A] extends mutable.Builder[A, js.Array[A]] { | |
+ private[this] var array: js.Array[A] = js.Array() | |
+ | |
+ def addOne(elem: A): this.type = { | |
+ array.push(elem) | |
+ this | |
+ } | |
+ | |
+ def result(): js.Array[A] = | |
+ array | |
+ | |
+ def clear(): Unit = { | |
+ // need to create a new one so that the builder is reusable | |
+ array = js.Array() | |
+ } | |
+ } | |
+ | |
// scalastyle:off line.size.limit | |
- /* identity() is important! It prevents the tail-rec treatment in the absence | |
- * of SAM treatment. | |
- * | |
- * When compiling without SAM treatment, the implicit expansion results in a | |
- * self-recursive call to the implicit conversion. Without `identity()`, this | |
- * recursive call is in tail position, and the tailcalls phase will convert | |
- * it into an infinite loop. | |
- * | |
- * With `identity()`, the recursive call is not in tail position. The | |
- * back-end therefore receives a call to the implicit conversion, *which is | |
- * a primitive*, and therefore applies its primitive treatment, | |
- * short-circuiting the infinite recursion. | |
- * | |
- * With proper SAM treatment, none of this happens, since there is no | |
- * implicit materialization of a recursive call in the first place. | |
- */ | |
- implicit def fromFunction0[R](f: scala.Function0[R]): Function0[R] = identity(() => f()) | |
- implicit def fromFunction1[T1, R](f: scala.Function1[T1, R]): Function1[T1, R] = identity((x1: T1) => f(x1)) | |
- implicit def fromFunction2[T1, T2, R](f: scala.Function2[T1, T2, R]): Function2[T1, T2, R] = identity((x1: T1, x2: T2) => f(x1, x2)) | |
- implicit def fromFunction3[T1, T2, T3, R](f: scala.Function3[T1, T2, T3, R]): Function3[T1, T2, T3, R] = identity((x1: T1, x2: T2, x3: T3) => f(x1, x2, x3)) | |
- implicit def fromFunction4[T1, T2, T3, T4, R](f: scala.Function4[T1, T2, T3, T4, R]): Function4[T1, T2, T3, T4, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4) => f(x1, x2, x3, x4)) | |
- implicit def fromFunction5[T1, T2, T3, T4, T5, R](f: scala.Function5[T1, T2, T3, T4, T5, R]): Function5[T1, T2, T3, T4, T5, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5) => f(x1, x2, x3, x4, x5)) | |
- implicit def fromFunction6[T1, T2, T3, T4, T5, T6, R](f: scala.Function6[T1, T2, T3, T4, T5, T6, R]): Function6[T1, T2, T3, T4, T5, T6, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6) => f(x1, x2, x3, x4, x5, x6)) | |
- implicit def fromFunction7[T1, T2, T3, T4, T5, T6, T7, R](f: scala.Function7[T1, T2, T3, T4, T5, T6, T7, R]): Function7[T1, T2, T3, T4, T5, T6, T7, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7) => f(x1, x2, x3, x4, x5, x6, x7)) | |
- implicit def fromFunction8[T1, T2, T3, T4, T5, T6, T7, T8, R](f: scala.Function8[T1, T2, T3, T4, T5, T6, T7, T8, R]): Function8[T1, T2, T3, T4, T5, T6, T7, T8, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8) => f(x1, x2, x3, x4, x5, x6, x7, x8)) | |
- implicit def fromFunction9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R](f: scala.Function9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R]): Function9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9)) | |
- implicit def fromFunction10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R](f: scala.Function10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R]): Function10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)) | |
- implicit def fromFunction11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R](f: scala.Function11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R]): Function11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)) | |
- implicit def fromFunction12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R](f: scala.Function12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R]): Function12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12)) | |
- implicit def fromFunction13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R](f: scala.Function13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R]): Function13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)) | |
- implicit def fromFunction14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R](f: scala.Function14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R]): Function14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14)) | |
- implicit def fromFunction15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R](f: scala.Function15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R]): Function15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15)) | |
- implicit def fromFunction16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R](f: scala.Function16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R]): Function16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)) | |
- implicit def fromFunction17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R](f: scala.Function17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R]): Function17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17)) | |
- implicit def fromFunction18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R](f: scala.Function18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R]): Function18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18)) | |
- implicit def fromFunction19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R](f: scala.Function19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R]): Function19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19)) | |
- implicit def fromFunction20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R](f: scala.Function20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R]): Function20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20)) | |
- implicit def fromFunction21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R](f: scala.Function21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R]): Function21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20, x21: T21) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21)) | |
- implicit def fromFunction22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R](f: scala.Function22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R]): Function22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R] = identity((x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20, x21: T21, x22: T22) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22)) | |
- | |
- implicit def toFunction0[R](f: Function0[R]): scala.Function0[R] = () => f() | |
- implicit def toFunction1[T1, R](f: Function1[T1, R]): scala.Function1[T1, R] = (x1) => f(x1) | |
- implicit def toFunction2[T1, T2, R](f: Function2[T1, T2, R]): scala.Function2[T1, T2, R] = (x1, x2) => f(x1, x2) | |
- implicit def toFunction3[T1, T2, T3, R](f: Function3[T1, T2, T3, R]): scala.Function3[T1, T2, T3, R] = (x1, x2, x3) => f(x1, x2, x3) | |
- implicit def toFunction4[T1, T2, T3, T4, R](f: Function4[T1, T2, T3, T4, R]): scala.Function4[T1, T2, T3, T4, R] = (x1, x2, x3, x4) => f(x1, x2, x3, x4) | |
- implicit def toFunction5[T1, T2, T3, T4, T5, R](f: Function5[T1, T2, T3, T4, T5, R]): scala.Function5[T1, T2, T3, T4, T5, R] = (x1, x2, x3, x4, x5) => f(x1, x2, x3, x4, x5) | |
- implicit def toFunction6[T1, T2, T3, T4, T5, T6, R](f: Function6[T1, T2, T3, T4, T5, T6, R]): scala.Function6[T1, T2, T3, T4, T5, T6, R] = (x1, x2, x3, x4, x5, x6) => f(x1, x2, x3, x4, x5, x6) | |
- implicit def toFunction7[T1, T2, T3, T4, T5, T6, T7, R](f: Function7[T1, T2, T3, T4, T5, T6, T7, R]): scala.Function7[T1, T2, T3, T4, T5, T6, T7, R] = (x1, x2, x3, x4, x5, x6, x7) => f(x1, x2, x3, x4, x5, x6, x7) | |
- implicit def toFunction8[T1, T2, T3, T4, T5, T6, T7, T8, R](f: Function8[T1, T2, T3, T4, T5, T6, T7, T8, R]): scala.Function8[T1, T2, T3, T4, T5, T6, T7, T8, R] = (x1, x2, x3, x4, x5, x6, x7, x8) => f(x1, x2, x3, x4, x5, x6, x7, x8) | |
- implicit def toFunction9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R](f: Function9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R]): scala.Function9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9) | |
- implicit def toFunction10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R](f: Function10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R]): scala.Function10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) | |
- implicit def toFunction11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R](f: Function11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R]): scala.Function11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) | |
- implicit def toFunction12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R](f: Function12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R]): scala.Function12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) | |
- implicit def toFunction13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R](f: Function13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R]): scala.Function13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) | |
- implicit def toFunction14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R](f: Function14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R]): scala.Function14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) | |
- implicit def toFunction15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R](f: Function15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R]): scala.Function15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) | |
- implicit def toFunction16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R](f: Function16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R]): scala.Function16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) | |
- implicit def toFunction17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R](f: Function17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R]): scala.Function17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) | |
- implicit def toFunction18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R](f: Function18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R]): scala.Function18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) | |
- implicit def toFunction19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R](f: Function19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R]): scala.Function19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) | |
- implicit def toFunction20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R](f: Function20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R]): scala.Function20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) | |
- implicit def toFunction21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R](f: Function21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R]): scala.Function21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) | |
- implicit def toFunction22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R](f: Function22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R]): scala.Function22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) | |
+ implicit def fromFunction0[R](f: scala.Function0[R]): js.Function0[R] = () => f() | |
+ implicit def fromFunction1[T1, R](f: scala.Function1[T1, R]): js.Function1[T1, R] = (x1: T1) => f(x1) | |
+ implicit def fromFunction2[T1, T2, R](f: scala.Function2[T1, T2, R]): js.Function2[T1, T2, R] = (x1: T1, x2: T2) => f(x1, x2) | |
+ implicit def fromFunction3[T1, T2, T3, R](f: scala.Function3[T1, T2, T3, R]): js.Function3[T1, T2, T3, R] = (x1: T1, x2: T2, x3: T3) => f(x1, x2, x3) | |
+ implicit def fromFunction4[T1, T2, T3, T4, R](f: scala.Function4[T1, T2, T3, T4, R]): js.Function4[T1, T2, T3, T4, R] = (x1: T1, x2: T2, x3: T3, x4: T4) => f(x1, x2, x3, x4) | |
+ implicit def fromFunction5[T1, T2, T3, T4, T5, R](f: scala.Function5[T1, T2, T3, T4, T5, R]): js.Function5[T1, T2, T3, T4, T5, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5) => f(x1, x2, x3, x4, x5) | |
+ implicit def fromFunction6[T1, T2, T3, T4, T5, T6, R](f: scala.Function6[T1, T2, T3, T4, T5, T6, R]): js.Function6[T1, T2, T3, T4, T5, T6, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6) => f(x1, x2, x3, x4, x5, x6) | |
+ implicit def fromFunction7[T1, T2, T3, T4, T5, T6, T7, R](f: scala.Function7[T1, T2, T3, T4, T5, T6, T7, R]): js.Function7[T1, T2, T3, T4, T5, T6, T7, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7) => f(x1, x2, x3, x4, x5, x6, x7) | |
+ implicit def fromFunction8[T1, T2, T3, T4, T5, T6, T7, T8, R](f: scala.Function8[T1, T2, T3, T4, T5, T6, T7, T8, R]): js.Function8[T1, T2, T3, T4, T5, T6, T7, T8, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8) => f(x1, x2, x3, x4, x5, x6, x7, x8) | |
+ implicit def fromFunction9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R](f: scala.Function9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R]): js.Function9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9) | |
+ implicit def fromFunction10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R](f: scala.Function10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R]): js.Function10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) | |
+ implicit def fromFunction11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R](f: scala.Function11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R]): js.Function11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) | |
+ implicit def fromFunction12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R](f: scala.Function12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R]): js.Function12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) | |
+ implicit def fromFunction13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R](f: scala.Function13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R]): js.Function13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) | |
+ implicit def fromFunction14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R](f: scala.Function14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R]): js.Function14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) | |
+ implicit def fromFunction15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R](f: scala.Function15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R]): js.Function15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) | |
+ implicit def fromFunction16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R](f: scala.Function16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R]): js.Function16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) | |
+ implicit def fromFunction17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R](f: scala.Function17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R]): js.Function17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) | |
+ implicit def fromFunction18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R](f: scala.Function18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R]): js.Function18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) | |
+ implicit def fromFunction19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R](f: scala.Function19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R]): js.Function19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) | |
+ implicit def fromFunction20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R](f: scala.Function20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R]): js.Function20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) | |
+ implicit def fromFunction21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R](f: scala.Function21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R]): js.Function21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20, x21: T21) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) | |
+ implicit def fromFunction22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R](f: scala.Function22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R]): js.Function22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R] = (x1: T1, x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9, x10: T10, x11: T11, x12: T12, x13: T13, x14: T14, x15: T15, x16: T16, x17: T17, x18: T18, x19: T19, x20: T20, x21: T21, x22: T22) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) | |
+ | |
+ implicit def toFunction0[R](f: js.Function0[R]): scala.Function0[R] = () => f() | |
+ implicit def toFunction1[T1, R](f: js.Function1[T1, R]): scala.Function1[T1, R] = (x1) => f(x1) | |
+ implicit def toFunction2[T1, T2, R](f: js.Function2[T1, T2, R]): scala.Function2[T1, T2, R] = (x1, x2) => f(x1, x2) | |
+ implicit def toFunction3[T1, T2, T3, R](f: js.Function3[T1, T2, T3, R]): scala.Function3[T1, T2, T3, R] = (x1, x2, x3) => f(x1, x2, x3) | |
+ implicit def toFunction4[T1, T2, T3, T4, R](f: js.Function4[T1, T2, T3, T4, R]): scala.Function4[T1, T2, T3, T4, R] = (x1, x2, x3, x4) => f(x1, x2, x3, x4) | |
+ implicit def toFunction5[T1, T2, T3, T4, T5, R](f: js.Function5[T1, T2, T3, T4, T5, R]): scala.Function5[T1, T2, T3, T4, T5, R] = (x1, x2, x3, x4, x5) => f(x1, x2, x3, x4, x5) | |
+ implicit def toFunction6[T1, T2, T3, T4, T5, T6, R](f: js.Function6[T1, T2, T3, T4, T5, T6, R]): scala.Function6[T1, T2, T3, T4, T5, T6, R] = (x1, x2, x3, x4, x5, x6) => f(x1, x2, x3, x4, x5, x6) | |
+ implicit def toFunction7[T1, T2, T3, T4, T5, T6, T7, R](f: js.Function7[T1, T2, T3, T4, T5, T6, T7, R]): scala.Function7[T1, T2, T3, T4, T5, T6, T7, R] = (x1, x2, x3, x4, x5, x6, x7) => f(x1, x2, x3, x4, x5, x6, x7) | |
+ implicit def toFunction8[T1, T2, T3, T4, T5, T6, T7, T8, R](f: js.Function8[T1, T2, T3, T4, T5, T6, T7, T8, R]): scala.Function8[T1, T2, T3, T4, T5, T6, T7, T8, R] = (x1, x2, x3, x4, x5, x6, x7, x8) => f(x1, x2, x3, x4, x5, x6, x7, x8) | |
+ implicit def toFunction9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R](f: js.Function9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R]): scala.Function9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9) | |
+ implicit def toFunction10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R](f: js.Function10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R]): scala.Function10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) | |
+ implicit def toFunction11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R](f: js.Function11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R]): scala.Function11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) | |
+ implicit def toFunction12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R](f: js.Function12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R]): scala.Function12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) | |
+ implicit def toFunction13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R](f: js.Function13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R]): scala.Function13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) | |
+ implicit def toFunction14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R](f: js.Function14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R]): scala.Function14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) | |
+ implicit def toFunction15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R](f: js.Function15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R]): scala.Function15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) | |
+ implicit def toFunction16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R](f: js.Function16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R]): scala.Function16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) | |
+ implicit def toFunction17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R](f: js.Function17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R]): scala.Function17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) | |
+ implicit def toFunction18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R](f: js.Function18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R]): scala.Function18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) | |
+ implicit def toFunction19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R](f: js.Function19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R]): scala.Function19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) | |
+ implicit def toFunction20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R](f: js.Function20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R]): scala.Function20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) | |
+ implicit def toFunction21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R](f: js.Function21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R]): scala.Function21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) | |
+ implicit def toFunction22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R](f: js.Function22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R]): scala.Function22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R] = (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) => f(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) | |
// scalastyle:on line.size.limit | |
- @inline implicit def fromJBoolean(value: java.lang.Boolean): Any = | |
- value.asInstanceOf[Any] | |
- @inline implicit def fromJByte(value: java.lang.Byte): Any = | |
- value.asInstanceOf[Any] | |
- @inline implicit def fromJShort(value: java.lang.Short): Any = | |
- value.asInstanceOf[Any] | |
- @inline implicit def fromJInteger(value: java.lang.Integer): Any = | |
- value.asInstanceOf[Any] | |
+ @inline implicit def fromJBoolean(value: java.lang.Boolean): js.Any = | |
+ value.asInstanceOf[js.Any] | |
+ @inline implicit def fromJByte(value: java.lang.Byte): js.Any = | |
+ value.asInstanceOf[js.Any] | |
+ @inline implicit def fromJShort(value: java.lang.Short): js.Any = | |
+ value.asInstanceOf[js.Any] | |
+ @inline implicit def fromJInteger(value: java.lang.Integer): js.Any = | |
+ value.asInstanceOf[js.Any] | |
- @inline implicit def fromJLong(value: java.lang.Long): Any = | |
+ /* The following overload makes sure that the developer does not | |
+ * inadvertently convert a Long to a Double to fit it in a js.Any. | |
+ */ | |
+ @deprecated( | |
+ "A Long is converted to Double to be cast to js.Any. " + | |
+ "This is almost certainly not what you want. " + | |
+ "Use `.toDouble` explicitly if you need it.", | |
+ "forever") | |
+ @inline | |
+ implicit def fromJLong(value: java.lang.Long): js.Any = | |
if (value eq null) null | |
- else value.doubleValue.asInstanceOf[Any] | |
+ else value.doubleValue.asInstanceOf[js.Any] | |
+ | |
+ @inline implicit def fromJFloat(value: java.lang.Float): js.Any = | |
+ value.asInstanceOf[js.Any] | |
+ @inline implicit def fromJDouble(value: java.lang.Double): js.Any = | |
+ value.asInstanceOf[js.Any] | |
+ | |
+ implicit class ObjectCompanionOps private[Any] ( | |
+ private val self: js.Object.type) | |
+ extends AnyVal { | |
+ | |
+ /** Tests whether the specified object `o` has a property `p` on itself or | |
+ * in its prototype chain. | |
+ * | |
+ * This method is the equivalent of `p in o` in JavaScript. | |
+ */ | |
+ def hasProperty(o: js.Object, p: String): Boolean = | |
+ js.special.in(p, o) | |
- @inline implicit def fromJFloat(value: java.lang.Float): Any = | |
- value.asInstanceOf[Any] | |
- @inline implicit def fromJDouble(value: java.lang.Double): Any = | |
- value.asInstanceOf[Any] | |
+ /** Returns the names of all the enumerable properties of the specified | |
+ * object `o`, including properties in its prototype chain. | |
+ * | |
+ * This method returns the same set of names that would be enumerated by | |
+ * a for-in loop in JavaScript, in the same order. | |
+ * | |
+ * This method assumes that all keys enumerated by a for-in loop are | |
+ * strings. If this is not the case, calling this method is an undefined | |
+ * behavior of kind `ClassCastException`. Note that for all *ordinary* | |
+ * objects, the ECMAScript 2015 guarantees that this is the case. It might | |
+ * be false if `o` is a proxy object or another exotic object. | |
+ * | |
+ * For ordinary objects, if the underlying implementation guarantees an | |
+ * order for for-in loops, then this is guaranteed to be consistent with | |
+ * [[js.Object.keys]], in the sense that the list returned by | |
+ * [[js.Object.keys]] is a sublist of the list returned by this method | |
+ * (not just a subset). | |
+ */ | |
+ @noinline | |
+ def properties(o: js.Any): js.Array[String] = { | |
+ /* DO NOT touch this code without double-checking the optimized code. | |
+ * | |
+ * This implementation is carefully crafted so that the optimizer turns | |
+ * the code into a pattern known not to fall off the performance cliffs. | |
+ */ | |
+ val result = js.Array[scala.Any]() | |
+ @inline def appendProp(p: scala.Any): Unit = result.push(p) | |
+ js.special.forin(o) { p => | |
+ appendProp(p) | |
+ } | |
+ result.asInstanceOf[js.Array[String]] | |
+ } | |
+ } | |
} | |
-trait LowPrioAnyImplicits extends LowestPrioAnyImplicits { | |
+sealed trait LowPrioAnyImplicits extends LowestPrioAnyImplicits { | |
+ this: js.Any.type => | |
+ | |
implicit def wrapArray[A](array: js.Array[A]): js.WrappedArray[A] = | |
new js.WrappedArray(array) | |
implicit def wrapDictionary[A](dict: js.Dictionary[A]): js.WrappedDictionary[A] = | |
@@@ -242,8 -208,8 +262,10 @@@ | |
} | |
sealed trait LowestPrioAnyImplicits { | |
+ this: js.Any.type => | |
+ | |
+ implicit def arrayAsIterable[A](array: js.Array[_ <: A]): scala.collection.Iterable[A] = | |
+ new js.WrappedArray(array) | |
implicit def iterableOps[A](iterable: js.Iterable[A]): js.IterableOps[A] = | |
new js.IterableOps(iterable) | |
} | |
diff --cc library/src/main/scala-new-collections/scala/scalajs/js/ArrayOps.scala | |
index 6c43b532f,3e52a8806..000000000 | |
--- a/library/src/main/scala-new-collections/scala/scalajs/js/ArrayOps.scala | |
+++ b/library/src/main/scala-new-collections/scala/scalajs/js/ArrayOps.scala | |
diff --cc library/src/main/scala-new-collections/scala/scalajs/js/WrappedArray.scala | |
index c5b8b256e,8043aec31..000000000 | |
--- a/library/src/main/scala-new-collections/scala/scalajs/js/WrappedArray.scala | |
+++ b/library/src/main/scala-new-collections/scala/scalajs/js/WrappedArray.scala | |
@@@ -19,11 -19,11 +19,11 @@@ import scala.scalajs.j | |
@inline | |
final class WrappedArray[A](val array: js.Array[A]) | |
extends mutable.AbstractBuffer[A] | |
- with StrictOptimizedSeqOps[A, WrappedArray, WrappedArray[A]] | |
+ with StrictOptimizedSeqOps[A, js.WrappedArray, js.WrappedArray[A]] | |
with mutable.IndexedSeq[A] | |
- with mutable.IndexedSeqOps[A, WrappedArray, WrappedArray[A]] | |
+ with mutable.IndexedSeqOps[A, js.WrappedArray, js.WrappedArray[A]] | |
- with mutable.IndexedOptimizedBuffer[A] | |
+ with mutable.IndexedBuffer[A] | |
- with mutable.Builder[A, WrappedArray[A]] | |
+ with mutable.Builder[A, js.WrappedArray[A]] | |
with Serializable { | |
/** Creates a new empty [[WrappedArray]]. */ | |
diff --cc library/src/main/scala-new-collections/scala/scalajs/js/WrappedDictionary.scala | |
index e6c615ae0,d1925ba00..000000000 | |
--- a/library/src/main/scala-new-collections/scala/scalajs/js/WrappedDictionary.scala | |
+++ b/library/src/main/scala-new-collections/scala/scalajs/js/WrappedDictionary.scala | |
@@@ -23,10 -23,10 +23,10 @@@ class WrappedDictionary[A](val dict: js | |
import WrappedDictionary._ | |
- protected[this] override def fromSpecificIterable( | |
- coll: scala.collection.Iterable[(String, A)] | |
+ protected[this] override def fromSpecific( | |
+ coll: scala.collection.IterableOnce[(String, A)] | |
- ): WrappedDictionary[A] = { | |
- val d = WrappedDictionary.empty[A] | |
+ ): js.WrappedDictionary[A] = { | |
+ val d = js.WrappedDictionary.empty[A] | |
d ++= coll | |
d | |
} | |
diff --cc library/src/main/scala-new-collections/scala/scalajs/runtime/Compat.scala | |
index 0636921ed,5a3d0d4fa..000000000 | |
--- a/library/src/main/scala-new-collections/scala/scalajs/runtime/Compat.scala | |
+++ b/library/src/main/scala-new-collections/scala/scalajs/runtime/Compat.scala | |
diff --cc library/src/main/scala/scala/scalajs/js/JSArrayOps.scala | |
index b12f9990d,59e02627c..000000000 | |
--- a/library/src/main/scala/scala/scalajs/js/JSArrayOps.scala | |
+++ b/library/src/main/scala/scala/scalajs/js/JSArrayOps.scala | |
@@@ -28,7 -27,14 +28,14 @@@ import scala.scalajs.js.annotation. | |
* To enable the use of these functions on js.[[Array]]s, import the implicit | |
* conversion [[JSArrayOps.jsArrayOps]]. | |
*/ | |
+ @deprecated( | |
+ "It almost never makes sense to call native JavaScript Array functions " + | |
+ "from Scala.js. Use the normal Scala collection methods instead. " + | |
+ "If this is really what you want, use js.Dynamic or write your own " + | |
+ "facade type.", | |
+ "0.6.25") | |
+ @native | |
-trait JSArrayOps[A] extends Object { | |
+trait JSArrayOps[A] extends js.Object { | |
/** | |
* The indexOf() method returns the first index at which a given element can | |
@@@ -262,7 -265,13 +269,13 @@@ | |
} | |
+ @deprecated( | |
+ "It almost never makes sense to call native JavaScript Array functions " + | |
+ "from Scala.js. Use the normal Scala collection methods instead. " + | |
+ "If this is really what you want, use js.Dynamic or write your own " + | |
+ "facade type.", | |
+ "0.6.25") | |
object JSArrayOps { | |
- @inline implicit def jsArrayOps[A](array: Array[A]): JSArrayOps[A] = | |
- array.asInstanceOf[JSArrayOps[A]] | |
+ @inline implicit def jsArrayOps[A](array: js.Array[A]): js.JSArrayOps[A] = | |
+ array.asInstanceOf[js.JSArrayOps[A]] | |
} | |
diff --cc project/Build.scala | |
index 0529e7185,eab40cfd4..000000000 | |
--- a/project/Build.scala | |
+++ b/project/Build.scala | |
@@@ -144,8 -57,7 +144,8 @@@ object Build | |
val shouldPartest = settingKey[Boolean]( | |
"Whether we should partest the current scala version (and fail if we can't)") | |
+ /* MiMa configuration -- irrelevant while in 1.0.0-SNAPSHOT. | |
- val previousVersion = "0.6.24" | |
+ val previousVersion = "0.6.25" | |
val previousSJSBinaryVersion = | |
ScalaJSCrossVersion.binaryScalaJSVersion(previousVersion) | |
val previousBinaryCrossVersion = | |
@@@ -164,13 -70,23 +164,18 @@@ | |
version != "2.13.0-M3" | |
} | |
- /** Returns the appropriate subdirectory of `sourceDir` depending on whether | |
- * the `scalaV` uses the new collections (introduced in 2.13.0-M4) or not. | |
+ /** Returns the appropriate subdirectory of `sourceDir` depending on the | |
+ * collection "era" used by the `scalaV`. | |
+ * | |
+ * It can be the new collections (2.13.0-M5+), the old collections (until | |
+ * 2.13.0-M3) or the intermediate "M4" collections (the transient state of | |
+ * the collections in 2.13.0-M4). | |
*/ | |
def collectionsEraDependentDirectory(scalaV: String, sourceDir: File): File = | |
- if (hasNewCollections(scalaV)) sourceDir / "scala-new-collections" | |
+ if (scalaV == "2.13.0-M4") sourceDir / "scala-m4-collections" | |
+ else if (hasNewCollections(scalaV)) sourceDir / "scala-new-collections" | |
else sourceDir / "scala-old-collections" | |
- val scalaVersionsUsedForPublishing: Set[String] = | |
- Set("2.10.7", "2.11.12", "2.12.6", "2.13.0-M3") | |
- val newScalaBinaryVersionsInThisRelease: Set[String] = | |
- Set() | |
- | |
val javaVersion = settingKey[Int]( | |
"The major Java SDK version that should be assumed for compatibility. " + | |
"Defaults to what sbt is running with.") | |
diff --git a/library/src/main/scala-m4-collections/scala/scalajs/js/WrappedArray.scala b/library/src/main/scala-m4-collections/scala/scalajs/js/WrappedArray.scala | |
index c5b8b256e..de4d57bb0 100644 | |
--- a/library/src/main/scala-m4-collections/scala/scalajs/js/WrappedArray.scala | |
+++ b/library/src/main/scala-m4-collections/scala/scalajs/js/WrappedArray.scala | |
@@ -67,18 +67,31 @@ final class WrappedArray[A](val array: js.Array[A]) | |
this | |
} | |
- @inline def insert(idx: Int, elem: A): Unit = | |
+ def insert(idx: Int, elem: A): Unit = { | |
+ if (idx < 0 || idx > array.length) | |
+ throw new IndexOutOfBoundsException | |
array.splice(idx, 0, elem) | |
+ } | |
- @inline | |
- def insertAll(n: Int, elems: scala.collection.IterableOnce[A]): Unit = | |
+ def insertAll(n: Int, elems: scala.collection.IterableOnce[A]): Unit = { | |
+ if (n < 0 || n > array.length) | |
+ throw new IndexOutOfBoundsException | |
array.splice(n, 0, elems.iterator.toSeq: _*) | |
+ } | |
- @inline def remove(n: Int): A = | |
+ def remove(n: Int): A = { | |
+ if (n < 0 || n >= array.length) | |
+ throw new IndexOutOfBoundsException | |
array.splice(n, 1)(0) | |
+ } | |
- @inline override def remove(n: Int, count: Int): Unit = | |
+ override def remove(n: Int, count: Int): Unit = { | |
+ if (count < 0) | |
+ throw new IllegalArgumentException | |
+ if (n < 0 || (count > 0 && n + count > array.length)) | |
+ throw new IndexOutOfBoundsException | |
array.splice(n, count) | |
+ } | |
@inline override def className: String = "WrappedArray" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment