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 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 kAllowHarmonyNumericLiterals | 1101 kAllowHarmonyNumericLiterals |
1102 }; | 1102 }; |
1103 | 1103 |
1104 | 1104 |
1105 enum ParserSyncTestResult { | 1105 enum ParserSyncTestResult { |
1106 kSuccessOrError, | 1106 kSuccessOrError, |
1107 kSuccess, | 1107 kSuccess, |
1108 kError | 1108 kError |
1109 }; | 1109 }; |
1110 | 1110 |
1111 | 1111 template <typename Traits> |
1112 void SetParserFlags(i::ParserBase* parser, i::EnumSet<ParserFlag> flags) { | 1112 void SetParserFlags(i::ParserBase<Traits>* parser, |
| 1113 i::EnumSet<ParserFlag> flags) { |
1113 parser->set_allow_lazy(flags.Contains(kAllowLazy)); | 1114 parser->set_allow_lazy(flags.Contains(kAllowLazy)); |
1114 parser->set_allow_natives_syntax(flags.Contains(kAllowNativesSyntax)); | 1115 parser->set_allow_natives_syntax(flags.Contains(kAllowNativesSyntax)); |
1115 parser->set_allow_harmony_scoping(flags.Contains(kAllowHarmonyScoping)); | 1116 parser->set_allow_harmony_scoping(flags.Contains(kAllowHarmonyScoping)); |
1116 parser->set_allow_modules(flags.Contains(kAllowModules)); | 1117 parser->set_allow_modules(flags.Contains(kAllowModules)); |
1117 parser->set_allow_generators(flags.Contains(kAllowGenerators)); | 1118 parser->set_allow_generators(flags.Contains(kAllowGenerators)); |
1118 parser->set_allow_for_of(flags.Contains(kAllowForOf)); | 1119 parser->set_allow_for_of(flags.Contains(kAllowForOf)); |
1119 parser->set_allow_harmony_numeric_literals( | 1120 parser->set_allow_harmony_numeric_literals( |
1120 flags.Contains(kAllowHarmonyNumericLiterals)); | 1121 flags.Contains(kAllowHarmonyNumericLiterals)); |
1121 } | 1122 } |
1122 | 1123 |
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2006 | 2007 |
2007 const char* statement_data[] = { | 2008 const char* statement_data[] = { |
2008 "try { } catch (e) { }", | 2009 "try { } catch (e) { }", |
2009 "try { } catch (e) { } finally { }", | 2010 "try { } catch (e) { } finally { }", |
2010 "try { } finally { }", | 2011 "try { } finally { }", |
2011 NULL | 2012 NULL |
2012 }; | 2013 }; |
2013 | 2014 |
2014 RunParserSyncTest(context_data, statement_data, kSuccess); | 2015 RunParserSyncTest(context_data, statement_data, kSuccess); |
2015 } | 2016 } |
OLD | NEW |