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

Strict mode detection logic #1276

Open
adams85 opened this issue Feb 21, 2024 · 0 comments
Open

Strict mode detection logic #1276

adams85 opened this issue Feb 21, 2024 · 0 comments

Comments

@adams85
Copy link
Contributor

adams85 commented Feb 21, 2024

Hi there,

First of all, hats off to you as this a very solid, well-written project you're working on here. I've ported it to .NET recently and while doing that, I went through most of the codebase, so I'm saying this from experience.

Apart from some minor issues (will open additional issues/PRs regarding those), I only found one part that didn't really click with me: the strict mode detection logic. It's not something very problematic, just feels a bit fragile. And you can actually break it if you really want to. E.g. the following construct tricks Acorn into detecting strict mode incorrectly:

function f() { 'use strict'
in a; 00 }

So, I replaced this part with a more robust detection logic, and I'd recommend you the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant