Skip to content
This repository
Browse code

Remove unused JSON methods. [#164 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information...
commit 8f2f88f128104355b100487008800aeb369ca425 1 parent 10fdf44
Cheah Chu Yeow authored May 11, 2008 lifo committed May 11, 2008
2  activesupport/CHANGELOG
... ...
@@ -1,5 +1,7 @@
1 1
 *SVN*
2 2
 
  3
+* Remove unused JSON::RESERVED_WORDS, JSON.valid_identifier? and JSON.reserved_word? methods. Resolves #164. [Cheah Chu Yeow]
  4
+
3 5
 * Adding Date.current, which returns Time.zone.today if config.time_zone is set; otherwise returns Date.today [Geoff Buesing]
4 6
 
5 7
 * TimeWithZone: date part getter methods (#year #mon #day etc) are defined on class; no longer relying on method_missing [Geoff Buesing]
29  activesupport/lib/active_support/json.rb
... ...
@@ -1,5 +1,3 @@
1  
-
2  
-
3 1
 module ActiveSupport
4 2
   # If true, use ISO 8601 format for dates and times.  Otherwise, fall back to the ActiveSupport legacy format.
5 3
   mattr_accessor :use_standard_json_time_format
@@ -19,33 +17,6 @@ def escape_html_entities_in_json=(value)
19 17
       @escape_html_entities_in_json = value
20 18
     end
21 19
   end
22  
-
23  
-  module JSON
24  
-    RESERVED_WORDS = %w(
25  
-      abstract      delete        goto          private       transient
26  
-      boolean       do            if            protected     try
27  
-      break         double        implements    public        typeof
28  
-      byte          else          import        return        var
29  
-      case          enum          in            short         void
30  
-      catch         export        instanceof    static        volatile
31  
-      char          extends       int           super         while
32  
-      class         final         interface     switch        with
33  
-      const         finally       long          synchronized
34  
-      continue      float         native        this
35  
-      debugger      for           new           throw
36  
-      default       function      package       throws
37  
-    ) #:nodoc:
38  
-
39  
-    class << self
40  
-      def valid_identifier?(key) #:nodoc:
41  
-        key.to_s =~ /^[[:alpha:]_$][[:alnum:]_$]*$/ && !reserved_word?(key)
42  
-      end
43  
-
44  
-      def reserved_word?(key) #:nodoc:
45  
-        RESERVED_WORDS.include?(key.to_s)
46  
-      end
47  
-    end
48  
-  end
49 20
 end
50 21
 
51 22
 require 'active_support/json/encoding'

0 notes on commit 8f2f88f

Please sign in to comment.
Something went wrong with that request. Please try again.