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

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

Issue 615813004: Allow escape sequences in Constructor/Prototype tokens in PreParserTraits::GetSymbol() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Share code between LiteralMatches() and UnescapedLiteralMatches() Created 6 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 unified diff | Download patch | Annotate | Revision Log
« src/scanner.h ('K') | « src/scanner.h ('k') | no next file » | 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 3837 matching lines...) Expand 10 before | Expand all | Expand 10 after
3848 TEST(ClassStaticPrototypeErrors) { 3848 TEST(ClassStaticPrototypeErrors) {
3849 const char* context_data[][2] = {{"class C {", "}"}, 3849 const char* context_data[][2] = {{"class C {", "}"},
3850 {"(class {", "});"}, 3850 {"(class {", "});"},
3851 {NULL, NULL}}; 3851 {NULL, NULL}};
3852 3852
3853 const char* class_body_data[] = { 3853 const char* class_body_data[] = {
3854 "static prototype() {}", 3854 "static prototype() {}",
3855 "static get prototype() {}", 3855 "static get prototype() {}",
3856 "static set prototype(_) {}", 3856 "static set prototype(_) {}",
3857 "static *prototype() {}", 3857 "static *prototype() {}",
3858 "static 'prot\u006ftype'() {}",
3859 "static get 'prot\u006ftype'() {}",
3860 "static set 'prot\u006ftype'(_) {}",
3861 "static *'prot\u006ftype'() {}",
arv (Not doing code reviews) 2014/10/01 21:49:56 One more case: "static prot\u006ftype() {}", ...
3858 NULL}; 3862 NULL};
3859 3863
3860 static const ParserFlag always_flags[] = { 3864 static const ParserFlag always_flags[] = {
3861 kAllowClasses, 3865 kAllowClasses,
3862 kAllowHarmonyObjectLiterals 3866 kAllowHarmonyObjectLiterals
3863 }; 3867 };
3864 RunParserSyncTest(context_data, class_body_data, kError, NULL, 0, 3868 RunParserSyncTest(context_data, class_body_data, kError, NULL, 0,
3865 always_flags, arraysize(always_flags)); 3869 always_flags, arraysize(always_flags));
3866 } 3870 }
3867 3871
3868 3872
3869 TEST(ClassSpecialConstructorErrors) { 3873 TEST(ClassSpecialConstructorErrors) {
3870 const char* context_data[][2] = {{"class C {", "}"}, 3874 const char* context_data[][2] = {{"class C {", "}"},
3871 {"(class {", "});"}, 3875 {"(class {", "});"},
3872 {NULL, NULL}}; 3876 {NULL, NULL}};
3873 3877
3874 const char* class_body_data[] = { 3878 const char* class_body_data[] = {
3875 "get constructor() {}", 3879 "get constructor() {}",
3876 "get constructor(_) {}", 3880 "get constructor(_) {}",
3877 "*constructor() {}", 3881 "*constructor() {}",
3882 "get 'c\u006fnstructor'() {}",
3883 "get 'c\u006fnstructor'(_) {}",
3884 "*'c\u006fnstructor'() {}",
3878 NULL}; 3885 NULL};
3879 3886
3880 static const ParserFlag always_flags[] = { 3887 static const ParserFlag always_flags[] = {
3881 kAllowClasses, 3888 kAllowClasses,
3882 kAllowHarmonyObjectLiterals 3889 kAllowHarmonyObjectLiterals
3883 }; 3890 };
3884 RunParserSyncTest(context_data, class_body_data, kError, NULL, 0, 3891 RunParserSyncTest(context_data, class_body_data, kError, NULL, 0,
3885 always_flags, arraysize(always_flags)); 3892 always_flags, arraysize(always_flags));
3886 } 3893 }
3887 3894
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
4080 4087
4081 const char* name_data[] = { 4088 const char* name_data[] = {
4082 "function* g() { ({yield}); }", 4089 "function* g() { ({yield}); }",
4083 NULL 4090 NULL
4084 }; 4091 };
4085 4092
4086 static const ParserFlag always_flags[] = {kAllowHarmonyObjectLiterals}; 4093 static const ParserFlag always_flags[] = {kAllowHarmonyObjectLiterals};
4087 RunParserSyncTest(context_data, name_data, kError, NULL, 0, 4094 RunParserSyncTest(context_data, name_data, kError, NULL, 0,
4088 always_flags, arraysize(always_flags)); 4095 always_flags, arraysize(always_flags));
4089 } 4096 }
OLDNEW
« src/scanner.h ('K') | « src/scanner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698