public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/rubygem-execjs] rawhide: Backport upstream fix to support json 3
Date: Sun, 20 Sep 2026 12:30:35 GMT	[thread overview]
Message-ID: <178990743528.1.8124685867695136979.rpms-rubygem-execjs-da113858d486@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rubygem-execjs
Branch : rawhide
Commit : da113858d48635cf863875d31dc96bfaa8a6d16e
Author : Mamoru TASAKA <mtasaka@fedoraproject.org>
Date   : 2026-09-20T21:30:21+09:00
Stats  : +70/-3 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rubygem-execjs/c/da113858d48635cf863875d31dc96bfaa8a6d16e?branch=rawhide

Log:
Backport upstream fix to support json 3

---
diff --git a/rubygem-execjs-pr150-support-json3.patch b/rubygem-execjs-pr150-support-json3.patch
new file mode 100644
index 0000000..03c0aab
--- /dev/null
+++ b/rubygem-execjs-pr150-support-json3.patch
@@ -0,0 +1,60 @@
+From 314b8cf3220fd9a1e57f86dab55b83f42e35823f Mon Sep 17 00:00:00 2001
+From: Juanito Fatas <me@juanitofatas.com>
+Date: Tue, 11 Aug 2026 22:25:12 +0900
+Subject: [PATCH] Support JSON 3
+
+---
+ execjs.gemspec                   | 1 +
+ lib/execjs/external_runtime.rb   | 6 +++---
+ lib/execjs/ruby_rhino_runtime.rb | 2 +-
+ test/test_execjs.rb              | 4 ++--
+ 4 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/lib/execjs/external_runtime.rb b/lib/execjs/external_runtime.rb
+index a0325f4..ce35194 100644
+--- a/lib/execjs/external_runtime.rb
++++ b/lib/execjs/external_runtime.rb
+@@ -18,7 +18,7 @@ def eval(source, options = {})
+         source = encode(source)
+ 
+         if /\S/ =~ source
+-          exec("return eval(#{::JSON.generate("(#{source})", quirks_mode: true)})")
++          exec("return eval(#{::JSON.generate("(#{source})")})")
+         end
+       end
+ 
+@@ -65,7 +65,7 @@ def write_to_tempfile(contents)
+         end
+ 
+         def extract_result(output, filename)
+-          status, value, stack = output.empty? ? [] : ::JSON.parse(output, create_additions: false)
++          status, value, stack = output.empty? ? [] : ::JSON.parse(output)
+           if status == "ok"
+             value
+           else
+@@ -158,7 +158,7 @@ def json2_source
+ 
+       def encode_source(source)
+         encoded_source = encode_unicode_codepoints(source)
+-        ::JSON.generate("(function(){ #{encoded_source} })()", quirks_mode: true)
++        ::JSON.generate("(function(){ #{encoded_source} })()")
+       end
+ 
+       def encode_unicode_codepoints(str)
+diff --git a/test/test_execjs.rb b/test/test_execjs.rb
+index b3fec92..2c2d7af 100644
+--- a/test/test_execjs.rb
++++ b/test/test_execjs.rb
+@@ -142,10 +142,10 @@ def test_context_call_missing_function
+     { "a" => 1, "b" => [2, 3]},
+     { "a" => true }
+   ].each_with_index do |value, index|
+-    json_value = JSON.generate(value, quirks_mode: true)
++    json_value = JSON.generate(value)
+ 
+     define_method("test_json_value_#{index}") do
+-      assert_output value, JSON.parse(json_value, quirks_mode: true)
++      assert_output value, JSON.parse(json_value)
+     end
+ 
+     define_method("test_exec_value_#{index}") do

diff --git a/rubygem-execjs.spec b/rubygem-execjs.spec
index eaece4a..82851cd 100644
--- a/rubygem-execjs.spec
+++ b/rubygem-execjs.spec
@@ -4,7 +4,7 @@
 Summary: Run JavaScript code from Ruby
 Name: rubygem-%{gem_name}
 Version: 2.8.1
-Release: 13%{?dist}
+Release: 14%{?dist}
 License: MIT
 URL: https://github.com/rails/execjs
 Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
@@ -13,6 +13,9 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
 Source1: %{gem_name}-%{version}-tests.tgz
 # Revert f47c02c and 8b22842 fixing conflict to unbundle json2.js.
 Patch0: rubygem-execjs-2.7.0-delete-JScript-and-json2.js.patch
+# Support json 3
+# https://github.com/rails/execjs/pull/150/
+Patch1: rubygem-execjs-pr150-support-json3.patch
 BuildRequires: ruby(release)
 BuildRequires: rubygems-devel
 BuildRequires: rubygem(minitest)
@@ -35,10 +38,11 @@ Documentation for %{name}
 %prep
 gem unpack %{SOURCE0}
 
-%setup -q -D -T -n  %{gem_name}-%{version}
+%setup -q -D -T -n  %{gem_name}-%{version} -a 1
 
 gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
 %patch 0 -p1
+%patch 1 -p1
 sed -i -e '/files/ s|"lib/execjs/support/jscript_runner.js".freeze, ||' \
     -e '/files/ s|"lib/execjs/support/json2.js".freeze, ||' %{gem_name}.gemspec
 
@@ -56,8 +60,8 @@ cp -a .%{gem_dir}/* \
         %{buildroot}%{gem_dir}/
 
 %check
+cp -a test/ .%{gem_instdir}
 pushd .%{gem_instdir}
-tar xzf %{SOURCE1}
 ruby -Ilib -e 'Dir.glob "./test/**/test_*.rb", &method(:require)'
 popd
 
@@ -73,6 +77,9 @@ popd
 %doc %{gem_instdir}/README.md
 
 %changelog
+* Sun Sep 20 2026 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.8.1-14
+- Backport upstream fix to support json 3
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.1-13
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

                 reply	other threads:[~2026-09-20 12:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178990743528.1.8124685867695136979.rpms-rubygem-execjs-da113858d486@fedoraproject.org \
    --to=mtasaka@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox