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
module_function
# Parse the JSON document _source_ into a Ruby data structure and return it.
# It raises JSON::ParserError if it fails to parse.
#
# _opts_ can have the following
# keys:
......
# Parse the JSON document _source_ into a Ruby data structure and return it.
# The bang version of the parse method defaults to the more dangerous values
# for the _opts_ hash, so be sure only to parse trusted _source_ documents.
# It raises JSON::ParserError if it fails to parse.
#
# _opts_ can have the following keys:
# * *max_nesting*: The maximum depth of nesting allowed in the parsed data
ext/json/parser/parser.c
*
* Parses the current JSON text _source_ and returns the complete data
* structure as a result.
* It raises JSON::ParseError if fail to parse.
*/
static VALUE cParser_parse(VALUE self)
{
ext/json/parser/parser.rl
*
* Parses the current JSON text _source_ and returns the complete data
* structure as a result.
* It raises JSON::ParseError if fail to parse.
*/
static VALUE cParser_parse(VALUE self)
{
    (1-1/1)