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

Configurable transforms #41

Closed
wants to merge 2 commits into from

Conversation

dejang
Copy link

@dejang dejang commented Sep 4, 2019

This PR addresses #34 and adds configurable options for internal source parsers used by realm-shim.

rejectImportExpressions: true|false : default true, use the rejectImportExpressions transformer
rejectHtmlComments: true|false : default true, use the rejectHtmlComments transformer
rejectSomeDirectEvalExpressions: true|false : default true, use the rejectSomeDirectEvalExpressions transformer

Set flags to false to selectively disable mandatory transformers. By default all transformer are enabled.

// a compartment which has only rejectHtmlComments enabled
Realm.createCompartment({ rejectImportExpressions: false, rejectSomeDirectEvalExpressions: false }) 

// a root realm having only rejectImportExpressions and htmlComments enabled
Realm.makeRootRealm({ rejectSomeDirectEvalExpressions: false })

@dgitin dgitin force-pushed the configurable-transforms branch 2 times, most recently from 83c966a to 850ff7a Compare September 4, 2019 18:02
@dejang dejang closed this Sep 4, 2019
@caridy
Copy link
Contributor

caridy commented Sep 4, 2019

I will like to see this as part of the factory() rather than as new configs at the compartment level.

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.

3 participants