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.
Adding 'use strict'
to adminimal_theme.js has two major benefits.
The first is maintainability, as it turns common mistakes - which are silently ignored in regular Javascript - into errors.
The second is performance, since browser engines can optimize the script better, as they know they don't have to work around possible allowable mistakes.
The script is already 'use strict'
compliant, so this would be an easy win.
Here's is the the MDN documentation for those who are unfamiliar or want to learn more.
Comment | File | Size | Author |
---|---|---|---|
#1 | add_use_strict_to_js-2447677-1.patch | 4.33 KB | bronzehedwick |
Comments
Comment #1
bronzehedwickAdded a patch. Hopefully my naming is correct...I've read a couple pages on drupal.org on how to submit a patch, but I'm getting conflicting information, namely from https://www.drupal.org/node/1820494/git-instructions/8.x-1.x/nonmaintainer and https://www.drupal.org/node/707484.
Comment #2
ANDiTKO CreditAttribution: ANDiTKO commentedI dont care about the patch naming at all ;)
All i care is that you spend time creating it and i was able to apply it successfully.
Thanks! Applied to the latest dev, and soon in next stable.
Comment #3
bronzehedwickExcellent, thanks!