Skip to content

FF ONLY Merge 0.6.x into release-v1.0.0, January 17 #3931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Jan 17, 2020

$ git checkout -b merge-0.6.x-into-release-1.0.0-january-17
Switched to a new branch 'merge-0.6.x-into-release-1.0.0-january-17'
$ export mb=$(git merge-base scalajs/0.6.x scalajs/release-v1.0.0)
$ git log --graph --oneline --decorate $mb..scalajs/0.6.x | cat
*   6f589c2f2 (scalajs/0.6.x) Merge pull request #3930 from sjrd/fix-bais-read-with-zero-len
|\  
| * 5f9af7e58 Fix #3913: Make ByteArrayInputStream.read always return -1 at EOF.
|/  
*   dcf288507 Merge pull request #3923 from sjrd/fix-charset-heuristic-properties
|\  
| * df335fc3e Fix #3922: Fix all the heuristic properties of `Charset`s.
|/  
*   368e57cfa Merge pull request #3916 from mliarakos/feature/javalib-consumer
|\  
| * 7fd9ebba8 Implement `java.util.function.Consumer`.
|/  
* 91e807b9e Add new methods in js.Object
*   7abe034a7 Merge pull request #3910 from sjrd/disable-phantomjs-test-suite-on-ci
|\  
| * 976d20faa [no-master] Disable testing the test suite with PhantomJS on the CI.
* |   75d8244dd Merge pull request #3907 from sjrd/fix-regex-start-end-regression-3901
|\ \  
| |/  
|/|   
| * 602005ded (origin/fix-regex-start-end-regression-3901) Fix #3901: Do not fill `groupStartMap` for non-matching groups.
|/  
*   de9fa18c3 (origin/0.6.x) Merge pull request #3909 from sjrd/disable-stacktracetest-in-bootstrap
|\  
| * cbd262db9 [no-master] Work around #3908: Disable StackTraceTest in bootstrap.
|/  
*   3d0e4e3f3 Merge pull request #3890 from sjrd/fix-nested-object-named-class
|\  
| * 36a92e3ff Fix #3888: Always identify impl classes by their IMPLCLASS flag.
|/  
* 6dbc8beb4 Towards 0.6.32.
* 29b644013 (tag: v0.6.31) Version 0.6.31.
*   91b554646 Merge pull request #3873 from sjrd/fix-cli-parse-version
|\  
| * c19399116 [no-master] Fix #3872: Fix parsing of Scala versions in scalajsc.
* |   7e98ae55e Merge pull request #3871 from sjrd/fix-supported-ir-versions
|\ \  
| |/  
|/|   
| * 62818633c Fix #3865: Set the emitted IR version to 0.6.29, and support 0.6.{29-30}.
|/  
* c6fd2a950 Towards 0.6.31.
* d7d342159 (tag: v0.6.30) Version 0.6.30.
$ git merge -s ours de9fa18c3
Merge made by the 'ours' strategy.
$ git show
commit 421d42dd841221eb09c3737c10fe6483839880b9 (HEAD -> merge-0.6.x-into-release-1.0.0-january-17)
Merge: 7caf032f3 de9fa18c3
Author: Sébastien Doeraene <sjrdoeraene@gmail.com>
Date:   Fri Jan 17 14:35:38 2020 +0100

    Skip version commits and no-master commits.
    
    The following version commits are skipped: d7d342159, c6fd2a950,
    29b644013 and 6dbc8beb4.
    
    The following commits tagged `[no-master]` are skipped: c19399116 and
    cbd262db9.
    
    The following commits were not originally tagged `[no-master]`, but do
    not need going to 1.x either:
    
    * 62818633c, which fixes emitted and supported IR versions, should have
      been `[no-master]` to begin with.
    * 36a92e3ff, which was superseded by 281f83f in 1.x, with the test
      being added in b9bcdba.

$ git merge --no-commit 75d8244dd
Auto-merging test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/util/regex/RegexMatcherTest.scala
Automatic merge went well; stopped before committing as requested

[...] Run testSuite2_12/test at this point

