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

Unified Diff: test/mjsunit/for-in.js

Issue 2407863003: Remove --harmony-for-in flag which is always false (Closed)
Patch Set: Migrate tests Created 4 years, 2 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/cctest/test-parsing.cc ('k') | test/mjsunit/harmony/for-in.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/for-in.js
diff --git a/test/mjsunit/for-in.js b/test/mjsunit/for-in.js
index 29d7445351ffa1788af1172a574e37e788cde9dd..94b39cfd57d67d747d99909253c75dd56e7cac76 100644
--- a/test/mjsunit/for-in.js
+++ b/test/mjsunit/for-in.js
@@ -25,8 +25,6 @@
// (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: --noharmony-for-in
-
function props(x) {
var array = [];
for (var p in x) array.push(p);
@@ -141,6 +139,13 @@ function props(x) {
(function forInInitialize() {
for (var hest = 'hest' in {}) { }
assertEquals('hest', hest, "empty-no-override");
+
+ // Lexical variables are disallowed
+ assertThrows("for (const x = 0 in {});", SyntaxError);
+ assertThrows("for (let x = 0 in {});", SyntaxError);
+
+ // In strict mode, var is disallowed
+ assertThrows("'use strict'; for (var x = 0 in {});", SyntaxError);
})();
(function forInObjects() {
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | test/mjsunit/harmony/for-in.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698