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

Side by Side Diff: test/cctest/test-parsing.cc

Issue 939063002: [strong] Deprecate for-in (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comments Created 5 years, 10 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 | « src/preparser.cc ('k') | test/mjsunit/strong/empty-statement.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5530 matching lines...) Expand 10 before | Expand all | Expand 10 after
5541 static const ParserFlag always_flags[] = { 5541 static const ParserFlag always_flags[] = {
5542 kAllowStrongMode, kAllowHarmonyScoping 5542 kAllowStrongMode, kAllowHarmonyScoping
5543 }; 5543 };
5544 RunParserSyncTest(sloppy_context_data, data, kSuccess, NULL, 0, always_flags, 5544 RunParserSyncTest(sloppy_context_data, data, kSuccess, NULL, 0, always_flags,
5545 arraysize(always_flags)); 5545 arraysize(always_flags));
5546 RunParserSyncTest(strict_context_data, data, kSuccess, NULL, 0, always_flags, 5546 RunParserSyncTest(strict_context_data, data, kSuccess, NULL, 0, always_flags,
5547 arraysize(always_flags)); 5547 arraysize(always_flags));
5548 RunParserSyncTest(strong_context_data, data, kError, NULL, 0, always_flags, 5548 RunParserSyncTest(strong_context_data, data, kError, NULL, 0, always_flags,
5549 arraysize(always_flags)); 5549 arraysize(always_flags));
5550 } 5550 }
5551
5552
5553 TEST(StrongForIn) {
5554 const char* sloppy_context_data[][2] = {{"", ""}, {NULL}};
5555 const char* strict_context_data[][2] = {{"'use strict';", ""}, {NULL}};
5556 const char* strong_context_data[][2] = {{"'use strong';", ""}, {NULL}};
5557
5558 const char* data[] = {
5559 "for (x in []) {}",
5560 "for (const x in []) {}",
5561 NULL};
5562
5563 static const ParserFlag always_flags[] = {
5564 kAllowStrongMode, kAllowHarmonyScoping
5565 };
5566 RunParserSyncTest(sloppy_context_data, data, kSuccess, NULL, 0, always_flags,
5567 arraysize(always_flags));
5568 RunParserSyncTest(strict_context_data, data, kSuccess, NULL, 0, always_flags,
5569 arraysize(always_flags));
5570 RunParserSyncTest(strong_context_data, data, kError, NULL, 0, always_flags,
5571 arraysize(always_flags));
5572 }
OLDNEW
« no previous file with comments | « src/preparser.cc ('k') | test/mjsunit/strong/empty-statement.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698