Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakpoint misbehavior inside symbol-keyed function property #1122

Closed
kkeri opened this issue Jul 4, 2016 · 3 comments
Closed

Breakpoint misbehavior inside symbol-keyed function property #1122

kkeri opened this issue Jul 4, 2016 · 3 comments

Comments

@kkeri
Copy link

kkeri commented Jul 4, 2016

Steps to Reproduce
  1. Create new "Blank node.js Console Application".
  2. Paste the following code into app.js.
  3. Set breakpoint at line 5.
  4. Choose Debug > Start debugging.
var S = Symbol();
var o = {
    [S]() {
        console.log("before");
        console.log("at breakpoint");
        console.log("after");
    }
}
o[S]();
Expected Behavior

"before" is printed to the console then the debugger stops at line 5.

Actual Behavior

"before" is printed to the console then the program hangs up. VS remains responsive.
If I choose Debug > Break all then Debug > Continue,
the program runs and terminates without ever stopping at the breakpoint.

  • NTVS Version: 1.2.40627.01
  • Visual Studio Version: VS 2015 Community U3
  • Node.js Version: v4.4.7-x64, v6.2.2-x64
@kkeri
Copy link
Author

kkeri commented Jul 4, 2016

I was able to reproduce the same effect using the built-in command line debugger of node.js, so this seems to be unrelated from Node.js tools.
I have reported the bug to the node.js developers.

A possible workaround is to extract the function reference into a variable and call the function via that variable.

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

@mjbvz
Copy link
Contributor

mjbvz commented Jul 6, 2016

Thank you for reporting this to node and finding a work around.

I'm closing this as external because it's not actionable for NTVS, but will keep on eye on the reported issue to see when the fix lands in Node.

@mjbvz mjbvz closed this as completed Jul 6, 2016
@kkeri
Copy link
Author

kkeri commented Jul 6, 2016

My thoughts exactly. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants