| 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 2330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2341 } | 2341 } |
| 2342 | 2342 |
| 2343 | 2343 |
| 2344 TEST(TooManyArguments) { | 2344 TEST(TooManyArguments) { |
| 2345 const char* context_data[][2] = { | 2345 const char* context_data[][2] = { |
| 2346 {"foo(", "0)"}, | 2346 {"foo(", "0)"}, |
| 2347 { NULL, NULL } | 2347 { NULL, NULL } |
| 2348 }; | 2348 }; |
| 2349 | 2349 |
| 2350 using v8::internal::Code; | 2350 using v8::internal::Code; |
| 2351 char statement[Code::kMaxArguments * 2]; | 2351 char statement[Code::kMaxArguments * 2 + 1]; |
| 2352 for (int i = 0; i < Code::kMaxArguments; ++i) { | 2352 for (int i = 0; i < Code::kMaxArguments; ++i) { |
| 2353 statement[2 * i] = '0'; | 2353 statement[2 * i] = '0'; |
| 2354 statement[2 * i + 1] = ','; | 2354 statement[2 * i + 1] = ','; |
| 2355 } | 2355 } |
| 2356 statement[Code::kMaxArguments * 2] = 0; |
| 2356 | 2357 |
| 2357 const char* statement_data[] = { | 2358 const char* statement_data[] = { |
| 2358 statement, | 2359 statement, |
| 2359 NULL | 2360 NULL |
| 2360 }; | 2361 }; |
| 2361 | 2362 |
| 2362 // The test is quite slow, so run it with a reduced set of flags. | 2363 // The test is quite slow, so run it with a reduced set of flags. |
| 2363 static const ParserFlag empty_flags[] = {kAllowLazy}; | 2364 static const ParserFlag empty_flags[] = {kAllowLazy}; |
| 2364 RunParserSyncTest(context_data, statement_data, kError, empty_flags, 1); | 2365 RunParserSyncTest(context_data, statement_data, kError, empty_flags, 1); |
| 2365 } | 2366 } |
| OLD | NEW |