Title: vm: `let` declaration no longer throws SyntaxError for non-configurable global property in vm context (regression in v26) · Issue #63715 · nodejs/node · GitHub
Open Graph Title: vm: `let` declaration no longer throws SyntaxError for non-configurable global property in vm context (regression in v26) · Issue #63715 · nodejs/node
X Title: vm: `let` declaration no longer throws SyntaxError for non-configurable global property in vm context (regression in v26) · Issue #63715 · nodejs/node
Description: Version v26.3.0 Platform Darwin 24.6.0 Darwin Kernel Version 24.6.0: xnu-11417.140.69.705.2~1/RELEASE_ARM64_T6041 arm64 (macOS, Apple Silicon) Subsystem vm What steps will reproduce the bug? A let declaration that collides with a non-con...
Open Graph Description: Version v26.3.0 Platform Darwin 24.6.0 Darwin Kernel Version 24.6.0: xnu-11417.140.69.705.2~1/RELEASE_ARM64_T6041 arm64 (macOS, Apple Silicon) Subsystem vm What steps will reproduce the bug? A let ...
X Description: Version v26.3.0 Platform Darwin 24.6.0 Darwin Kernel Version 24.6.0: xnu-11417.140.69.705.2~1/RELEASE_ARM64_T6041 arm64 (macOS, Apple Silicon) Subsystem vm What steps will reproduce the bug? A let ...
Opengraph URL: https://github.com/nodejs/node/issues/63715
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"vm: `let` declaration no longer throws SyntaxError for non-configurable global property in vm context (regression in v26)","articleBody":"### Version\n\nv26.3.0\n\n### Platform\n\n```text\nDarwin 24.6.0 Darwin Kernel Version 24.6.0: xnu-11417.140.69.705.2~1/RELEASE_ARM64_T6041 arm64 (macOS, Apple Silicon)\n```\n\n### Subsystem\n\nvm\n\n### What steps will reproduce the bug?\n\nA let declaration that collides with a non-configurable property on a vm context's global object is no longer rejected with a SyntaxError. Save as repro.js and run with node repro.js:\n\n```js\nconst vm = require('vm');\nconst context = vm.createContext({});\n\n// Define a non-configurable (\"restricted\") property on the context global.\nvm.runInContext(\n \"Object.defineProperty(this, 'foo', { value: 1, configurable: false });\",\n context\n);\n\n// Per ECMA-262 GlobalDeclarationInstantiation step 3.d, a lexical\n// declaration colliding with a restricted global property must throw.\ntry {\n vm.runInContext('let foo;', context);\n console.log('NO ERROR (let foo; was accepted)');\n} catch (e) {\n console.log('THREW:', e.constructor.name, '-', e.message);\n}\n```\n\n### How often does it reproduce? Is there a required condition?\n\n100% reproducible.\n\n### What is the expected behavior? Why is that the expected behavior?\n\n`let foo;` should throw a `SyntaxError`, because foo is a `non-configurable` own property of the global object. v24.12.0 behaves correctly: THREW: `SyntaxError - Identifier 'foo' has already been declared`\n\n### What do you see instead?\n\nOn v26.3.0 the declaration is silently accepted: `NO ERROR (let foo; was accepted)`\n\n### Additional information\n\nFound via the test262 `language/global-code/script-decl-lex-restricted-global.js` case.","author":{"url":"https://github.com/hai-x","@type":"Person","name":"hai-x"},"datePublished":"2026-06-02T15:25:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/63715/node/issues/63715"}
| 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:45416043-9de1-f759-b330-d65b3e031a24 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AAB4:316D26:24E314A:3530C86:6A4D13B2 |
| html-safe-nonce | 462eb4b98931c05e6d9b67336d890606c0241ea44f355ee1d8e8f909bcd33c52 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUI0OjMxNkQyNjoyNEUzMTRBOjM1MzBDODY6NkE0RDEzQjIiLCJ2aXNpdG9yX2lkIjoiODY2MDA5MTU3MDMwMzYwMzYzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 28ca2bcf46282b281b8e2b5cd158a833e0a3b5f911ab7982195cf03f158e4cc1 |
| hovercard-subject-tag | issue:4572770181 |
| 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/63715/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7c5a453e159e1c54e80c84b37f7cf0a2b01aeb8b40664d157aab041d87e41cbd/nodejs/node/issues/63715 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7c5a453e159e1c54e80c84b37f7cf0a2b01aeb8b40664d157aab041d87e41cbd/nodejs/node/issues/63715 |
| og:image:alt | Version v26.3.0 Platform Darwin 24.6.0 Darwin Kernel Version 24.6.0: xnu-11417.140.69.705.2~1/RELEASE_ARM64_T6041 arm64 (macOS, Apple Silicon) Subsystem vm What steps will reproduce the bug? A let ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hai-x |
| hostname | github.com |
| expected-hostname | github.com |
| None | f02420044fa3730a0607f4a52546bdd73f5ae60187ef57d284ecb6d7f3f1d880 |
| 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 | f0b6a62c1f0be1086cb0b5b077b82cebe520eb42 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width