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

JS: Improved get/set and parameter detection #2387

Merged
merged 2 commits into from May 29, 2020

Conversation

RunDevelopment
Copy link
Member

get and set now have to be followed by (?=\s*[\[$\w\xA0-\uFFFF]).

While writing the tests for this, I noticed that parameter doesn't handle computed properties, so I fixed that as well. Example:

const obj = {
	set [expr](val) { } // "val" wasn't detected.
};

This resolves #2386.

@madx
Copy link

madx commented May 16, 2020

Yay! Looks great!

@RunDevelopment RunDevelopment merged commit ed71515 into PrismJS:master May 29, 2020
@RunDevelopment RunDevelopment deleted the js-get-set-improvement branch May 29, 2020 14:24
@madx
Copy link

madx commented May 29, 2020

Hurray! 🍾

quentinvernot pushed a commit to TankerHQ/prismjs that referenced this pull request Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

set is not a JavaScript keyword
2 participants