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

Side by Side Diff: test/mjsunit/es6/promise-species.js

Issue 2096933002: Remove all harmony runtime flags which shipped in M51 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review comments Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/es6/pattern-brand-check.js ('k') | test/mjsunit/es6/regexp-constructor.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --harmony-species --allow-natives-syntax 5 // Flags: --allow-natives-syntax
6 6
7 // Test that Promises use @@species appropriately 7 // Test that Promises use @@species appropriately
8 8
9 // Another constructor with no species will not be instantiated 9 // Another constructor with no species will not be instantiated
10 var test = new Promise(function(){}); 10 var test = new Promise(function(){});
11 var bogoCount = 0; 11 var bogoCount = 0;
12 function bogusConstructor() { bogoCount++; } 12 function bogusConstructor() { bogoCount++; }
13 test.constructor = bogusConstructor; 13 test.constructor = bogusConstructor;
14 assertTrue(Promise.resolve(test) instanceof Promise); 14 assertTrue(Promise.resolve(test) instanceof Promise);
15 assertFalse(Promise.resolve(test) instanceof bogusConstructor); 15 assertFalse(Promise.resolve(test) instanceof bogusConstructor);
(...skipping 17 matching lines...) Expand all
33 return this; 33 return this;
34 } 34 }
35 } 35 }
36 36
37 var myPromise = MyPromise.resolve().then(); 37 var myPromise = MyPromise.resolve().then();
38 assertEquals(1, count); 38 assertEquals(1, count);
39 assertEquals(1, params.length); 39 assertEquals(1, params.length);
40 assertEquals('function', typeof(params[0])); 40 assertEquals('function', typeof(params[0]));
41 assertTrue(myPromise instanceof MyPromise); 41 assertTrue(myPromise instanceof MyPromise);
42 assertTrue(myPromise instanceof Promise); 42 assertTrue(myPromise instanceof Promise);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/pattern-brand-check.js ('k') | test/mjsunit/es6/regexp-constructor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698