Bug 1494527 - Fix testcases to properly override Promise[@@species]. r=till
authorTooru Fujisawa <arai_a@mac.com>
Fri, 28 Sep 2018 00:06:52 +0900
changeset 438514 20599af52f6d4372438000d146d008dbe09ed5c4
parent 438513 2188bef5515739adde624aa79b998ce72e4c90b7
child 438515 7011d18300cc2f975eb50c03e9b55e88527f790e
push id108328
push userarai_a@mac.com
push dateThu, 27 Sep 2018 15:07:27 +0000
treeherdermozilla-inbound@20599af52f6d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill
bugs1494527
milestone64.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 1494527 - Fix testcases to properly override Promise[@@species]. r=till
js/src/tests/non262/Promise/enqueue-promise-reactions.js
js/src/tests/non262/Promise/get-wait-for-all-promise.js
--- a/js/src/tests/non262/Promise/enqueue-promise-reactions.js
+++ b/js/src/tests/non262/Promise/enqueue-promise-reactions.js
@@ -7,17 +7,17 @@ function onResolved(val) {
 function onRejected(val) {
     result = 'rejected with ' + val;
 }
 
 // Replacing `Promise#then` shouldn't affect addPromiseReactions.
 Promise.prototype.then = 1;
 
 // Replacing Promise@@species shouldn't affect addPromiseReactions.
-Promise[Symbol.species] = function(){};
+Object.defineProperty(Promise, Symbol.species, { get: function(){} });
 
 // Replacing `Promise` shouldn't affect addPromiseReactions.
 let PromiseCtor = Promise;
 Promise = {};
 
 let result;
 let res;
 let rej;
--- a/js/src/tests/non262/Promise/get-wait-for-all-promise.js
+++ b/js/src/tests/non262/Promise/get-wait-for-all-promise.js
@@ -8,17 +8,17 @@ function onRejected(val) {
     result = 'rejected with ' + val;
 }
 
 // Replacing `Promise#then` shouldn't affect getWaitForAllPromise.
 let originalThen = Promise.prototype.then;
 Promise.prototype.then = 1;
 
 // Replacing Promise[@@species] shouldn't affect getWaitForAllPromise.
-Promise[Symbol.species] = function(){};
+Object.defineProperty(Promise, Symbol.species, { get: function(){} });
 
 // Replacing `Promise` shouldn't affect getWaitForAllPromise.
 let PromiseCtor = Promise;
 Promise = {};
 
 // Replacing Array[@@iterator] shouldn't affect getWaitForAllPromise.
 Array.prototype[Symbol.iterator] = function(){};