René's URL Explorer Experiment


Title: Generated code drops required parentheses around `in` inside a `for`-init arrow body → unparsable output ("Invalid left-hand side in for-loop") · Issue #1419 · javascript-obfuscator/javascript-obfuscator · GitHub

Open Graph Title: Generated code drops required parentheses around `in` inside a `for`-init arrow body → unparsable output ("Invalid left-hand side in for-loop") · Issue #1419 · javascript-obfuscator/javascript-obfuscator

X Title: Generated code drops required parentheses around `in` inside a `for`-init arrow body → unparsable output ("Invalid left-hand side in for-loop") · Issue #1419 · javascript-obfuscator/javascript-obfuscator

Description: Expected Behavior Obfuscating valid input should always produce syntactically valid output (or throw). Parentheses around an in expression inside a for statement's init are grammatically required (the "NoIn" restriction) and must be pres...

Open Graph Description: Expected Behavior Obfuscating valid input should always produce syntactically valid output (or throw). Parentheses around an in expression inside a for statement's init are grammatically required (...

X Description: Expected Behavior Obfuscating valid input should always produce syntactically valid output (or throw). Parentheses around an in expression inside a for statement's init are grammatically requir...

Opengraph URL: https://github.com/javascript-obfuscator/javascript-obfuscator/issues/1419

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generated code drops required parentheses around `in` inside a `for`-init arrow body → unparsable output (\"Invalid left-hand side in for-loop\")","articleBody":"## Expected Behavior\n\nObfuscating valid input should always produce **syntactically valid** output (or throw). Parentheses around an `in` expression inside a `for` statement's init are grammatically required (the \"NoIn\" restriction) and must be preserved.\n\n## Current Behavior\n\nThe obfuscator silently emits **unparsable** JavaScript. It removes the parentheses around an `in` expression located in a `for` init, so the bare `in` is parsed as a `for-in` head and the code throws at parse time:\n\n- V8 / native: `SyntaxError: Invalid left-hand side in for-loop`\n- acorn: `Assigning to rvalue`\n\nNo exception is raised by `obfuscate()` — the invalid code is returned as-is, which can ship and break the application at load.\n\n## Steps to Reproduce\n\nInput (valid JS):\n\n```js\nfor(a=(t,e)=\u003e(t in e)?0:1;;){}\n```\n\n```js\nimport O from 'javascript-obfuscator'\nconst out = O.obfuscate(`for(a=(t,e)=\u003e(t in e)?0:1;;){}`, { compact: true }).getObfuscatedCode()\nconsole.log(out)\n// for(a=(_0x14502c,_0xcad55a)=\u003e_0x14502c in _0xcad55a?0x0:0x1;;){}\n//                              ^^^^^^^^^^^^^^^^^^^^^^^ parentheses around `(t in e)` dropped\nnew Function(out) // throws: Invalid left-hand side in for-loop\n```\n\nThe protective parentheses present in the input (`(t in e)`) are absent from the output.\n\n## Reproduces regardless of options\n\nSame broken output with **default options**, with `{ compact: true }` only, and even with `{ simplify: false }` — so this is in the code generator / parenthesization logic, not a specific transform:\n\n| Options | Result |\n|---|---|\n| `{}` (defaults) | ❌ Invalid left-hand side in for-loop |\n| `{ compact: true }` | ❌ |\n| `{ compact: true, simplify: false }` | ❌ |\n\n## Root cause\n\nInside a `for` statement's init, an unparenthesized `in` operator is interpreted as introducing a `for-in` loop (the ECMAScript \"NoIn\" grammar production). The input parenthesizes the `in` expression to opt out of that interpretation; the obfuscator's output omits those parentheses, so the parser consumes everything before `in` as the `for-in` binding target — which is not a valid assignment target — hence the parse error.\n\nFor comparison, the same `in` expression outside a `for` init (e.g. `var a = (b in c) ? 1 : 2;`) is correctly emitted without parentheses and stays valid — confirming the parentheses are only required in the `for`-init \"NoIn\" context, which the generator does not account for.\n\n## Real-world impact\n\nHit in a production bundle: obfuscating an app bundle that includes `@sentry`/`rrweb` code (a base64 char-code table built via `for (h = (e,t,n) =\u003e (t in e) ? define(e,t,…) : e[t]=n, i=0; i\u003cs.length; i++) …`) produced an unparsable bundle. On a single-file (inlined) native bundle this bricks the app at load — the JS never parses. Minimal reduction of that bundle yields the one-line repro above.\n\n## Your Environment\n\n- `javascript-obfuscator`: **5.4.3** (latest)\n- Node.js: 22.x\n- OS: Linux\n\n## Related\n\n- #328, #361 — destructuring assignment without declaration `({a} = obj)` (closed 2020). Same family (assignment-target handling) but those were *runtime-incorrect* output; this one is *parse-invalid* output, specific to the `for`-init NoIn context.","author":{"url":"https://github.com/VolatilCapital","@type":"Person","name":"VolatilCapital"},"datePublished":"2026-06-17T13:40:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1419/javascript-obfuscator/issues/1419"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:2cdd8bb7-773e-612d-6a29-82de9caf3d63
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBACA:1E9DA0:70C5D5:98E280:6A62DED2
html-safe-nonce2abcf4e3c5f57e35c76b7904ad69f8bb999f64493c44ac6eac3682b5879c3def
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUNBOjFFOURBMDo3MEM1RDU6OThFMjgwOjZBNjJERUQyIiwidmlzaXRvcl9pZCI6IjU4NzY3NTgwNzE2Mjk1MDQyMTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac6934c129c79d4a70bc26e36588e3001c7053f49f31744ef6adddd1e393ae2fe4
hovercard-subject-tagissue:4683807404
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/javascript-obfuscator/javascript-obfuscator/1419/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d9028451b856aebeb991924dcd891e9b90de2d7409189d5d7a3396d75d080ff4/javascript-obfuscator/javascript-obfuscator/issues/1419
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d9028451b856aebeb991924dcd891e9b90de2d7409189d5d7a3396d75d080ff4/javascript-obfuscator/javascript-obfuscator/issues/1419
og:image:altExpected Behavior Obfuscating valid input should always produce syntactically valid output (or throw). Parentheses around an in expression inside a for statement's init are grammatically required (...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameVolatilCapital
hostnamegithub.com
expected-hostnamegithub.com
Nonedf33b1b61ee7b9a0af988199bfc3503c9c1acafb1f1d40e1f140ea7c84f890dd
turbo-cache-controlno-preview
go-importgithub.com/javascript-obfuscator/javascript-obfuscator git https://github.com/javascript-obfuscator/javascript-obfuscator.git
octolytics-dimension-user_id23015672
octolytics-dimension-user_loginjavascript-obfuscator
octolytics-dimension-repository_id58360147
octolytics-dimension-repository_nwojavascript-obfuscator/javascript-obfuscator
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id58360147
octolytics-dimension-repository_network_root_nwojavascript-obfuscator/javascript-obfuscator
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released41cd1bdb290013455c0ac430fa755621733f5eb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/javascript-obfuscator/javascript-obfuscator/issues/1419#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjavascript-obfuscator%2Fjavascript-obfuscator%2Fissues%2F1419
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjavascript-obfuscator%2Fjavascript-obfuscator%2Fissues%2F1419
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=javascript-obfuscator%2Fjavascript-obfuscator
Reloadhttps://github.com/javascript-obfuscator/javascript-obfuscator/issues/1419
Reloadhttps://github.com/javascript-obfuscator/javascript-obfuscator/issues/1419
Reloadhttps://github.com/javascript-obfuscator/javascript-obfuscator/issues/1419
Please reload this pagehttps://github.com/javascript-obfuscator/javascript-obfuscator/issues/1419
javascript-obfuscator https://github.com/javascript-obfuscator
javascript-obfuscatorhttps://github.com/javascript-obfuscator/javascript-obfuscator
Please reload this pagehttps://github.com/javascript-obfuscator/javascript-obfuscator/issues/1419
Notifications https://github.com/login?return_to=%2Fjavascript-obfuscator%2Fjavascript-obfuscator
Fork 1.7k https://github.com/login?return_to=%2Fjavascript-obfuscator%2Fjavascript-obfuscator
Star 16.2k https://github.com/login?return_to=%2Fjavascript-obfuscator%2Fjavascript-obfuscator
Code https://github.com/javascript-obfuscator/javascript-obfuscator
Issues 15 https://github.com/javascript-obfuscator/javascript-obfuscator/issues
Pull requests 5 https://github.com/javascript-obfuscator/javascript-obfuscator/pulls
Discussions https://github.com/javascript-obfuscator/javascript-obfuscator/discussions
Actions https://github.com/javascript-obfuscator/javascript-obfuscator/actions
Projects https://github.com/javascript-obfuscator/javascript-obfuscator/projects
Security and quality 0 https://github.com/javascript-obfuscator/javascript-obfuscator/security
Insights https://github.com/javascript-obfuscator/javascript-obfuscator/pulse
Code https://github.com/javascript-obfuscator/javascript-obfuscator
Issues https://github.com/javascript-obfuscator/javascript-obfuscator/issues
Pull requests https://github.com/javascript-obfuscator/javascript-obfuscator/pulls
Discussions https://github.com/javascript-obfuscator/javascript-obfuscator/discussions
Actions https://github.com/javascript-obfuscator/javascript-obfuscator/actions
Projects https://github.com/javascript-obfuscator/javascript-obfuscator/projects
Security and quality https://github.com/javascript-obfuscator/javascript-obfuscator/security
Insights https://github.com/javascript-obfuscator/javascript-obfuscator/pulse
#1426https://github.com/javascript-obfuscator/javascript-obfuscator/pull/1426
Generated code drops required parentheses around in inside a for-init arrow body → unparsable output ("Invalid left-hand side in for-loop")https://github.com/javascript-obfuscator/javascript-obfuscator/issues/1419#top
#1426https://github.com/javascript-obfuscator/javascript-obfuscator/pull/1426
https://github.com/VolatilCapital
VolatilCapitalhttps://github.com/VolatilCapital
on Jun 17, 2026https://github.com/javascript-obfuscator/javascript-obfuscator/issues/1419#issue-4683807404
javascript-obfuscator break Assignment without declaration. #328https://github.com/javascript-obfuscator/javascript-obfuscator/issues/328
Object destructuring assignment does not work for variables initialized previously #361https://github.com/javascript-obfuscator/javascript-obfuscator/issues/361
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.