Chromium Code Reviews| 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 9240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9251 {"", "var var1; var var1; function f() { var1 = 5; }"}, | 9251 {"", "var var1; var var1; function f() { var1 = 5; }"}, |
| 9252 | 9252 |
| 9253 // Shadowing declarations. | 9253 // Shadowing declarations. |
| 9254 {"", "var var1; if (true) { var var1; }"}, | 9254 {"", "var var1; if (true) { var var1; }"}, |
| 9255 {"", "var var1; if (true) { let var1; }"}, | 9255 {"", "var var1; if (true) { let var1; }"}, |
| 9256 {"", "let var1; if (true) { let var1; }"}, | 9256 {"", "let var1; if (true) { let var1; }"}, |
| 9257 | 9257 |
| 9258 {"", "var var1; if (true) { const var1 = 0; }"}, | 9258 {"", "var var1; if (true) { const var1 = 0; }"}, |
| 9259 {"", "const var1 = 0; if (true) { const var1 = 0; }"}, | 9259 {"", "const var1 = 0; if (true) { const var1 = 0; }"}, |
| 9260 | 9260 |
| 9261 // Variable called "arguments" | 9261 // Arguments and this. |
| 9262 {"", "arguments;"}, | 9262 {"", "arguments;"}, |
| 9263 {"", "arguments = 5;"}, | 9263 {"", "arguments = 5;"}, |
| 9264 {"", "if (true) { arguments; }"}, | |
| 9265 {"", "if (true) { arguments = 5; }"}, | |
| 9264 {"", "function f() { arguments; }"}, | 9266 {"", "function f() { arguments; }"}, |
| 9265 {"", "function f() { arguments = 5; }"}, | 9267 {"", "function f() { arguments = 5; }"}, |
| 9266 | 9268 |
| 9269 {"", "this;"}, | |
| 9270 {"", "this = 5;"}, | |
| 9271 {"", "if (true) { this; }"}, | |
| 9272 {"", "if (true) { this = 5; }"}, | |
| 9273 {"", "function f() { this; }"}, | |
| 9274 {"", "function f() { this = 5; }"}, | |
| 9275 | |
| 9276 // Variable called "arguments" | |
| 9267 {"", "var arguments;"}, | 9277 {"", "var arguments;"}, |
| 9268 {"", "var arguments; arguments = 5;"}, | 9278 {"", "var arguments; arguments = 5;"}, |
| 9269 {"", "if (true) { var arguments; }"}, | 9279 {"", "if (true) { var arguments; }"}, |
| 9270 {"", "if (true) { var arguments; arguments = 5; }"}, | 9280 {"", "if (true) { var arguments; arguments = 5; }"}, |
| 9271 {"", "var arguments; function f() { arguments; }"}, | 9281 {"", "var arguments; function f() { arguments; }"}, |
| 9272 {"", "var arguments; arguments = 5; function f() { arguments; }"}, | 9282 {"", "var arguments; arguments = 5; function f() { arguments; }"}, |
| 9273 {"", "var arguments; function f() { arguments = 5; }"}, | 9283 {"", "var arguments; function f() { arguments = 5; }"}, |
| 9274 | 9284 |
| 9275 {"", "let arguments;"}, | 9285 {"", "let arguments;"}, |
| 9276 {"", "let arguments; arguments = 5;"}, | 9286 {"", "let arguments; arguments = 5;"}, |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9428 | 9438 |
| 9429 {"", "var var1 = 0; for(var1; var1 < 2; ++var1) { }"}, | 9439 {"", "var var1 = 0; for(var1; var1 < 2; ++var1) { }"}, |
| 9430 {"", | 9440 {"", |
| 9431 "var var1 = 0; for (var1; var1 < 2; ++var1) { function foo() { var1; } " | 9441 "var var1 = 0; for (var1; var1 < 2; ++var1) { function foo() { var1; } " |
| 9432 "}"}, | 9442 "}"}, |
| 9433 {"", "var var1 = 0; for (var1; var1 > 2; ) { }"}, | 9443 {"", "var var1 = 0; for (var1; var1 > 2; ) { }"}, |
| 9434 {"", "var var1 = 0; for (var1; var1 > 2; ) { function foo() { var1; } }"}, | 9444 {"", "var var1 = 0; for (var1; var1 > 2; ) { function foo() { var1; } }"}, |
| 9435 {"", | 9445 {"", |
| 9436 "var var1 = 0; for (var1; var1 > 2; ) { function foo() { var1 = 6; } }"}, | 9446 "var var1 = 0; for (var1; var1 > 2; ) { function foo() { var1 = 6; } }"}, |
| 9437 | 9447 |
| 9438 // FIXME(marja): Add test cases for special variables (this, arguments | |
|
marja
2017/02/07 08:23:16
This was a red herring; turns out this expressions
vogelheim
2017/02/07 08:33:47
Acknowledged.
| |
| 9439 // etc) referred to in the for loop conditions. | |
| 9440 | |
| 9441 // Sloppy block functions. | 9448 // Sloppy block functions. |
| 9442 {"", "if (true) { function f1() {} }"}, | 9449 {"", "if (true) { function f1() {} }"}, |
| 9443 {"", "if (true) { function f1() {} function f1() {} }"}, | 9450 {"", "if (true) { function f1() {} function f1() {} }"}, |
| 9444 {"", "if (true) { if (true) { function f1() {} } }"}, | 9451 {"", "if (true) { if (true) { function f1() {} } }"}, |
| 9445 {"", "if (true) { if (true) { function f1() {} function f1() {} } }"}, | 9452 {"", "if (true) { if (true) { function f1() {} function f1() {} } }"}, |
| 9446 {"", "if (true) { function f1() {} f1 = 3; }"}, | 9453 {"", "if (true) { function f1() {} f1 = 3; }"}, |
| 9447 | 9454 |
| 9448 {"", "if (true) { function f1() {} function foo() { f1; } }"}, | 9455 {"", "if (true) { function f1() {} function foo() { f1; } }"}, |
| 9449 {"", "if (true) { function f1() {} } function foo() { f1; }"}, | 9456 {"", "if (true) { function f1() {} } function foo() { f1; }"}, |
| 9450 {"", | 9457 {"", |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9528 eager_info.literal()->scope()->inner_scope()->inner_scope(); | 9535 eager_info.literal()->scope()->inner_scope()->inner_scope(); |
| 9529 DCHECK_NOT_NULL(scope); | 9536 DCHECK_NOT_NULL(scope); |
| 9530 DCHECK_NULL(scope->sibling()); | 9537 DCHECK_NULL(scope->sibling()); |
| 9531 DCHECK(scope->is_function_scope()); | 9538 DCHECK(scope->is_function_scope()); |
| 9532 | 9539 |
| 9533 size_t index = 0; | 9540 size_t index = 0; |
| 9534 i::ScopeTestHelper::CompareScopeToData( | 9541 i::ScopeTestHelper::CompareScopeToData( |
| 9535 scope, lazy_info.preparsed_scope_data(), index); | 9542 scope, lazy_info.preparsed_scope_data(), index); |
| 9536 } | 9543 } |
| 9537 } | 9544 } |
| OLD | NEW |