$ git st
M  javalib/src/main/scala/java/util/regex/GroupStartMapper.scala
M  test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/util/regex/RegexMatcherTest.scala
$ git commit
[merge-0.6.x-into-release-1.0.0-january-17 8c9a5342e] Merge '0.6.x' into 'release-v1.0.0'.
$ git merge -s ours 7abe034a7
Merge made by the 'ours' strategy.
$ git show
commit 78175b509d12d3136e3f82319273878aeb19b8d5 (HEAD -> merge-0.6.x-into-release-1.0.0-january-17)
Merge: 8c9a5342e 7abe034a7
Author: Sébastien Doeraene <sjrdoeraene@gmail.com>
Date:   Fri Jan 17 14:51:20 2020 +0100

    Skip the no-master commit 976d20faa.

$ git merge --no-commit scalajs/0.6.x 
Auto-merging library/src/main/scala/scala/scalajs/js/Object.scala
CONFLICT (content): Merge conflict in library/src/main/scala/scala/scalajs/js/Object.scala
Recorded preimage for 'library/src/main/scala/scala/scalajs/js/Object.scala'
Automatic merge failed; fix conflicts and then commit the result.
$ git st
M  assets/additional-doc-styles.css
M  javalib/src/main/scala/java/io/ByteArrayInputStream.scala
M  javalib/src/main/scala/java/nio/charset/CharsetEncoder.scala
M  javalib/src/main/scala/java/nio/charset/UTF_16_Common.scala
M  javalib/src/main/scala/java/nio/charset/UTF_8.scala
A  javalib/src/main/scala/java/util/function/Consumer.scala
UU library/src/main/scala/scala/scalajs/js/Object.scala
A  test-suite/js/src/test/scala/org/scalajs/testsuite/library/ObjectTest.scala
M  test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/io/ByteArrayInputStreamTest.scala
M  test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/io/CommonStreamsTests.scala
A  test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/util/function/ConsumerTest.scala
M  test-suite/shared/src/test/scala/org/scalajs/testsuite/niocharset/Latin1Test.scala
M  test-suite/shared/src/test/scala/org/scalajs/testsuite/niocharset/USASCIITest.scala
M  test-suite/shared/src/test/scala/org/scalajs/testsuite/niocharset/UTF16Test.scala
M  test-suite/shared/src/test/scala/org/scalajs/testsuite/niocharset/UTF8Test.scala

[...] Fix conflicts

$ git diff | cat
diff --cc library/src/main/scala/scala/scalajs/js/Object.scala
index cb3b14f6d,ea2a115e7..000000000
--- a/library/src/main/scala/scala/scalajs/js/Object.scala
+++ b/library/src/main/scala/scala/scalajs/js/Object.scala
@@@ -119,8 -121,17 +119,17 @@@ object Object extends js.Object 
     *
     * MDN
     */
 -  def getOwnPropertyNames(o: Object): Array[String] = native
 +  def getOwnPropertyNames(o: js.Object): js.Array[String] = js.native
  
+   /** <span class="badge badge-ecma2015" style="float: right;">ECMAScript 2015</span>
+    *
+    *  The Object.getOwnPropertySymbols() method returns an array of all symbol
+    *  properties found directly upon a given object.
+    *
+    *  MDN
+    */
 -  def getOwnPropertySymbols(o: Object): Array[Symbol] = native
++  def getOwnPropertySymbols(o: js.Object): js.Array[js.Symbol] = js.native
+ 
    /**
     * The Object.create() method creates a new object with the specified
     * prototype object and properties.
@@@ -199,8 -209,39 +208,39 @@@
     *
     * MDN
     */
 -  def preventExtensions(o: Object): o.type = native
 +  def preventExtensions(o: js.Object): o.type = js.native
  
