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

vm writes error stacktrace lines to console once, even if catched #7673

Closed
morris opened this issue Jul 12, 2016 · 2 comments
Closed

vm writes error stacktrace lines to console once, even if catched #7673

morris opened this issue Jul 12, 2016 · 2 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. vm Issues and PRs related to the vm subsystem.

Comments

@morris
Copy link

morris commented Jul 12, 2016

  • Version: v4.4.7
  • Platform: Windows 7 Professional SP1 64-bit
  • Subsystem: vm

Consider this script:

var vm = require( 'vm' );

var context = vm.createContext( {} );
var code = new vm.Script( 'throw "foo"' );

try {
  code.runInContext( context );
} catch ( err ) {
  console.log( err );
}

try {
  code.runInContext( context );
} catch ( err ) {
  console.log( err );
}

Expected output:

foo
foo

Actual output:

evalmachine.<anonymous>:1
throw "foo"
^
 foo
foo

Is this a bug or am I doing something wrong?

@addaleax addaleax added duplicate Issues and PRs that are duplicates of other issues or PRs. vm Issues and PRs related to the vm subsystem. labels Jul 12, 2016
@addaleax
Copy link
Member

This sounds a lot like a duplicate of #7397, which has been fixed in the latest v6.x release and which will very likely be fixed in v4 in v4.5.0. Thanks for the report, though!

I’m going ahead and closing this, but feel free to reopen and/or ask any follow-up questions.

@morris
Copy link
Author

morris commented Jul 12, 2016

Yes, looks that way - I'm sorry I couldn't find the existing issue. Thanks for your quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. vm Issues and PRs related to the vm subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants