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 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2002 | 2002 |
2003 if (data->function_count() != test_cases[i].functions) { | 2003 if (data->function_count() != test_cases[i].functions) { |
2004 i::OS::Print( | 2004 i::OS::Print( |
2005 "Expected preparse data for program:\n" | 2005 "Expected preparse data for program:\n" |
2006 "\t%s\n" | 2006 "\t%s\n" |
2007 "to contain %d functions, however, received %d functions.\n", | 2007 "to contain %d functions, however, received %d functions.\n", |
2008 program, test_cases[i].functions, | 2008 program, test_cases[i].functions, |
2009 data->function_count()); | 2009 data->function_count()); |
2010 CHECK(false); | 2010 CHECK(false); |
2011 } | 2011 } |
| 2012 delete data; |
2012 } | 2013 } |
2013 } | 2014 } |
2014 | 2015 |
2015 | 2016 |
2016 TEST(FunctionDeclaresItselfStrict) { | 2017 TEST(FunctionDeclaresItselfStrict) { |
2017 // Tests that we produce the right kinds of errors when a function declares | 2018 // Tests that we produce the right kinds of errors when a function declares |
2018 // itself strict (we cannot produce there errors as soon as we see the | 2019 // itself strict (we cannot produce there errors as soon as we see the |
2019 // offending identifiers, because we don't know at that point whether the | 2020 // offending identifiers, because we don't know at that point whether the |
2020 // function is strict or not). | 2021 // function is strict or not). |
2021 const char* context_data[][2] = { | 2022 const char* context_data[][2] = { |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2449 RunParserSyncTest(assignment_context_data, bad_statement_data_common, kError); | 2450 RunParserSyncTest(assignment_context_data, bad_statement_data_common, kError); |
2450 RunParserSyncTest(assignment_context_data, bad_statement_data_for_assignment, | 2451 RunParserSyncTest(assignment_context_data, bad_statement_data_for_assignment, |
2451 kError); | 2452 kError); |
2452 | 2453 |
2453 RunParserSyncTest(prefix_context_data, good_statement_data, kSuccess); | 2454 RunParserSyncTest(prefix_context_data, good_statement_data, kSuccess); |
2454 RunParserSyncTest(prefix_context_data, bad_statement_data_common, kError); | 2455 RunParserSyncTest(prefix_context_data, bad_statement_data_common, kError); |
2455 | 2456 |
2456 RunParserSyncTest(postfix_context_data, good_statement_data, kSuccess); | 2457 RunParserSyncTest(postfix_context_data, good_statement_data, kSuccess); |
2457 RunParserSyncTest(postfix_context_data, bad_statement_data_common, kError); | 2458 RunParserSyncTest(postfix_context_data, bad_statement_data_common, kError); |
2458 } | 2459 } |
OLD | NEW |