+   /** <span class="badge badge-ecma2015" style="float: right;">ECMAScript 2015</span>
+    *
+    *  Object.is() determines whether two values are the same value. Two values
+    *  are the same if one of the following holds:
+    *
+    *  <ul>
+    *    <li>both undefined
+    *    <li>both null
+    *    <li>both true or both false
+    *    <li>both strings of the same length with the same characters in the same
+    *        order
+    *    <li>both the same object (means both object have same reference)
+    *    <li>both numbers and
+    *      <ul>
+    *        <li>both +0
+    *        <li>both -0
+    *        <li>both NaN
+    *        <li>or both non-zero and both not NaN and both have the same value
+    *      </ul>
+    *    </li>
+    *  </ul>
+    *
+    *  This is not the same as being equal according to JavaScript's `===`
+    *  operator (exposed as `js.special.strictEquals`` in Scala.js). The `===`
+    *  operator treats the number values `-0` and `+0` as equal and treats `NaN`
+    *  as not equal to `NaN`.
+    *
+    *  MDN
+    */
 -  def is(value1: scala.Any, value2: scala.Any): Boolean = native
++  def is(value1: scala.Any, value2: scala.Any): Boolean = js.native
+ 
    /**
     * Returns true if the object is sealed, otherwise false. An object is sealed
     * if it is not extensible and if all its properties are non-configurable and
@@@ -241,5 -282,42 +281,31 @@@
     *
     * MDN
     */
 -  def keys(o: Object): Array[String] = native
 -
 -  /** Returns the names of all the enumerable properties of this object,
 -   *  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, but not necessarily in the same order.
 -   *
 -   *  If the underlying implementation guarantees an order for for-in loops,
 -   *  then this is guaranteed to be consistent with [[keys]], in the sense
 -   *  that the list returned by [[keys]] is a sublist of the list returned by
 -   *  this method (not just a subset).
 -   */
 -  def properties(o: Any): Array[String] = throw new java.lang.Error("stub")
 +  def keys(o: js.Object): js.Array[String] = js.native
+ 
+   /** <span class="badge badge-ecma2017" style="float: right;">ECMAScript 2017</span>
+    *
+    *  The Object.entries() method returns an array of a given object's own
+    *  enumerable string-keyed property [key, value] pairs, in the same order as
+    *  that provided by a for...in loop (the difference being that a for-in loop
+    *  enumerates properties in the prototype chain as well).
+    *
+    *  MDN
+    */
 -  def entries(o: Object): Array[Tuple2[String, scala.Any]] = native
++  def entries(o: js.Object): js.Array[js.Tuple2[String, scala.Any]] = js.native
+ 
+   /** <span class="badge badge-ecma2017" style="float: right;">ECMAScript 2017</span>
+    */
 -  def entries[A](dict: Dictionary[A]): Array[Tuple2[String, A]] = native
++  def entries[A](
++      dict: js.Dictionary[A]): js.Array[js.Tuple2[String, A]] = js.native
+ 
+   /** <span class="badge badge-ecma2020" style="float: right;">ECMAScript 2020</span>
+    *
+    *  The Object.fromEntries() method transforms a list of key-value pairs into
+    *  an object.
+    *
+    *  MDN
+    */
 -  def fromEntries[A](iterable: Iterable[Tuple2[String, A]]): Dictionary[A] = native
++  def fromEntries[A](
++      iterable: js.Iterable[js.Tuple2[String, A]]): js.Dictionary[A] = js.native
  }
$ git add -u
$ git st
M  assets/additional-doc-styles.css
M  javalib/src/main/scala/java/io/ByteArrayInputStream.scala
M  javalib/src/main/scala/java/nio/charset/CharsetEncoder.scala
M  javalib/src/main/scala/java/nio/charset/UTF_16_Common.scala
M  javalib/src/main/scala/java/nio/charset/UTF_8.scala
A  javalib/src/main/scala/java/util/function/Consumer.scala
M  library/src/main/scala/scala/scalajs/js/Object.scala
A  test-suite/js/src/test/scala/org/scalajs/testsuite/library/ObjectTest.scala
M  test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/io/ByteArrayInputStreamTest.scala
M  test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/io/CommonStreamsTests.scala
A  test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/util/function/ConsumerTest.scala
M  test-suite/shared/src/test/scala/org/scalajs/testsuite/niocharset/Latin1Test.scala
M  test-suite/shared/src/test/scala/org/scalajs/testsuite/niocharset/USASCIITest.scala
M  test-suite/shared/src/test/scala/org/scalajs/testsuite/niocharset/UTF16Test.scala
M  test-suite/shared/src/test/scala/org/scalajs/testsuite/niocharset/UTF8Test.scala
$ git commit
Recorded resolution for 'library/src/main/scala/scala/scalajs/js/Object.scala'.
[merge-0.6.x-into-release-1.0.0-january-17 bcaf94a3b] Merge '0.6.x' into 'release-v1.0.0'.

