Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: src/parser.cc

Issue 7550013: Revert "Fix a bug in scope analysis." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-91120.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3623 matching lines...) Expand 10 before | Expand all | Expand 10 after
3634 // that case, we don't have a function name (it's empty). 3634 // that case, we don't have a function name (it's empty).
3635 Handle<String> name = 3635 Handle<String> name =
3636 is_named ? var_name : isolate()->factory()->empty_symbol(); 3636 is_named ? var_name : isolate()->factory()->empty_symbol();
3637 // The function name, if any. 3637 // The function name, if any.
3638 Handle<String> function_name = isolate()->factory()->empty_symbol(); 3638 Handle<String> function_name = isolate()->factory()->empty_symbol();
3639 if (is_named && (type == EXPRESSION || type == NESTED)) { 3639 if (is_named && (type == EXPRESSION || type == NESTED)) {
3640 function_name = name; 3640 function_name = name;
3641 } 3641 }
3642 3642
3643 int num_parameters = 0; 3643 int num_parameters = 0;
3644 // Function declarations are hoisted. 3644 Scope* scope = NewScope(top_scope_, Scope::FUNCTION_SCOPE, inside_with());
3645 Scope* scope = (type == DECLARATION)
3646 ? NewScope(top_scope_->DeclarationScope(), Scope::FUNCTION_SCOPE, false)
3647 : NewScope(top_scope_, Scope::FUNCTION_SCOPE, inside_with());
3648 ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(8); 3645 ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(8);
3649 int materialized_literal_count; 3646 int materialized_literal_count;
3650 int expected_property_count; 3647 int expected_property_count;
3651 int start_pos; 3648 int start_pos;
3652 int end_pos; 3649 int end_pos;
3653 bool only_simple_this_property_assignments; 3650 bool only_simple_this_property_assignments;
3654 Handle<FixedArray> this_property_assignments; 3651 Handle<FixedArray> this_property_assignments;
3655 bool has_duplicate_parameters = false; 3652 bool has_duplicate_parameters = false;
3656 // Parse function body. 3653 // Parse function body.
3657 { LexicalScope lexical_scope(this, scope, isolate()); 3654 { LexicalScope lexical_scope(this, scope, isolate());
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
5114 info->is_global(), 5111 info->is_global(),
5115 info->StrictMode()); 5112 info->StrictMode());
5116 } 5113 }
5117 } 5114 }
5118 5115
5119 info->SetFunction(result); 5116 info->SetFunction(result);
5120 return (result != NULL); 5117 return (result != NULL);
5121 } 5118 }
5122 5119
5123 } } // namespace v8::internal 5120 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-91120.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698