debugger icon indicating copy to clipboard operation
debugger copied to clipboard

[Preview] Tooltip shows undefined for variable used as object key

Open juliandescottes opened this issue 9 years ago • 5 comments

STRs:

run in the console

(function (key) {
  debugger;
  let obj = {};
  obj[key] = 0;
  return obj;
})("a");

hover on "key" in obj[key]

Expected result: should show "a" Actual result: shows undefined

juliandescottes avatar Sep 14 '17 19:09 juliandescottes

juliandescottes avatar Sep 14 '17 19:09 juliandescottes

/claim

bomsy avatar Oct 20 '17 23:10 bomsy

Thanks for claiming the issue! :wave:

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Oct 20 '17 23:10 claim

The issue relates to the computed and uncomputed MemberExpressions. it's looking at obj[key] (computed) as obj.key (uncomputed)

bomsy avatar Oct 21 '17 12:10 bomsy

Thanks for fixing this @bomsy ! Just happened to test this in the last debugger bundle update and this works fine now :)

juliandescottes avatar Oct 28 '17 09:10 juliandescottes