public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Remove unused JSON methods. [#164 state:resolved]

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

Comments