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

Side by Side Diff: src/parser.cc

Issue 16125007: Fix function name inferring inside closures (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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/cctest/test-func-name-inference.cc » ('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 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 3417 matching lines...) Expand 10 before | Expand all | Expand 10 after
3428 // direct eval calls. These calls are all of the form eval(...), with 3428 // direct eval calls. These calls are all of the form eval(...), with
3429 // no explicit receiver. 3429 // no explicit receiver.
3430 // These calls are marked as potentially direct eval calls. Whether 3430 // These calls are marked as potentially direct eval calls. Whether
3431 // they are actually direct calls to eval is determined at run time. 3431 // they are actually direct calls to eval is determined at run time.
3432 VariableProxy* callee = result->AsVariableProxy(); 3432 VariableProxy* callee = result->AsVariableProxy();
3433 if (callee != NULL && 3433 if (callee != NULL &&
3434 callee->IsVariable(isolate()->factory()->eval_string())) { 3434 callee->IsVariable(isolate()->factory()->eval_string())) {
3435 top_scope_->DeclarationScope()->RecordEvalCall(); 3435 top_scope_->DeclarationScope()->RecordEvalCall();
3436 } 3436 }
3437 result = factory()->NewCall(result, args, pos); 3437 result = factory()->NewCall(result, args, pos);
3438 if (fni_ != NULL) fni_->RemoveLastFunction();
3438 break; 3439 break;
3439 } 3440 }
3440 3441
3441 case Token::PERIOD: { 3442 case Token::PERIOD: {
3442 Consume(Token::PERIOD); 3443 Consume(Token::PERIOD);
3443 int pos = scanner().location().beg_pos; 3444 int pos = scanner().location().beg_pos;
3444 Handle<String> name = ParseIdentifierName(CHECK_OK); 3445 Handle<String> name = ParseIdentifierName(CHECK_OK);
3445 result = 3446 result =
3446 factory()->NewProperty(result, factory()->NewLiteral(name), pos); 3447 factory()->NewProperty(result, factory()->NewLiteral(name), pos);
3447 if (fni_ != NULL) fni_->PushLiteralName(name); 3448 if (fni_ != NULL) fni_->PushLiteralName(name);
(...skipping 2578 matching lines...) Expand 10 before | Expand all | Expand 10 after
6026 ASSERT(info()->isolate()->has_pending_exception()); 6027 ASSERT(info()->isolate()->has_pending_exception());
6027 } else { 6028 } else {
6028 result = ParseProgram(); 6029 result = ParseProgram();
6029 } 6030 }
6030 } 6031 }
6031 info()->SetFunction(result); 6032 info()->SetFunction(result);
6032 return (result != NULL); 6033 return (result != NULL);
6033 } 6034 }
6034 6035
6035 } } // namespace v8::internal 6036 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-func-name-inference.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698