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

Inline values are shown for a variable in different scope if it has same name in current scope #19215

Closed
sandy081 opened this issue Jan 24, 2017 · 5 comments
Assignees
Milestone

Comments

@sandy081
Copy link
Member

sandy081 commented Jan 24, 2017

Testing #18670

Using Node

See the inline values for variable a under function c scope and in current scope.

image

@isidorn
Copy link
Contributor

isidorn commented Jan 24, 2017

@sandy081 please provide this repository so I can easily reporduce this - thanks

@isidorn isidorn added this to the January 2017 milestone Jan 24, 2017
@sandy081
Copy link
Member Author

@isidorn It's our smoke test express repository and modified the file index.js. Here is the code

var express = require('express');
var router = express.Router();

function c() {
  return {
    a: 1
  }
}

/* GET home page. */
router.get('/', function(req, res, next) {

  var a = 1234;

  if (a === 1234) {
    a = 3;
    var b = 2345;
    var a = 4;
  } else {
    var b = 5678;
  }
  a = c().a;
  a = 5678;

  console.log(c);
  res.render('index', { title: 'Express' });

});

module.exports = router;

@isidorn
Copy link
Contributor

isidorn commented Jan 24, 2017

@sandy081 thank you

@sandy081
Copy link
Member Author

@isidorn Updated the description it is happening with Node not with Node2. If scopes are not supported by Node, please close it

@isidorn
Copy link
Contributor

isidorn commented Jan 24, 2017

Scopes are not supported by node

@isidorn isidorn closed this as completed Jan 24, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants