YUI modules with no 'requires' property get ignored

Bug #828070 reported by Paul Hummer
10
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.

Revision history for this message
Richard Harding (rharding) wrote :

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:
YUI\.add\([\'\"\s]*([^\'\"]*)[\'\"\s]*,.*?function.*?[\'\"\s]*[0-9\.]*[\'\"\s]*({[^{}a-zA-Z]*(use|requires|optional|after|supersedes|omit|skinnable)?[^a-zA-Z]*[\s\'\":]*[^{}]*})\);

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:
https://bitbucket.org/mvantellingen/pyjsparser/src

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.

Revision history for this message
Richard Harding (rharding) wrote :

Added a branch that uses pyjsparsing built from github. It passes existing tests plus one that checks for an empty {} object for the details data.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.