Skip to content

Debugger misbehavior in function called via symbol property reference #7536

Closed
@kkeri

Description

@kkeri
  • Version: v4.4.7, v6.2.2
  • Platform: Windows7 64-bit
  • Subsystem: debugger
Steps to Reproduce
  1. Create the file test.js with the following code.
  2. Invoke node debug test.js.
    The debugger stops at line 1.
  3. Type the command 'c'
var S = Symbol();
var o = {
    [S]() {
        console.log("before");
        debugger;
        console.log("at breakpoint");
        console.log("after");
    }
}
o[S]();
Expected Behavior

"before" is printed then the debugger stops at debugger;.

Actual Behavior

"before" is printed and I get a debug> prompt without any code listing.
If I type 'bt' I get the message 'Can't request backtrace now'.
If I type 'list(5)' I get a list when the current line is marked at line 1.
If I type 'c' then "at breakpoint" and "after" is printed and
the program terminates without ever stopping at the breakpoint.

If I change the last line as follows, everything goes fine.

var S = Symbol();
var o = {
    [S]() {
        console.log("before");
        debugger;
        console.log("at breakpoint");
        console.log("after");
    }
}
var f = o[S];
f();

Node Inspector and VS 2015 Node.js tools also show weird behavior with the sample code. Effectively they are unable to stop at the breakpoint in o[S].

Metadata

Metadata

Assignees

No one assigned

    Labels

    v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions