-
Notifications
You must be signed in to change notification settings - Fork 479
Closed
Description
This [1] is weird. I assumed each rule was self-contained piece and not a self-contained piece within a closure (which was generated by the build process).
If you are trying to write a new rule, you might feel inclined to skip the whole building process (because it's kinda annoying) and just include the new rule on your test page. However, your new rule won't be inside that closure anymore and parserlib will be undefined (-> "Fatal error, cannot continue: parserlib is not defined").
There are at least two options:
- Pass
parserlibas third argument to a rule'sinitfunction. - Introduce a different way to identify pieces which doesn't rely on
instanceof.
Either way, I'd get the rules out of that closure. They shouldn't have access to it.
Edit: [1] Original title was "Rules gain access to parserlib via closure"