sjrd and others added 26 commits November 18, 2019 15:00
…0.6.{29-30}.

We also change the "rules" for what to put in `binaryEmitted` so
that hopefully we can avoid this issue in the future.
…jsc.

In particular, support any number of digits for the minor and patch
versions.

There are changes only in the Unix variant of the script. The
Windows variant already supports any number of digits in the patch
version. It still only tolerates minor versions with exactly 2
digits, because it seems hard to support other formats, and we are
not going to hit that problem in the life span of Scala.js 0.6.x.
Fix scala-js#3865: Set the emitted IR version to 0.6.29, and support 0.6.{29-30}.
[no-master] Fix scala-js#3872: Fix parsing of Scala versions in scalajsc.
Before, we sometimes used name-based identification of impl
classes. This was introduced in
ac54f18, before Scala.js 0.1! At
the time, we were still using a custom `Global` subtrait instead of
a compiler plugin, and a custom `.jstype` file reader instead of
the normal class-file reader of scalac. The flag was not present in
some cases of separate compilation. Now that we use a normal
compiler plugin, this issue does not seem to manifest itself
anymore. It seems this code was left there for 6 years for nothing.
Fix scala-js#3888: Always identify impl classes by their IMPLCLASS flag.
…strap.

With Node.js 13, the shape of stack traces reported during
bootstrap are altered because the execution is within a big `eval`.
Stack trace lines that were previously of the shape

    at $c_LSomeClass.someMethod__O__O (/.../file.js:15:17)

are now of the shape

    at $c_LSomeClass.eval [as someMethod__O__O] (/.../file.js:15:17)

Our `StackTrace.scala` analyzer does not understand this shape,
which causes the `StackTraceTest` to fail during bootstrap.

This commit simply ignores the test during bootstrap, in order to
repair the CI. Further investigation is needed to completely fix
the issue.
…bootstrap

[no-master] Work around scala-js#3908: Disable StackTraceTest in bootstrap.
`groupStartMap` is initially filled with `-1` everywhere, which is
the correct value for non-matching groups. When propagating the
`start` and `end` of a `GroupNode`, we previously always overrode
that value with `start`, which can `>= 0` even for non-matching
groups if they are within a negative look-ahead. This is incorrect,
as non-matching groups must always report `-1` as their `start`.

We now explicitly avoid overriding the initial `-1` for
non-matching groups. This more closely corresponds to what was done
in `GroupStartMap.setEndReturnStart` and `setStartReturnEnd` before
the big rewrite of 56dd7ab.
PhantomJS is still by far the biggest cause of spurious failures of
the CI. Since I have not seen any genuine bug uncovered by testing
on PhantomJS (only) in the last few *years*, the cost of this test
overwhelmingly exceeds its potential benefits.

Therefore, in this commit we simply disable the last command that
was running the test suite with PhantomJS, as well as the last
command that was running non-optimized code with PhantomJS.

PhantomJS is still minimally tested by its unit tests, as well as
in the helloworld and the testingExample (in standard fastOpt and
fullOpt modes).
…sion-3901

Fix scala-js#3901: Do not fill `groupStartMap` for non-matching groups.
…te-on-ci

[no-master] Disable testing the test suite with PhantomJS on the CI.
* getOwnPropertySymbols in ES2015
* entries in ES2017
* is in ES2015
* fromEntries as Stage 4 in ES2020 Draft
* `Decoder.averageCharsPerByte()`
* `Decoder.maxCharsPerByte()`
* `Encoder.averageBytesPerChar()`
* `Encoder.maxBytesPerChar()`
…erties

