YUI modules with no 'requires' property get ignored
Bug #828070 reported by
Paul Hummer
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Convoy |
New
|
Undecided
|
Unassigned |
Bug Description
I have a YUI module that looks like this:
YUI.add('thing', function(Y) {
...
}, '1.0', {});
Since there is no requires clause, convoy's metadata scanning skips it entirely.
Related branches
To post a comment you must log in.
I tried like mad to get the regex right, but if you allow for {} then the test for the test_extract_ metadata_ not_metadata fails.
Tested Regex: ([\'\"\ s]*([^\ '\"]*)[ \'\"\s] *,.*?function. *?[\'\" \s]*[0- 9\.]*[\ '\"\s]* ({[^{}a- zA-Z]*( use|requires| optional| after|supersede s|omit| skinnable) ?[^a-zA- Z]*[\s\ '\":]*[ ^{}]*}) \);
YUI\.add\
I wonder if using a true parse would make life easier. In particular this seems to work well for a couple of test snippets of code: /bitbucket. org/mvantelling en/pyjsparser/ src
https:/
which seems to have been forked and better maintained over here: https:/ /github. com/nullie/ pyjsparser
Note that speed seems to be pretty slow in test cases though.