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

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

Issue 156423005: Move ParseRegexpLiteral to ParserBase. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code review (ulan) Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/preparser.cc ('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 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after
2007 2007
2008 const char* statement_data[] = { 2008 const char* statement_data[] = {
2009 "try { } catch (e) { }", 2009 "try { } catch (e) { }",
2010 "try { } catch (e) { } finally { }", 2010 "try { } catch (e) { } finally { }",
2011 "try { } finally { }", 2011 "try { } finally { }",
2012 NULL 2012 NULL
2013 }; 2013 };
2014 2014
2015 RunParserSyncTest(context_data, statement_data, kSuccess); 2015 RunParserSyncTest(context_data, statement_data, kSuccess);
2016 } 2016 }
2017
2018
2019 TEST(ErrorsRegexpLiteral) {
2020 const char* context_data[][2] = {
2021 {"var r = ", ""},
2022 { NULL, NULL }
2023 };
2024
2025 const char* statement_data[] = {
2026 "/unterminated",
2027 NULL
2028 };
2029
2030 RunParserSyncTest(context_data, statement_data, kError);
2031 }
2032
2033
2034 TEST(NoErrorsRegexpLiteral) {
2035 const char* context_data[][2] = {
2036 {"var r = ", ""},
2037 { NULL, NULL }
2038 };
2039
2040 const char* statement_data[] = {
2041 "/foo/",
2042 "/foo/g",
2043 "/foo/whatever", // This is an error but not detected by the parser.
2044 NULL
2045 };
2046
2047 RunParserSyncTest(context_data, statement_data, kSuccess);
2048 }
OLDNEW
« no previous file with comments | « src/preparser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698