Project

General

Profile

Misc #16980 ยป 0001-Improve-documentation-for-JSON-parse.patch

Adds information about raising JSON::ParserError on JSON#parse - bruno.gomes (Bruno Gomes da Silva), 06/23/2020 06:02 PM

View differences:

ext/json/lib/json/common.rb
134 134
  module_function
135 135

  
136 136
  # Parse the JSON document _source_ into a Ruby data structure and return it.
137
  # It raises JSON::ParserError if it fails to parse.
137 138
  #
138 139
  # _opts_ can have the following
139 140
  # keys:
......
158 159
  # Parse the JSON document _source_ into a Ruby data structure and return it.
159 160
  # The bang version of the parse method defaults to the more dangerous values
160 161
  # for the _opts_ hash, so be sure only to parse trusted _source_ documents.
162
  # It raises JSON::ParserError if it fails to parse.
161 163
  #
162 164
  # _opts_ can have the following keys:
163 165
  # * *max_nesting*: The maximum depth of nesting allowed in the parsed data
ext/json/parser/parser.c
2098 2098
 *
2099 2099
 *  Parses the current JSON text _source_ and returns the complete data
2100 2100
 *  structure as a result.
2101
 *  It raises JSON::ParseError if fail to parse.
2101 2102
 */
2102 2103
static VALUE cParser_parse(VALUE self)
2103 2104
{
ext/json/parser/parser.rl
821 821
 *
822 822
 *  Parses the current JSON text _source_ and returns the complete data
823 823
 *  structure as a result.
824
 *  It raises JSON::ParseError if fail to parse.
824 825
 */
825 826
static VALUE cParser_parse(VALUE self)
826 827
{
827
-