Title: Lexical variable declarations (`let`, `const`) unusable in repl if error thrown during declaration/first assignment · Issue #8309 · nodejs/node · GitHub
Open Graph Title: Lexical variable declarations (`let`, `const`) unusable in repl if error thrown during declaration/first assignment · Issue #8309 · nodejs/node
X Title: Lexical variable declarations (`let`, `const`) unusable in repl if error thrown during declaration/first assignment · Issue #8309 · nodejs/node
Description: Version: v.6.3.1 Platform: Linux (Ubuntu 14.04) Subsystem: repl (I think) let s = Set(); gives TypeError: Constructor Set requires 'new'. However, after this: s gives ReferenceError: s is not defined and let s = new Set(); gives TypeErro...
Open Graph Description: Version: v.6.3.1 Platform: Linux (Ubuntu 14.04) Subsystem: repl (I think) let s = Set(); gives TypeError: Constructor Set requires 'new'. However, after this: s gives ReferenceError: s is not defin...
X Description: Version: v.6.3.1 Platform: Linux (Ubuntu 14.04) Subsystem: repl (I think) let s = Set(); gives TypeError: Constructor Set requires 'new'. However, after this: s gives ReferenceError: s is n...
Opengraph URL: https://github.com/nodejs/node/issues/8309
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Lexical variable declarations (`let`, `const`) unusable in repl if error thrown during declaration/first assignment","articleBody":"- **Version**: v.6.3.1\n- **Platform**: Linux (Ubuntu 14.04)\n- **Subsystem**: `repl` (I think)\n\n\u003c!-- Enter your issue details below this comment. --\u003e\n\n```\nlet s = Set();\n```\n\ngives `TypeError: Constructor Set requires 'new'`.\n\nHowever, after this:\n\n```\ns\n```\n\ngives `ReferenceError: s is not defined`\n\nand\n\n```\nlet s = new Set();\n```\n\ngives `TypeError: Identifier 's' has already been declared`.\n\nI'm not sure whether this is a real bug or it's expected behaviour, but it sure does seem unusual that `s` becomes unusable from this point in in the repl.\n\nThis isn't a problem when running `node` on a js file because the TypeError simply terminates execution.\n","author":{"url":"https://github.com/polybuildr","@type":"Person","name":"polybuildr"},"datePublished":"2016-08-28T12:12:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":29},"url":"https://github.com/8309/node/issues/8309"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:99b26af4-7fb6-dca2-7886-760624dd2707 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A3F4:97AE1:34898A:4C3A5A:6A4E2D51 |
| html-safe-nonce | 5d2a3f58e75a3025dbb1e3727a6c988970353b5d943a2d85a99514ce9606c8a7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0Y0Ojk3QUUxOjM0ODk4QTo0QzNBNUE6NkE0RTJENTEiLCJ2aXNpdG9yX2lkIjoiMjE5NTQ3OTg1Nzc3NjcwMDc1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4312298d9813c28ceaa47fac5aa983e23882fc19278f368267375cf4dd6a6c31 |
| hovercard-subject-tag | issue:173643775 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/8309/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9af855d27ad4258d88e1dcaeb51ef305298d54150fac69dbcb8f37eb71e0d66b/nodejs/node/issues/8309 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9af855d27ad4258d88e1dcaeb51ef305298d54150fac69dbcb8f37eb71e0d66b/nodejs/node/issues/8309 |
| og:image:alt | Version: v.6.3.1 Platform: Linux (Ubuntu 14.04) Subsystem: repl (I think) let s = Set(); gives TypeError: Constructor Set requires 'new'. However, after this: s gives ReferenceError: s is not defin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | polybuildr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d9dd20d38f8ae3c4cb6b597807431db300d0bd2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width