| Index: src/parser.cc
|
| diff --git a/src/parser.cc b/src/parser.cc
|
| index c1681cfbd09da063960fedefac2572d059690a81..6531f10704c22996c5b0c0c0967836c71adfce7b 100644
|
| --- a/src/parser.cc
|
| +++ b/src/parser.cc
|
| @@ -3003,7 +3003,19 @@ Expression* Parser::ParseLeftHandSideExpression(bool* ok) {
|
| }
|
|
|
| case Token::LPAREN: {
|
| - int pos = scanner().location().beg_pos;
|
| + int pos;
|
| + if (scanner().current_token() == Token::IDENTIFIER) {
|
| + // For call of an identifier we want to report position of
|
| + // the identifier as position of the call in the stack trace.
|
| + pos = scanner().location().beg_pos;
|
| + } else {
|
| + // For other kinds of calls we record position of the parenthesis as
|
| + // position of the call. Note that this is extremely important for
|
| + // expressions of the form function(){...}() for which call position
|
| + // should not point to the closing brace otherwise it will intersect
|
| + // with positions recorded for function literal and confuse debugger.
|
| + pos = scanner().peek_location().beg_pos;
|
| + }
|
| ZoneList<Expression*>* args = ParseArguments(CHECK_OK);
|
|
|
| // Keep track of eval() calls since they disable all local variable
|
|
|