| Index: src/parser.cc
|
| ===================================================================
|
| --- src/parser.cc (revision 10350)
|
| +++ src/parser.cc (working copy)
|
| @@ -3000,7 +3000,19 @@
|
| }
|
|
|
| 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
|
|
|