Skip to content

fix: prevent property access if properties couldn't be resolved when syntax highlighting in the REPL #2412

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

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

Snehil-Shah
Copy link
Member

@Snehil-Shah Snehil-Shah commented Jun 20, 2024

Description

What is the purpose of this pull request?

This pull request:

  • prevents property access if the internal MemberExpression can't be resolved into a definite property name (without any script execution) when tokenizing.
  • For a[b.c], if b.c doesn't correspond to a literal value in context, (say it's a function or an object), then no point in trying to compute a[Function]. To actually be able to compute it, the function (b.c) needs to be eagerly evaluated to resolve it into a definite literal name.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@Snehil-Shah Snehil-Shah added REPL Issue or pull request specific to the project REPL. Bug Something isn't working. labels Jun 20, 2024
@Planeshifter Planeshifter self-requested a review June 20, 2024 14:03
@Planeshifter Planeshifter merged commit 1036087 into stdlib-js:develop Jun 20, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working. REPL Issue or pull request specific to the project REPL.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants