A patch straight fromthat declare all JS files as library and add the relevant dependencies to all scripts.
SebCorbin should be credited, he's the one who wrote everything, I'm just putting it in a patch.
This will greatly simplify issues likeas well as prepare core for a module-oriented JS.
Basically, we shouldn't be using
drupal_add_js anymore, all scripts should be declared in
library_info since pretty much all of them have dependencies on drupal and jQuery. As D8 is focused on mobile, it's critical to be able to add JS that is not implicitly adding jQuery and drupal.js to the page.
The naming isn't totally consistent, feedback welcome. There is still one drupal_add_js left in the color module. not sure how best to fix it yet.
PASSED: [[SimpleTest]]: [MySQL] 40,337 pass(es).
FAILED: [[SimpleTest]]: [MySQL] 18,297 pass(es), 447 fail(s), and 403 exception(s).
FAILED: [[SimpleTest]]: [MySQL] 20,387 pass(es), 497 fail(s), and 882 exception(s).
PASSED: [[SimpleTest]]: [MySQL] 40,703 pass(es).