Bug 1019116 - Import Promise.prototype.finally test262 tests. r=anba
☠☠ backed out by cc777e501999 ☠ ☠
authorTom Schuster <evilpies@gmail.com>
Tue, 07 Nov 2017 18:26:36 +0100
changeset 443789 fc05d670729c3d7632e8783a040ec9df22ae56b4
parent 443788 2ab4309be28d6932a7034ac76823c3a0f6747bdc
child 443790 003ff6a2a25431837e677ed20e8036ec06f461af
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersanba
bugs1019116
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1019116 - Import Promise.prototype.finally test262 tests. r=anba
js/src/tests/test262-update.py
js/src/tests/test262/GIT-INFO
js/src/tests/test262/built-ins/Promise/prototype/finally/invokes-then-with-function.js
js/src/tests/test262/built-ins/Promise/prototype/finally/invokes-then-with-non-function.js
js/src/tests/test262/built-ins/Promise/prototype/finally/is-a-function.js
js/src/tests/test262/built-ins/Promise/prototype/finally/is-a-method.js
js/src/tests/test262/built-ins/Promise/prototype/finally/length.js
js/src/tests/test262/built-ins/Promise/prototype/finally/name.js
js/src/tests/test262/built-ins/Promise/prototype/finally/prop-desc.js
js/src/tests/test262/built-ins/Promise/prototype/finally/rejected-observable-then-calls.js
js/src/tests/test262/built-ins/Promise/prototype/finally/rejection-reason-no-fulfill.js
js/src/tests/test262/built-ins/Promise/prototype/finally/rejection-reason-override-with-throw.js
js/src/tests/test262/built-ins/Promise/prototype/finally/resolution-value-no-override.js
js/src/tests/test262/built-ins/Promise/prototype/finally/resolved-observable-then-calls.js
js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-non-object.js
js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-then-not-callable.js
js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-then-poisoned.js
js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-then-throws.js
js/src/tests/test262/harness/shell.js
--- a/js/src/tests/test262-update.py
+++ b/js/src/tests/test262-update.py
@@ -17,17 +17,16 @@ import sys
 from functools import partial
 from itertools import chain, imap
 
 # Skip all tests which use features not supported in SpiderMonkey.
 UNSUPPORTED_FEATURES = set([
                             "tail-call-optimization",
                             "BigInt",
                             "class-fields",
-                            "Promise.prototype.finally",
                             "optional-catch-binding",
                             "regexp-dotall",
                             "regexp-lookbehind",
                             "regexp-named-groups",
                             "regexp-unicode-property-escapes",
                        ])
 RELEASE_OR_BETA = set()
 
--- a/js/src/tests/test262/GIT-INFO
+++ b/js/src/tests/test262/GIT-INFO
@@ -1,7 +1,8 @@
 commit a456b0a390bb0f70b4cb8d38cb5ab0ecb557a851
