OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |