summaryrefslogtreecommitdiff
path: root/ext/json
AgeCommit message (Collapse)Author
2023-12-05[flori/json] Bump up 2.7.1Hiroshi SHIBATA
https://github.com/flori/json/commit/a1af7a308c
2023-12-05Removed obsoleted version definitionHiroshi SHIBATA
2023-12-05[flori/json] Detect json version from version.rbHiroshi SHIBATA
https://github.com/flori/json/commit/3ef57b5b39
2023-12-05[flori/json] The modern Ruby uses utf-8 encodings by defaultHiroshi SHIBATA
https://github.com/flori/json/commit/11b31210ac
2023-12-05[flori/json] [DOC] RDoc for additionsBurdette Lamar
(https://github.com/flori/json/pull/557) * RDoc for additions * Update lib/json/add/time.rb Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org> --------- https://github.com/flori/json/commit/3f2efd60f7 Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
2023-12-05[flori/json] Fix JSON.dump overload combinationtompng
https://github.com/flori/json/commit/41c2712a3b
2023-12-05[flori/json] Overload kwargs in JSON.dumpTakashi Kokubun
https://github.com/flori/json/commit/936f280f9f
2023-12-05[flori/json] JSON.dump: handle unenclosed hashes regressionJean Boussier
Fix: https://github.com/flori/json/issues/553 We can never add keyword arguments to `dump` otherwise existing code using unenclosed hash will break. https://github.com/flori/json/commit/8e0076a3f2
2023-12-01Manually merged from flori/jsonHiroshi SHIBATA
> https://github.com/flori/json/pull/525 > Rename escape_slash in script_safe and also escape E+2028 and E+2029 Co-authored-by: Jean Boussier <jean.boussier@gmail.com> > https://github.com/flori/json/pull/454 > Remove unnecessary initialization of create_id in JSON.parse() Co-authored-by: Watson <watson1978@gmail.com>
2023-12-01Rename escape_slash in script_safe and also escape E+2028 and E+2029Jean Boussier
It is rather common to directly interpolate JSON string inside <script> tags in HTML as to provide configuration or parameters to a script. However this may lead to XSS vulnerabilities, to prevent that 3 characters need to be escaped: - `/` (forward slash) - `U+2028` (LINE SEPARATOR) - `U+2029` (PARAGRAPH SEPARATOR) The forward slash need to be escaped to prevent closing the script tag early, and the other two are valid JSON but invalid Javascript and can be used to break JS parsing. Given that the intent of escaping forward slash is the same than escaping U+2028 and U+2029, I chos to rename and repurpose the existing `escape_slash` option.
2023-12-01Use ruby_xfree to free buffersJean Boussier
They are allocated with ruby_xmalloc, they should be freed with ruby_xfree.
2023-12-01[flori/json] Bump up 2.7.0Hiroshi SHIBATA
https://github.com/flori/json/commit/ca546128f2
2023-12-01[flori/json] Fix "unexpected token" offset for InfinityJohn Hawthorn
Previously in the JSON::Ext parser, when we encountered an "Infinity" token (and weren't allowing NaN/Infinity) we would try to display the "unexpected token" at the character before. https://github.com/flori/json/commit/42ac170712
2023-11-08[flori/json] Enhanced RDoc for Range extensionsBurdetteLamar
https://github.com/flori/json/commit/ec47749b53
2023-07-19[flori/json] Re-generate parser.cNobuyoshi Nakada
https://github.com/flori/json/commit/82a75ba98e Notes: Merged: https://github.com/ruby/ruby/pull/8091
2023-07-19[flori/json] Remove unnecessary codeNobuyoshi Nakada
In `JSON#generate` and `JSON#fast_generate`: - When the given `opts` is a `JSON::State` the variable is set to `nil`. - But it will be never used as the next `if` blocks will not be executed. - `JSON::State#configure` does the conversion to `Hash`, the conversions in the `if` block are just duplication. - `JSON::State.new` does the same thing with `configure` when an argument is given. https://github.com/flori/json/commit/5d9ab87f8e Notes: Merged: https://github.com/ruby/ruby/pull/8091
2023-07-19[flori/json] [DOC] Remove duplicate sentenceNobuyoshi Nakada
https://github.com/flori/json/commit/ed242667b4 Notes: Merged: https://github.com/ruby/ruby/pull/8091
2023-07-19[flori/json] Remove `HAVE_RB_SCAN_ARGS_OPTIONAL_HASH` checkNobuyoshi Nakada
This macro is defined since ruby 2.1, which is older than the required ruby version. https://github.com/flori/json/commit/dd1d54e78a Notes: Merged: https://github.com/ruby/ruby/pull/8091
2023-07-18[flori/json] Skip BigDecimal tests when it's missing to loadHiroshi SHIBATA
https://github.com/flori/json/commit/3dd36c6077
2023-07-18[flori/json] Rename JSON::ParseError to JSON:ParserErrorDimitar Haralanov
https://github.com/flori/json/commit/20b80ca317
2023-05-24[flori/json] Call `super` in `included` hookUfuk Kayserilioglu
The C extension defines an `included` hook for the `JSON::Ext::Generator::GeneratorMethods::String` module but neglects to call `super` in the hook. This can break the functionality of various other code that rely on the fact that `included` on `Module` will always be called. https://github.com/flori/json/commit/cd8bbe56a3
2023-02-28Update the depend filesMatt Valentine-House
Notes: Merged: https://github.com/ruby/ruby/pull/7310
2023-02-27Remove intern/gc.h from Make depsMatt Valentine-House
Notes: Merged: https://github.com/ruby/ruby/pull/7330
2023-02-08Extract include/ruby/internal/attr/packed_struct.hNobuyoshi Nakada
Split `PACKED_STRUCT` and `PACKED_STRUCT_UNALIGNED` macros into the macros bellow: * `RBIMPL_ATTR_PACKED_STRUCT_BEGIN` * `RBIMPL_ATTR_PACKED_STRUCT_END` * `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_BEGIN` * `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_END` Notes: Merged: https://github.com/ruby/ruby/pull/7268
2023-01-23Fix homepage url in gemspecYusuke Nakamura
GitHub Pages now hosted on *.github.io
2022-12-09Merge json-2.6.3Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6890
2022-07-29[flori/json] Stop including the parser source __LINE__ in exceptionsJean Boussier
It makes testing for JSON errors very tedious. You either have to use a Regexp or to regularly update all your assertions when JSON is upgraded. https://github.com/flori/json/commit/de9eb1d28e Notes: Merged: https://github.com/ruby/ruby/pull/6200
2022-05-20[flori/json] Bump version to 2.6.2Florian Frank
https://github.com/flori/json/commit/5de358f655
2022-05-20[flori/json] Fix parser bug for empty string allocationAndrew Bromwich
When `HAVE_RB_ENC_INTERNED_STR` is enabled it is possible to pass through a null pointer to `rb_enc_interned_str` resulting in a segfault Fixes #495 https://github.com/flori/json/commit/b59368a8c2
2022-05-20[flori/json] Doc: Improve documentation on JSON#parse and JSON#parse!Hiroshi SHIBATA
https://github.com/flori/json/commit/75ada77b96 Co-authored-by: Bruno Gomes da Silva <brunojabs@gmail.com>
2022-02-22[Feature #18249] Update dependenciesPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/5474
2021-11-21Update dependenciesNobuyoshi Nakada
2021-10-24[flori/json] Bump version to v2.6.1Hiroshi SHIBATA
https://github.com/flori/json/commit/2db5894cfa
2021-10-24[flori/json] Bump JSON::VERSION to 2.6.0.Josef Šimánek
https://github.com/flori/json/commit/da94d9f059
2021-10-14[flori/json] Bump up json version to 2.6.0Hiroshi SHIBATA
https://github.com/flori/json/commit/1942689b67
2021-10-05ruby tool/update-deps --fix卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/4909
2021-07-29Update the latest version of json.gemspec from flori/jsonHiroshi SHIBATA
2021-05-19ext/json/parser/parser.h: Add fallback MAYBE_UNUSEDNobuyoshi Nakada
https://github.com/flori/json/commit/e2ad91fc2094d3cc2f76adc6c55d420cd06f34d8
2021-05-18ext/json/parser/prereq.mk: fix warnings for code generated by ragelNobuyoshi Nakada
* type-limits when plain-char is unsigned * unused-const-variable for NFA constants
2021-05-17Bump version of required_ruby_version to 2.3. Fixes #464Hiroshi SHIBATA
2021-05-17[flori/json] Deduplicate strings inside json_string_unescapeJean Boussier
[ci 2] https://github.com/flori/json/commit/1982070cb8
2021-05-17[flori/json] Refactor json_string_unescapeJean Boussier
https://github.com/flori/json/commit/f398769332
2021-05-17[flori/json] Fix incorrect `#` position in API docMasafumi Koba
This change fixes an incorrect `#` position in the API documentation of the `JSON` module. https://github.com/flori/json/commit/dc4b62424f
2021-04-13dependency updates卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/4371
2021-02-01Fix GC compatibility: Don't stash encodings in global constantsAaron Patterson
This value should either be pinned, or looked up when needed at runtime. Without pinning, the GC may move the encoding object, and that could cause a crash. In this case it is easier to find the value at runtime, and there is no performance penalty (as Ruby caches encoding indexes). We can shorten the code, be compaction friendly, and incur no performance penalty.
2020-12-22Merge json-2.5.1Hiroshi SHIBATA
2020-12-22Prepare to release json-2.5.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3975
2020-12-21[json] Avoid method redefinitionKenta Murata
2020-12-21[json] Make json Ractor safeKenta Murata
2020-12-21[json] JSON_parse_float: Fix how to convert numberKenta Murata
Stop BigDecimal-specific optimization. Instead, it tries the conversion methods in the following order: 1. `try_convert`, 2. `new`, and 3. class-named function, e.g. `Foo::Bar.Baz` function for `Foo::Bar::Baz` class If all the above candidates are unavailable, it fallbacks to Float.