+Merge: db05f2f 297502b
 Author: Rick Waldron <waldron.rick@gmail.com>
 Date:   Mon Oct 23 11:02:44 2017 -0400
 
     Merge pull request #1310 from bocoup/contributing
     
     CONTRIBUTING.md Fix mistake in test generation section
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/invokes-then-with-function.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/invokes-then-with-function.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: Promise.prototype.finally invokes `then` method
 esid: sec-promise.prototype.finally
 features: [Promise.prototype.finally]
 ---*/
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/invokes-then-with-non-function.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/invokes-then-with-non-function.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: Promise.prototype.finally invokes `then` method
 esid: sec-promise.prototype.finally
 features: [Promise.prototype.finally]
 ---*/
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/is-a-function.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/is-a-function.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: Promise.prototype.finally is a function
 esid: sec-promise.prototype.finally
 features: [Promise.prototype.finally]
 ---*/
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/is-a-method.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/is-a-method.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: finally is a method on a Promise
 esid: sec-promise.prototype.finally
 features: [Promise.prototype.finally]
 ---*/
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/length.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/length.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: Promise.prototype.finally `length` property
 esid: sec-promise.prototype.finally
 info: >
     ES6 Section 17:
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/name.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/name.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: Promise.prototype.finally `name` property
 esid: sec-promise.prototype.finally
 info: >
     ES Section 17:
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/prop-desc.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/prop-desc.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: Promise.prototype.finally property descriptor
 esid: sec-promise.prototype.finally
 info: >
     Every other data property described in clauses 18 through 26 and in Annex
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/rejected-observable-then-calls.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/rejected-observable-then-calls.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: finally observably calls .then
 esid: sec-promise.prototype.finally
 features: [Promise.prototype.finally]
 flags: [async]
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/rejection-reason-no-fulfill.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/rejection-reason-no-fulfill.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: finally on a rejected promise can not convert to a fulfillment
 esid: sec-promise.prototype.finally
 features: [Promise.prototype.finally]
 flags: [async]
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/rejection-reason-override-with-throw.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/rejection-reason-override-with-throw.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: finally on a rejected promise can override the rejection reason
 esid: sec-promise.prototype.finally
 features: [Promise.prototype.finally]
 flags: [async]
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/resolution-value-no-override.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/resolution-value-no-override.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: finally on a fulfilled promise can not override the resolution value
 esid: sec-promise.prototype.finally
 features: [Promise.prototype.finally]
 flags: [async]
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/resolved-observable-then-calls.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/resolved-observable-then-calls.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: finally observably calls .then
 esid: sec-promise.prototype.finally
 features: [Promise.prototype.finally]
 flags: [async]
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-non-object.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-non-object.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: >
   Promise.prototype.finally called with a non-object-coercible `this` value
 esid: sec-promise.prototype.finally
 features: [Promise.prototype.finally]
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-then-not-callable.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-then-not-callable.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: >
   Promise.prototype.finally called with a `this` value that does not define a
   callable `then` property
 esid: sec-promise.prototype.finally
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-then-poisoned.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-then-poisoned.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: >
   Promise.prototype.finally called with a `this` value whose `then` property is
   an accessor property that returns an abrupt completion
 esid: sec-promise.prototype.finally
--- a/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-then-throws.js
+++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-then-throws.js
@@ -1,9 +1,8 @@
-// |reftest| skip -- Promise.prototype.finally is not supported
 // Copyright (C) 2017 Jordan Harband. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 author: Jordan Harband
 description: >
   Promise.prototype.finally called with a `this` value that defines a `then`
   method which returns an abrupt completion.
 esid: sec-promise.prototype.finally
--- a/js/src/tests/test262/harness/shell.js
+++ b/js/src/tests/test262/harness/shell.js
@@ -1,39 +1,8 @@
-// file: timer.js
-// Copyright (C) 2017 Ecma International.  All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-/*---
-description: |
-    Used in website/scripts/sth.js
----*/
-//setTimeout is not available, hence this script was loaded
-if (Promise === undefined && this.setTimeout === undefined) {
-  if(/\$DONE()/.test(code))
-    $ERROR("Async test capability is not supported in your test environment");
-}
-
-if (Promise !== undefined && this.setTimeout === undefined) {
-  (function(that) {
-     that.setTimeout = function(callback, delay) {
-      var p = Promise.resolve();
-      var start = Date.now();
-      var end = start + delay;
-      function check(){
-        var timeLeft = end - Date.now();
-        if(timeLeft > 0)
-          p.then(check);
-        else
-          callback();
-      }
-      p.then(check);
-    }
-  })(this);
-}
-
 // file: fnGlobalObject.js
 // Copyright (C) 2017 Ecma International.  All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 description: |
     Produce a reliable global object
 ---*/
 
@@ -565,16 +534,30 @@ var byteConversionValues = {
       -4294967296, // -4294967296
       Infinity,    // Infinity
       -Infinity,   // -Infinity
       0
     ]
   }
 };
 
