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 2527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2538 CcTest::i_isolate()->stack_guard()->SetStackLimit( | 2538 CcTest::i_isolate()->stack_guard()->SetStackLimit( |
2539 i::GetCurrentStackPosition() - 128 * 1024); | 2539 i::GetCurrentStackPosition() - 128 * 1024); |
2540 | 2540 |
2541 struct TestCase { | 2541 struct TestCase { |
2542 const char* program; | 2542 const char* program; |
2543 int functions; | 2543 int functions; |
2544 } test_cases[] = { | 2544 } test_cases[] = { |
2545 // No functions. | 2545 // No functions. |
2546 {"var x = 42;", 0}, | 2546 {"var x = 42;", 0}, |
2547 // Functions. | 2547 // Functions. |
2548 {"function foo() {}", 1}, {"function foo() {} function bar() {}", 2}, | 2548 {"function foo() {}", 1}, |
| 2549 {"function foo() {} function bar() {}", 2}, |
2549 // Getter / setter functions are recorded as functions if they're on the top | 2550 // Getter / setter functions are recorded as functions if they're on the top |
2550 // level. | 2551 // level. |
2551 {"var x = {get foo(){} };", 1}, | 2552 {"var x = {get foo(){} };", 1}, |
2552 // Functions insize lazy functions are not recorded. | 2553 // Functions insize lazy functions are not recorded. |
2553 {"function lazy() { function a() {} function b() {} function c() {} }", 1}, | 2554 {"function lazy() { function a() {} function b() {} function c() {} }", 1}, |
2554 {"function lazy() { var x = {get foo(){} } }", 1}, | 2555 {"function lazy() { var x = {get foo(){} } }", 1}, |
2555 {NULL, 0} | 2556 {NULL, 0} |
2556 }; | 2557 }; |
2557 | 2558 |
2558 for (int i = 0; test_cases[i].program; i++) { | 2559 for (int i = 0; test_cases[i].program; i++) { |
(...skipping 2777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5336 "class C {static set arguments(_) {}}", | 5337 "class C {static set arguments(_) {}}", |
5337 | 5338 |
5338 NULL}; | 5339 NULL}; |
5339 | 5340 |
5340 static const ParserFlag always_flags[] = { | 5341 static const ParserFlag always_flags[] = { |
5341 kAllowHarmonyClasses, kAllowHarmonyObjectLiterals, kAllowHarmonyScoping, | 5342 kAllowHarmonyClasses, kAllowHarmonyObjectLiterals, kAllowHarmonyScoping, |
5342 kAllowStrongMode}; | 5343 kAllowStrongMode}; |
5343 RunParserSyncTest(context_data, statement_data, kSuccess, NULL, 0, | 5344 RunParserSyncTest(context_data, statement_data, kSuccess, NULL, 0, |
5344 always_flags, arraysize(always_flags)); | 5345 always_flags, arraysize(always_flags)); |
5345 } | 5346 } |
OLD | NEW |