? rename_drupal_to_js.patch
Index: coder_review/includes/coder_review_7x.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/coder/coder_review/includes/coder_review_7x.inc,v
retrieving revision 1.46
diff -u -p -r1.46 coder_review_7x.inc
--- coder_review/includes/coder_review_7x.inc	18 Oct 2009 23:50:44 -0000	1.46
+++ coder_review/includes/coder_review_7x.inc	24 Oct 2009 15:02:29 -0000
@@ -508,6 +508,17 @@ function coder_review_7x_reviews() {
       ),
       // http://drupal.org/node/224333#jquery_once
       // http://drupal.org/node/224333#rename-drupal-to-js
+      array(
+        '#type' => 'regex',
+        '#value' => '[\s\(]drupal_to_js\s*\(',
+        '#warning_callback' => '_coder_review_7x_drupal_to_js_warning',
+      ),
+      array(
+        '#type' => 'regex',
+        '#value' => '[\s\(]drupal_json\s*\(',
+        '#warning_callback' => '_coder_review_7x_drupal_json_warning',
+      ),
+        
 
 
     // CSS
@@ -1958,6 +1969,30 @@ function _coder_review_7x_no_jsenabled_w
   );
 }
 
+function _coder_review_7x_drupal_to_js_warning() {
+  return array(
+    '#warning' => t('!drupal_to_json() has been renamed to !drupal_json_encode().',
+      array(
+        '!drupal_to_json()' => theme('drupalapi', array('function' => 'drupal_to_json', 'version' => 6)),
+        '!drupal_json_encode()' => theme('drupalapi', array('function' => 'drupal_json_encode', 'version' => 7)),
+      )
+    ),
+    '#link' => 'http://drupal.org/node/224333#rename-drupal-to-js',
+  );
+}
+
+function _coder_review_7x_drupal_json_warning() {
+  return array(
+    '#warning' => t('!drupal_json() has been renamed to !drupal_json_output().',
+      array(
+        '!drupal_json()' => theme('drupalapi', array('function' => 'drupal_json', 'version' => 6)),
+        '!drupal_json_output()' => theme('drupalapi', array('function' => 'drupal_json_output', 'version' => 7)),
+      )
+    ),
+    '#link' => 'http://drupal.org/node/224333#rename-drupal-to-js',
+  );
+}
+
 function _coder_review_7x_optional_block_warning() {
   return array(
     '#warning' => t("Block module is now optional, make sure you declare it as a dependency in your module's .info file."),
Index: coder_review/tests/coder_review_7x.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/coder/coder_review/tests/coder_review_7x.test,v
retrieving revision 1.40
diff -u -p -r1.40 coder_review_7x.test
--- coder_review/tests/coder_review_7x.test	18 Oct 2009 23:50:44 -0000	1.40
+++ coder_review/tests/coder_review_7x.test	24 Oct 2009 15:02:29 -0000
@@ -381,6 +381,8 @@ class CoderReviewUpgrade7xTest extends C
 
     // http://drupal.org/node/224333#jquery_once
     // http://drupal.org/node/224333#rename-drupal-to-js
+    $this->assertCoderReviewFail('  drupal_to_js($var);');
+    $this->assertCoderReviewFail('  drupal_json($matches);');
   }
 
   function testCss7x() {
