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 9062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9073 | 9073 |
9074 {"", "var var1; var var1;"}, | 9074 {"", "var var1; var var1;"}, |
9075 {"", "var var1; var var1; var1 = 5;"}, | 9075 {"", "var var1; var var1; var1 = 5;"}, |
9076 {"", "var var1; if (true) { var var1; }"}, | 9076 {"", "var var1; if (true) { var var1; }"}, |
9077 {"", "if (true) { var var1; var var1; }"}, | 9077 {"", "if (true) { var var1; var var1; }"}, |
9078 {"", "var var1; if (true) { var var1; var1 = 5; }"}, | 9078 {"", "var var1; if (true) { var var1; var1 = 5; }"}, |
9079 {"", "if (true) { var var1; var var1; var1 = 5; }"}, | 9079 {"", "if (true) { var var1; var var1; var1 = 5; }"}, |
9080 {"", "var var1; var var1; function f() { var1; }"}, | 9080 {"", "var var1; var var1; function f() { var1; }"}, |
9081 {"", "var var1; var var1; function f() { var1 = 5; }"}, | 9081 {"", "var var1; var var1; function f() { var1 = 5; }"}, |
9082 | 9082 |
| 9083 {"", "var var1; if (true) { var var1; }"}, |
| 9084 {"", "var var1; if (true) { let var1; }"}, |
| 9085 {"", "let var1; if (true) { let var1; }"}, |
| 9086 |
| 9087 {"", "var var1; if (true) { const var1 = 0; }"}, |
| 9088 {"", "const var1 = 0; if (true) { const var1 = 0; }"}, |
| 9089 |
9083 {"", "arguments;"}, | 9090 {"", "arguments;"}, |
9084 {"", "arguments = 5;"}, | 9091 {"", "arguments = 5;"}, |
9085 {"", "function f() { arguments; }"}, | 9092 {"", "function f() { arguments; }"}, |
9086 {"", "function f() { arguments = 5; }"}, | 9093 {"", "function f() { arguments = 5; }"}, |
9087 | 9094 |
9088 {"", "var arguments;"}, | 9095 {"", "var arguments;"}, |
9089 {"", "var arguments; arguments = 5;"}, | 9096 {"", "var arguments; arguments = 5;"}, |
9090 {"", "if (true) { var arguments; }"}, | 9097 {"", "if (true) { var arguments; }"}, |
9091 {"", "if (true) { var arguments; arguments = 5; }"}, | 9098 {"", "if (true) { var arguments; arguments = 5; }"}, |
9092 {"", "var arguments; function f() { arguments; }"}, | 9099 {"", "var arguments; function f() { arguments; }"}, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9127 | 9134 |
9128 {"", "const [var1, var2] = [1, 2];"}, | 9135 {"", "const [var1, var2] = [1, 2];"}, |
9129 {"", "const [var1, var2, [var3, var4]] = [1, 2, [3, 4]];"}, | 9136 {"", "const [var1, var2, [var3, var4]] = [1, 2, [3, 4]];"}, |
9130 {"", "const [{var1: var2}, {var3: var4}] = [{var1: 1}, {var3: 2}];"}, | 9137 {"", "const [{var1: var2}, {var3: var4}] = [{var1: 1}, {var3: 2}];"}, |
9131 {"", "const [var1, ...var2] = [1, 2, 3];"}, | 9138 {"", "const [var1, ...var2] = [1, 2, 3];"}, |
9132 | 9139 |
9133 {"", "const {var1: var2, var3: var4} = {var1: 1, var3: 2};"}, | 9140 {"", "const {var1: var2, var3: var4} = {var1: 1, var3: 2};"}, |
9134 {"", | 9141 {"", |
9135 "const {var1: var2, var3: {var4: var5}} = {var1: 1, var3: {var4: 2}};"}, | 9142 "const {var1: var2, var3: {var4: var5}} = {var1: 1, var3: {var4: 2}};"}, |
9136 {"", "const {var1: var2, var3: [var4, var5]} = {var1: 1, var3: [2, 3]};"}, | 9143 {"", "const {var1: var2, var3: [var4, var5]} = {var1: 1, var3: [2, 3]};"}, |
| 9144 |
| 9145 {"", "inner;"}, |
| 9146 {"", "function f1() { f1; }"}, |
| 9147 {"", "function f1() { inner; }"}, |
| 9148 {"", "function f1() { function f2() { f1; } }"}, |
| 9149 {"", "function arguments() {}"}, |
| 9150 {"", "function f1() {} function f1() {}"}, |
| 9151 {"", "var f1; function f1() {}"}, |
| 9152 |
| 9153 {"", "inner = 3;"}, |
| 9154 {"", "function f1() { f1 = 3; }"}, |
| 9155 {"", "function f1() { f1; } f1 = 3;"}, |
| 9156 {"", "function arguments() {} arguments = 8"}, |
| 9157 {"", "function f1() {} f1 = 3; function f1() {}"}, |
| 9158 |
| 9159 {"", "var var1; eval('');"}, |
| 9160 {"", "var var1; function f1() { eval(''); }"}, |
| 9161 {"", "let var1; eval('');"}, |
| 9162 {"", "let var1; function f1() { eval(''); }"}, |
| 9163 {"", "const var1 = 10; eval('');"}, |
| 9164 {"", "const var1 = 10; function f1() { eval(''); }"}, |
9137 }; | 9165 }; |
9138 | 9166 |
9139 for (unsigned i = 0; i < arraysize(inners); ++i) { | 9167 for (unsigned i = 0; i < arraysize(inners); ++i) { |
9140 // First compile with the lazy inner function and extract the scope data. | 9168 // First compile with the lazy inner function and extract the scope data. |
9141 const char* inner_function = lazy_inner; | 9169 const char* inner_function = lazy_inner; |
9142 int inner_function_len = Utf8LengthHelper(inner_function) - 4; | 9170 int inner_function_len = Utf8LengthHelper(inner_function) - 4; |
9143 | 9171 |
9144 int params_len = Utf8LengthHelper(inners[i].params); | 9172 int params_len = Utf8LengthHelper(inners[i].params); |
9145 int source_len = Utf8LengthHelper(inners[i].source); | 9173 int source_len = Utf8LengthHelper(inners[i].source); |
9146 int len = | 9174 int len = |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9196 eager_info.literal()->scope()->inner_scope()->inner_scope(); | 9224 eager_info.literal()->scope()->inner_scope()->inner_scope(); |
9197 DCHECK_NOT_NULL(scope); | 9225 DCHECK_NOT_NULL(scope); |
9198 DCHECK_NULL(scope->sibling()); | 9226 DCHECK_NULL(scope->sibling()); |
9199 DCHECK(scope->is_function_scope()); | 9227 DCHECK(scope->is_function_scope()); |
9200 | 9228 |
9201 size_t index = 0; | 9229 size_t index = 0; |
9202 i::ScopeTestHelper::CompareScopeToData( | 9230 i::ScopeTestHelper::CompareScopeToData( |
9203 scope, lazy_info.preparsed_scope_data(), index); | 9231 scope, lazy_info.preparsed_scope_data(), index); |
9204 } | 9232 } |
9205 } | 9233 } |
OLD | NEW |