+// file: nans.js
+// Copyright (C) 2017 Ecma International.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: |
+    A collection of NaN values produced from expressions that have been observed
+    to create distinct bit representations on various platforms. These provide a
+    weak basis for assertions regarding the consistent canonicalization of NaN
+    values in Array buffers.
+---*/
+var distinctNaNs = [
+  0/0, Infinity/Infinity, -(0/0), Math.pow(-1, 0.5), -Math.pow(-1, 0.5)
+];
+
 // file: testBuiltInObject.js
 // Copyright 2012 Mozilla Corporation. All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 description: |
     A function used to assert the correctness of built-in objects.
 ---*/
 
@@ -694,36 +677,45 @@ function testBuiltInObject(obj, isFuncti
   if (isFunction && !isConstructor && obj.hasOwnProperty("prototype")) {
     $ERROR("Built-in functions that aren't constructors must not have a prototype property.");
   }
 
   // passed the complete test!
   return true;
 }
 
-// file: promiseHelper.js
+// file: timer.js
 // Copyright (C) 2017 Ecma International.  All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 description: |
-    Check that an array contains a numeric sequence starting at 1
-    and incrementing by 1 for each entry in the array. Used by
-    Promise tests to assert the order of execution in deep Promise
-    resolution pipelines.
+    Used in website/scripts/sth.js
 ---*/
+//setTimeout is not available, hence this script was loaded
+if (Promise === undefined && this.setTimeout === undefined) {
+  if(/\$DONE()/.test(code))
+    $ERROR("Async test capability is not supported in your test environment");
+}
 
-function checkSequence(arr, message) {
-  arr.forEach(function(e, i) {
-    if (e !== (i+1)) {
-      $ERROR((message ? message : "Steps in unexpected sequence:") +
-             " '" + arr.join(',') + "'");
+if (Promise !== undefined && this.setTimeout === undefined) {
+  (function(that) {
+     that.setTimeout = function(callback, delay) {
+      var p = Promise.resolve();
+      var start = Date.now();
+      var end = start + delay;
+      function check(){
+        var timeLeft = end - Date.now();
+        if(timeLeft > 0)
+          p.then(check);
+        else
+          callback();
+      }
+      p.then(check);
     }
-  });
-
-  return true;
+  })(this);
 }
 
 // file: proxyTrapsHelper.js
 // Copyright (C) 2017 Ecma International.  All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 description: |
     Used to assert the correctness of object behavior in the presence
@@ -846,29 +838,37 @@ description: |
     ES2015 tail call optimization semantics.
 ---*/
 
 
 
 
 var $MAX_ITERATIONS = 100000;
 
-// file: nans.js
+// file: promiseHelper.js
 // Copyright (C) 2017 Ecma International.  All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 description: |
-    A collection of NaN values produced from expressions that have been observed
-    to create distinct bit representations on various platforms. These provide a
-    weak basis for assertions regarding the consistent canonicalization of NaN
-    values in Array buffers.
+    Check that an array contains a numeric sequence starting at 1
+    and incrementing by 1 for each entry in the array. Used by
+    Promise tests to assert the order of execution in deep Promise
+    resolution pipelines.
 ---*/
-var distinctNaNs = [
-  0/0, Infinity/Infinity, -(0/0), Math.pow(-1, 0.5), -Math.pow(-1, 0.5)
-];
+
+function checkSequence(arr, message) {
+  arr.forEach(function(e, i) {
+    if (e !== (i+1)) {
+      $ERROR((message ? message : "Steps in unexpected sequence:") +
+             " '" + arr.join(',') + "'");
+    }
+  });
+
+  return true;
+}
 
 // file: detachArrayBuffer.js
 // Copyright (C) 2017 Ecma International.  All rights reserved.
 // This code is governed by the BSD license found in the LICENSE file.
 /*---
 description: |
     A function used in the process of asserting correctness of TypedArray objects.