Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1410)

Unified Diff: test/mjsunit/es6/promises.js

Issue 266243003: Re^3-land "Ship promises and weak collections" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/es6/microtask-delivery.js ('k') | test/mjsunit/es6/regress/regress-2034.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/promises.js
diff --git a/test/mjsunit/es6/promises.js b/test/mjsunit/es6/promises.js
index ba5a306f84a23ecee98f11ddb1b1991afd394f1e..6dfe9261a858a3d658df84475feccce63d5a8aaa 100644
--- a/test/mjsunit/es6/promises.js
+++ b/test/mjsunit/es6/promises.js
@@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --harmony-promises --allow-natives-syntax
+// Flags: --allow-natives-syntax
var asyncAssertsExpected = 0;
@@ -399,6 +399,30 @@ function assertAsyncDone(iteration) {
(function() {
var deferred = Promise.defer()
var p1 = deferred.promise
+ var p2 = p1.then(1, 2)
+ p2.then(
+ function(x) { assertAsync(x === 5, "then/resolve-non-function") },
+ assertUnreachable
+ )
+ deferred.resolve(5)
+ assertAsyncRan()
+})();
+
+(function() {
+ var deferred = Promise.defer()
+ var p1 = deferred.promise
+ var p2 = p1.then(1, 2)
+ p2.then(
+ assertUnreachable,
+ function(x) { assertAsync(x === 5, "then/reject-non-function") }
+ )
+ deferred.reject(5)
+ assertAsyncRan()
+})();
+
+(function() {
+ var deferred = Promise.defer()
+ var p1 = deferred.promise
var p2 = {then: function(onResolve, onReject) { onResolve(p1) }}
var p3 = Promise.accept(p2)
p3.chain(
« no previous file with comments | « test/mjsunit/es6/microtask-delivery.js ('k') | test/mjsunit/es6/regress/regress-2034.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698