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 1959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1970 }; | 1970 }; |
1971 | 1971 |
1972 const char* non_strict_statement_data[] = { | 1972 const char* non_strict_statement_data[] = { |
1973 ";", | 1973 ";", |
1974 NULL | 1974 NULL |
1975 }; | 1975 }; |
1976 | 1976 |
1977 RunParserSyncTest(context_data, strict_statement_data, kError); | 1977 RunParserSyncTest(context_data, strict_statement_data, kError); |
1978 RunParserSyncTest(context_data, non_strict_statement_data, kSuccess); | 1978 RunParserSyncTest(context_data, non_strict_statement_data, kSuccess); |
1979 } | 1979 } |
| 1980 |
| 1981 |
| 1982 TEST(ErrorsTryWithoutCatchOrFinally) { |
| 1983 const char* context_data[][2] = { |
| 1984 {"", ""}, |
| 1985 { NULL, NULL } |
| 1986 }; |
| 1987 |
| 1988 const char* statement_data[] = { |
| 1989 "try { }", |
| 1990 "try { } foo();", |
| 1991 "try { } catch (e) foo();", |
| 1992 "try { } catch { }", |
| 1993 "try { } finally foo();", |
| 1994 NULL |
| 1995 }; |
| 1996 |
| 1997 RunParserSyncTest(context_data, statement_data, kError); |
| 1998 } |
| 1999 |
| 2000 |
| 2001 TEST(NoErrorsTryCatchFinally) { |
| 2002 const char* context_data[][2] = { |
| 2003 {"", ""}, |
| 2004 { NULL, NULL } |
| 2005 }; |
| 2006 |
| 2007 const char* statement_data[] = { |
| 2008 "try { } catch (e) { }", |
| 2009 "try { } catch (e) { } finally { }", |
| 2010 "try { } finally { }", |
| 2011 NULL |
| 2012 }; |
| 2013 |
| 2014 RunParserSyncTest(context_data, statement_data, kSuccess); |
| 2015 } |
OLD | NEW |