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

Mark Marpit's options member as immutable #46

Merged
merged 5 commits into from
Aug 5, 2018
Merged

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Aug 4, 2018

We use options member of Marpit to store the initial options. Some several plugins have used this value directly because of supporting the change of value.

But actually, we have mixed the usage of options. For example, backgroundSyntax and filter option cannot apply the change of options value that makes after creating instance.

With this PR, we will mark options as immutable. To be specific, the options property of Marpit is defined by Object.defineProperty() without writable, and options object is frozen by Object.freeze().

Also we added the JSDoc document and TypeScript definition.

@yhatt yhatt merged commit 1c08c27 into master Aug 5, 2018
@yhatt yhatt deleted the immutable-options branch August 5, 2018 05:46
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

Successfully merging this pull request may close these issues.

1 participant