OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 if (global_count > 0) { | 514 if (global_count > 0) { |
515 Handle<FixedArray> array = | 515 Handle<FixedArray> array = |
516 isolate()->factory()->NewFixedArray(2 * global_count, TENURED); | 516 isolate()->factory()->NewFixedArray(2 * global_count, TENURED); |
517 for (int j = 0, i = 0; i < length; i++) { | 517 for (int j = 0, i = 0; i < length; i++) { |
518 Declaration* decl = declarations->at(i); | 518 Declaration* decl = declarations->at(i); |
519 Variable* var = decl->proxy()->var(); | 519 Variable* var = decl->proxy()->var(); |
520 | 520 |
521 if (var->IsUnallocated()) { | 521 if (var->IsUnallocated()) { |
522 array->set(j++, *(var->name())); | 522 array->set(j++, *(var->name())); |
523 if (decl->fun() == NULL) { | 523 if (decl->fun() == NULL) { |
524 if (var->mode() == CONST) { | 524 if (var->binding_needs_init()) { |
525 // In case this is const property use the hole. | 525 // In case this binding needs initialization use the hole. |
526 array->set_the_hole(j++); | 526 array->set_the_hole(j++); |
527 } else { | 527 } else { |
528 array->set_undefined(j++); | 528 array->set_undefined(j++); |
529 } | 529 } |
530 } else { | 530 } else { |
531 Handle<SharedFunctionInfo> function = | 531 Handle<SharedFunctionInfo> function = |
532 Compiler::BuildFunctionInfo(decl->fun(), script()); | 532 Compiler::BuildFunctionInfo(decl->fun(), script()); |
533 // Check for stack-overflow exception. | 533 // Check for stack-overflow exception. |
534 if (function.is_null()) { | 534 if (function.is_null()) { |
535 SetStackOverflow(); | 535 SetStackOverflow(); |
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 } | 1348 } |
1349 | 1349 |
1350 return false; | 1350 return false; |
1351 } | 1351 } |
1352 | 1352 |
1353 | 1353 |
1354 #undef __ | 1354 #undef __ |
1355 | 1355 |
1356 | 1356 |
1357 } } // namespace v8::internal | 1357 } } // namespace v8::internal |
OLD | NEW |