Fix scala-js#3922: Fix all the heuristic properties of `Charset`s.
… EOF.

Even when the requested length is 0.
Fix scala-js#3913: Make ByteArrayInputStream.read always return -1 at EOF.
The following version commits are skipped: d7d3421, c6fd2a9,
29b6440 and 6dbc8be.

The following commits tagged `[no-master]` are skipped: c193991 and
cbd262d.

The following commits were not originally tagged `[no-master]`, but do
not need going to 1.x either:

* 6281863, which fixes emitted and supported IR versions, should have
  been `[no-master]` to begin with.
* 36a92e3, which was superseded by 281f83f in 1.x, with the test
  being added in b9bcdba.
@sjrd sjrd force-pushed the merge-0.6.x-into-release-1.0.0-january-17 branch from bcaf94a to 4cbf1f9 Compare January 17, 2020 16:22
@sjrd
Copy link
Member Author

sjrd commented Jan 17, 2020

The CI was not happy with NodeJSEnvForcePolyfills. I applied the following changes and amended the last merge commit:

diff --git a/test-suite/js/src/test/scala/org/scalajs/testsuite/library/ObjectTest.scala b/test-suite/js/src/test/scala/org/scalajs/testsuite/library/ObjectTest.scala
index 60115e28e..ba4c4d9a1 100644
--- a/test-suite/js/src/test/scala/org/scalajs/testsuite/library/ObjectTest.scala
+++ b/test-suite/js/src/test/scala/org/scalajs/testsuite/library/ObjectTest.scala
@@ -28,8 +28,9 @@ class ObjectTest {
 
   @Test def getOwnPropertySymbols(): Unit = {
     assumeTrue(
-        "Assuming newer methods existence, which are not honored by Rhino",
-        Platform.executingInNodeJS)
+        "Symbol is not defined (should only happen with NodeJSEnvForcePolyfills)",
+        js.typeOf(js.Dynamic.global.Symbol) != "undefined")
+
     val obj = (new js.Object()).asInstanceOf[ObjectCreator]
     obj(symA) = "localSymbol"
     obj(symB) = "globalSymbol"
@@ -39,8 +40,9 @@ class ObjectTest {
 
   @Test def is(): Unit = {
     assumeTrue(
-        "Assuming newer methods existence, which are not honored by Rhino",
-        Platform.executingInNodeJS)
+        "Object.is is not defined (should only happen with NodeJSEnvForcePolyfills)",
+        js.typeOf(js.Dynamic.global.Object.is) != "undefined")
+
     val a = new js.Object()
     assertTrue(js.Object.is(a, a))
     assertTrue(js.Object.is(Double.NaN, Double.NaN))
@@ -54,9 +56,6 @@ class ObjectTest {
   }
 
   @Test def entries_from_object(): Unit = {
-    assumeTrue(
-        "Assuming newer methods existence, which are not honored by Rhino",
-        Platform.executingInNodeJS)
     val obj = new js.Object {
       val a = 42
       val b = "foo"
@@ -74,9 +73,6 @@ class ObjectTest {
   }
 
   @Test def entries_from_dictionary(): Unit = {
-    assumeTrue(
-        "Assuming newer methods existence, which are not honored by Rhino",
-        Platform.executingInNodeJS)
     val dict = js.Dictionary[Int]("a" -> 42, "b" -> 0)
     val entries = js.Object.entries(dict)
     assertEquals(2, entries.length)
@@ -93,9 +89,6 @@ class ObjectTest {
   }
 
   @Test def fromEntries_array(): Unit = {
-    assumeTrue(
-        "Assuming newer methods existence, which are not honored by Rhino",
-        Platform.executingInNodeJS)
     // from Array
     val array = js.Array(js.Tuple2("a", 42), js.Tuple2("b", "foo"))
     val obj1 = js.Object.fromEntries(array)

@sjrd sjrd merged commit 4cbf1f9 into scala-js:release-v1.0.0 Jan 17, 2020
@sjrd sjrd deleted the merge-0.6.x-into-release-1.0.0-january-17 branch January 17, 2020 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants