Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.32
diff -u -r1.32 common.test
--- modules/simpletest/tests/common.test	31 Mar 2009 01:49:53 -0000	1.32
+++ modules/simpletest/tests/common.test	7 Apr 2009 23:08:17 -0000
@@ -195,7 +195,7 @@
   function setUp() {
     parent::setUp('php');
     // Reset drupal_add_css() before each test.
-    drupal_add_css(NULL, 'reset');
+    drupal_static_reset('drupal_add_css');
   }
 
   /**
@@ -218,7 +218,7 @@
    * Makes sure that reseting the CSS empties the cache.
    */
   function testReset() {
-    drupal_add_css(NULL, 'reset');
+    drupal_static_reset('drupal_add_css');
     $this->assertEqual(array(), drupal_add_css(), t('Resetting the CSS empties the cache.'));
   }
 
@@ -427,7 +427,7 @@
     variable_set('preprocess_js', 0);
 
     // Reset drupal_add_js() before each test.
-    drupal_add_js(NULL, 'reset');
+    drupal_static_reset('drupal_add_js');
   }
 
   function tearDown() {
@@ -479,7 +479,7 @@
    */
   function testReset() {
     drupal_add_js('misc/collapse.js');
-    drupal_add_js(NULL, 'reset');
+    drupal_static_reset('drupal_add_js');
     $this->assertEqual(array(), drupal_add_js(), t('Resetting the JavaScript correctly empties the cache.'));
   }
 
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.874
diff -u -r1.874 common.inc
--- includes/common.inc	30 Mar 2009 05:13:45 -0000	1.874
+++ includes/common.inc	7 Apr 2009 23:08:17 -0000
@@ -1978,6 +1978,9 @@
 /**
  * Adds a cascading stylesheet to the stylesheet queue.
  *
+ * Calling drupal_static_reset('drupal_add_css') will clear all cascading
+ * stylesheets added so far.
+ *
  * @param $data
  *   (optional) The stylesheet data to be added, depending on what is passed
  *   through to the $options['type'] parameter:
@@ -2000,15 +2003,13 @@
  *   - 'inline': A string of CSS that should be placed in the given scope. Note
  *     that it is better practice to use 'module' or 'theme' stylesheets, rather
  *     than 'inline' as the CSS would then be aggregated and cached.
- *   - 'reset': Any previously added CSS will be reset and $data will be ignored.
  *
  * @param $options
  *   (optional) A string defining the 'type' of CSS that is being added in the
  *   $data parameter ('module', 'theme' or 'inline'), or an associative array of
  *   additional options, with the following keys:
  *   - 'type': The type of stylesheet that is being added. Types are: 'module',
- *     'theme', 'inline' or 'reset'. Defaults to 'module'. If the type is
- *     'reset', then the CSS will be reset, ignoring $path and other $options.
+ *     'theme' or 'inline'. Defaults to 'module'.
  *   - 'media': The media type for the stylesheet, e.g., all, print, screen.
  *     Defaults to 'all'.
  *   - 'preprocess': Allows the CSS to be aggregated and compressed if the
@@ -2039,7 +2040,7 @@
  *   An array of queued cascading stylesheets.
  */
 function drupal_add_css($data = NULL, $options = NULL) {
-  static $css = array();
+  $css = &drupal_static(__FUNCTION__, array());
   global $language;
 
   // Construct the options, taking the defaults into consideration.
@@ -2052,11 +2053,6 @@
     $options = array();
   }
 
-  // Request made to reset the CSS added so far.
-  if (isset($options['type']) && $options['type'] == 'reset') {
-    return $css = array();
-  }
-
   // Create an array of CSS files for each media type first, since each type needs to be served
   // to the browser differently.
   if (isset($data)) {
@@ -2388,6 +2384,9 @@
  *   drupal_add_js('http://example.com/example.js', 'external');
  * @endcode
  *
+ * Calling drupal_static_reset('drupal_add_js') will clear all JavaScript added
+ * so far.
+ *
  * @param $data
  *   (optional) If given, the value depends on the $options parameter:
  *   - 'file': Path to the file relative to base_path().
@@ -2397,8 +2396,6 @@
  *       array is directly placed in Drupal.settings. All modules should wrap
  *       their actual configuration settings in another variable to prevent
  *       the pollution of the Drupal.settings namespace.
- *   - 'reset': Anything in $data will be ignored and the JavaScript added so
- *       far will be reset.
  * @param $options
  *   (optional) A string defining the type of JavaScript that is being added
  *   in the $data parameter ('file'/'setting'/'inline'), or an array which
@@ -2406,10 +2403,8 @@
  *   always pass the string 'setting' only.
  *   - type
  *       The type of JavaScript that is to be added to the page. Allowed
- *       values are 'file', 'inline', 'external', 'setting', or 'reset'. Defaults
- *       to 'file'. Note that if type is 'reset', then $data and all other
- *       $options will be ignored and the JavaScript added so far will be
- *       reset.
+ *       values are 'file', 'inline', 'external' or 'setting'. Defaults
+ *       to 'file'.
  *   - scope
  *       The location in which you want to place the script. Possible values
  *       are 'header' or 'footer'. If your theme implements different regions,
@@ -2448,7 +2443,7 @@
  * @see drupal_get_js()
  */
 function drupal_add_js($data = NULL, $options = NULL) {
-  static $javascript = array();
+  $javascript = &drupal_static(__FUNCTION__, array());
 
   // Construct the options, taking the defaults into consideration.
   if (isset($options)) {
@@ -2461,11 +2456,6 @@
   }
   $options += drupal_js_defaults($data);
 
-  if ($options['type'] == 'reset') {
-    // Request made to reset the JavaScript added so far
-    return $javascript = array();
-  }
-
   // Preprocess can only be set if caching is enabled.
   $options['preprocess'] = $options['cache'] ? $options['preprocess'] : FALSE;
 
