Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
http://stackoverflow.com/questions/6784079/calling-a-function-thats-defi...
Going to see if I can do this with regex...
Comment | File | Size | Author |
---|---|---|---|
#3 | advagg-2500803-3-inline-defer-skip-loadCSS.patch | 1.12 KB | mikeytown2 |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedhttp://stackoverflow.com/questions/5198579/javascript-declaring-global-s...
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedregex to match on a function
'/\\s*function\\s+((?:[a-z][a-z0-9_]*))\\s*\\(.*\\)\\s*\\{/smix'
crude but should get the job done.
The alternative is to special case this as most function definitions are done in a .js file. I might end up doing both.
Comment #3
mikeytown2 CreditAttribution: mikeytown2 commented