Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-execjs for openSUSE:Factory checked in at 2021-06-01 10:39:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-execjs (Old) and /work/SRC/openSUSE:Factory/.rubygem-execjs.new.1898 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-execjs" Tue Jun 1 10:39:56 2021 rev:16 rq:896517 version:2.8.1 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-execjs/rubygem-execjs.changes 2016-05-29 03:12:37.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-execjs.new.1898/rubygem-execjs.changes 2021-06-01 10:41:33.469231465 +0200 @@ -1,0 +2,7 @@ +Tue Jun 1 03:34:37 UTC 2021 - Manuel Schnitzer <[email protected]> + +- updated to version 2.8.1 + + * Wait for STDOUT to be flushed before exiting the node runtime + +------------------------------------------------------------------- Old: ---- execjs-2.7.0.gem New: ---- execjs-2.8.1.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-execjs.spec ++++++ --- /var/tmp/diff_new_pack.kjcqtG/_old 2021-06-01 10:41:33.849232112 +0200 +++ /var/tmp/diff_new_pack.kjcqtG/_new 2021-06-01 10:41:33.853232119 +0200 @@ -1,7 +1,7 @@ # # spec file for package rubygem-execjs # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -24,7 +24,7 @@ # Name: rubygem-execjs -Version: 2.7.0 +Version: 2.8.1 Release: 0 %define mod_name execjs %define mod_full_name %{mod_name}-%{version} @@ -32,8 +32,8 @@ BuildRequires: %{ruby >= 1.9.3} BuildRequires: %{rubygem gem2rpm} BuildRequires: ruby-macros >= 5 -Url: https://github.com/rails/execjs -Source: http://rubygems.org/gems/%{mod_full_name}.gem +URL: https://github.com/rails/execjs +Source: https://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml Summary: Run JavaScript code from Ruby License: MIT ++++++ execjs-2.7.0.gem -> execjs-2.8.1.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2016-05-20 05:58:24.000000000 +0200 +++ new/README.md 2021-05-14 09:54:24.000000000 +0200 @@ -7,8 +7,6 @@ ExecJS supports these runtimes: -* [therubyracer](https://github.com/cowboyd/therubyracer) - Google V8 - embedded within Ruby * [therubyrhino](https://github.com/cowboyd/therubyrhino) - Mozilla Rhino embedded within JRuby * [Duktape.rb](https://github.com/judofyr/duktape.rb) - Duktape JavaScript interpreter @@ -76,7 +74,7 @@ ## Contributing to ExecJS -ExecJS is work of hundreds of contributors. You're encouraged to submit pull requests, propose +ExecJS is work of dozens of contributors. You're encouraged to submit pull requests, propose features and discuss issues. See [CONTRIBUTING](CONTRIBUTING.md). Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/execjs/duktape_runtime.rb new/lib/execjs/duktape_runtime.rb --- old/lib/execjs/duktape_runtime.rb 2016-05-20 05:58:24.000000000 +0200 +++ new/lib/execjs/duktape_runtime.rb 2021-05-14 09:54:24.000000000 +0200 @@ -26,7 +26,8 @@ end def call(identifier, *args) - @ctx.call_prop(identifier.split("."), *args) + @ctx.exec_string("__execjs_duktape_call = #{identifier}", '(execjs)') + @ctx.call_prop("__execjs_duktape_call", *args) rescue Exception => e raise wrap_error(e) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/execjs/external_runtime.rb new/lib/execjs/external_runtime.rb --- old/lib/execjs/external_runtime.rb 2016-05-20 05:58:24.000000000 +0200 +++ new/lib/execjs/external_runtime.rb 2021-05-14 09:54:24.000000000 +0200 @@ -173,7 +173,7 @@ begin command = binary.split(" ") << filename `#{shell_escape(*command)} 2>&1 > #{path}` - output = File.open(path, 'rb', @popen_options) { |f| f.read } + output = File.open(path, 'rb', **@popen_options) { |f| f.read } ensure File.unlink(path) if path end @@ -197,7 +197,7 @@ def exec_runtime(filename) command = "#{Shellwords.join(binary.split(' ') << filename)} 2>&1" - io = IO.popen(command, @popen_options) + io = IO.popen(command, **@popen_options) output = io.read io.close @@ -209,7 +209,7 @@ end else def exec_runtime(filename) - io = IO.popen(binary.split(' ') << filename, @popen_options.merge({err: [:child, :out]})) + io = IO.popen(binary.split(' ') << filename, **(@popen_options.merge({err: [:child, :out]}))) output = io.read io.close diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/execjs/mini_racer_runtime.rb new/lib/execjs/mini_racer_runtime.rb --- old/lib/execjs/mini_racer_runtime.rb 2016-05-20 05:58:24.000000000 +0200 +++ new/lib/execjs/mini_racer_runtime.rb 2021-05-14 09:54:24.000000000 +0200 @@ -6,6 +6,7 @@ def initialize(runtime, source = "", options={}) source = encode(source) @context = ::MiniRacer::Context.new + @context.eval("delete this.console"); translate do @context.eval(source) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/execjs/ruby_racer_runtime.rb new/lib/execjs/ruby_racer_runtime.rb --- old/lib/execjs/ruby_racer_runtime.rb 2016-05-20 05:58:24.000000000 +0200 +++ new/lib/execjs/ruby_racer_runtime.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,114 +0,0 @@ -require "execjs/runtime" - -module ExecJS - class RubyRacerRuntime < Runtime - class Context < Runtime::Context - def initialize(runtime, source = "", options = {}) - source = encode(source) - - lock do - @v8_context = ::V8::Context.new - - begin - @v8_context.eval(source) - rescue ::V8::JSError => e - raise wrap_error(e) - end - end - end - - def exec(source, options = {}) - source = encode(source) - - if /\S/ =~ source - eval "(function(){#{source}})()", options - end - end - - def eval(source, options = {}) - source = encode(source) - - if /\S/ =~ source - lock do - begin - unbox @v8_context.eval("(#{source})") - rescue ::V8::JSError => e - raise wrap_error(e) - end - end - end - end - - def call(properties, *args) - lock do - begin - unbox @v8_context.eval(properties).call(*args) - rescue ::V8::JSError => e - raise wrap_error(e) - end - end - end - - def unbox(value) - case value - when ::V8::Function - nil - when ::V8::Array - value.map { |v| unbox(v) } - when ::V8::Object - value.inject({}) do |vs, (k, v)| - vs[k] = unbox(v) unless v.is_a?(::V8::Function) - vs - end - when String - value.force_encoding('UTF-8') - else - value - end - end - - private - def lock - result, exception = nil, nil - V8::C::Locker() do - begin - result = yield - rescue Exception => e - exception = e - end - end - - if exception - raise exception - else - result - end - end - - def wrap_error(e) - error_class = e.value["name"] == "SyntaxError" ? RuntimeError : ProgramError - - stack = e.value["stack"] || "" - stack = stack.split("\n") - stack.shift - stack = [e.message[/<eval>:\d+:\d+/, 0]].compact if stack.empty? - stack = stack.map { |line| line.sub(" at ", "").sub("<eval>", "(execjs)").strip } - - error = error_class.new(e.value.to_s) - error.set_backtrace(stack + caller) - error - end - end - - def name - "therubyracer (V8)" - end - - def available? - require "v8" - true - rescue LoadError - false - end - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/execjs/runtime.rb new/lib/execjs/runtime.rb --- old/lib/execjs/runtime.rb 2016-05-20 05:58:24.000000000 +0200 +++ new/lib/execjs/runtime.rb 2021-05-14 09:54:24.000000000 +0200 @@ -9,15 +9,30 @@ def initialize(runtime, source = "", options = {}) end + # Evaluates the +source+ in the context of a function body and returns the + # returned value. + # + # context.exec("return 1") # => 1 + # context.exec("1") # => nil (nothing was returned) def exec(source, options = {}) raise NotImplementedError end + # Evaluates the +source+ as an expression and returns the result. + # + # context.eval("1") # => 1 + # context.eval("return 1") # => Raises SyntaxError def eval(source, options = {}) raise NotImplementedError end - def call(properties, *args) + # Evaluates +source+ as an expression (which should be of type + # +function+), and calls the function with the given arguments. + # The function will be evaluated with the global object as +this+. + # + # context.call("function(a, b) { return a + b }", 1, 1) # => 2 + # context.call("CoffeeScript.compile", "1 + 1") + def call(source, *args) raise NotImplementedError end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/execjs/runtimes.rb new/lib/execjs/runtimes.rb --- old/lib/execjs/runtimes.rb 2016-05-20 05:58:24.000000000 +0200 +++ new/lib/execjs/runtimes.rb 2021-05-14 09:54:24.000000000 +0200 @@ -2,7 +2,6 @@ require "execjs/disabled_runtime" require "execjs/duktape_runtime" require "execjs/external_runtime" -require "execjs/ruby_racer_runtime" require "execjs/ruby_rhino_runtime" require "execjs/mini_racer_runtime" @@ -12,22 +11,23 @@ Duktape = DuktapeRuntime.new - RubyRacer = RubyRacerRuntime.new - RubyRhino = RubyRhinoRuntime.new MiniRacer = MiniRacerRuntime.new Node = ExternalRuntime.new( name: "Node.js (V8)", - command: ["nodejs", "node"], + command: ["node", "nodejs"], runner_path: ExecJS.root + "/support/node_runner.js", encoding: 'UTF-8' ) JavaScriptCore = ExternalRuntime.new( name: "JavaScriptCore", - command: "/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc", + command: [ + "/System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Helpers/jsc", + "/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc", + ], runner_path: ExecJS.root + "/support/jsc_runner.js" ) @@ -64,7 +64,9 @@ end def self.from_environment - if name = ENV["EXECJS_RUNTIME"] + env = ENV["EXECJS_RUNTIME"] + if env && !env.empty? + name = env raise RuntimeUnavailable, "#{name} runtime is not defined" unless const_defined?(name) runtime = const_get(name) @@ -79,7 +81,6 @@ def self.runtimes @runtimes ||= [ - RubyRacer, RubyRhino, Duktape, MiniRacer, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/execjs/support/jsc_runner.js new/lib/execjs/support/jsc_runner.js --- old/lib/execjs/support/jsc_runner.js 2016-05-20 05:58:24.000000000 +0200 +++ new/lib/execjs/support/jsc_runner.js 2021-05-14 09:54:24.000000000 +0200 @@ -2,6 +2,7 @@ }, function(program) { var output; try { + delete this.console; result = program(); if (typeof result == 'undefined' && result !== null) { print('["ok"]'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/execjs/support/node_runner.js new/lib/execjs/support/node_runner.js --- old/lib/execjs/support/node_runner.js 2016-05-20 05:58:24.000000000 +0200 +++ new/lib/execjs/support/node_runner.js 2021-05-14 09:54:24.000000000 +0200 @@ -1,20 +1,34 @@ -(function(program, execJS) { execJS(program) })(function(global, module, exports, require, console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { #{source} +(function(program, execJS) { execJS(program) })(function(global, process, module, exports, require, console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { #{source} }, function(program) { - var output, print = function(string) { - process.stdout.write('' + string); + var __process__ = process; + + var printFinal = function(string) { + process.stdout.write('' + string, function() { + __process__.exit(0); + }); }; try { + delete this.process; + delete this.console; + delete this.setTimeout; + delete this.setInterval; + delete this.clearTimeout; + delete this.clearInterval; + delete this.setImmediate; + delete this.clearImmediate; result = program(); + this.process = __process__; if (typeof result == 'undefined' && result !== null) { - print('["ok"]'); + printFinal('["ok"]'); } else { try { - print(JSON.stringify(['ok', result])); + printFinal(JSON.stringify(['ok', result])); } catch (err) { - print(JSON.stringify(['err', '' + err, err.stack])); + printFinal(JSON.stringify(['err', '' + err, err.stack])); } } } catch (err) { - print(JSON.stringify(['err', '' + err, err.stack])); + this.process = __process__; + printFinal(JSON.stringify(['err', '' + err, err.stack])); } }); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/execjs/version.rb new/lib/execjs/version.rb --- old/lib/execjs/version.rb 2016-05-20 05:58:24.000000000 +0200 +++ new/lib/execjs/version.rb 2021-05-14 09:54:24.000000000 +0200 @@ -1,3 +1,3 @@ module ExecJS - VERSION = "2.7.0" + VERSION = "2.8.1" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2016-05-20 05:58:24.000000000 +0200 +++ new/metadata 2021-05-14 09:54:24.000000000 +0200 @@ -1,15 +1,15 @@ --- !ruby/object:Gem::Specification name: execjs version: !ruby/object:Gem::Version - version: 2.7.0 + version: 2.8.1 platform: ruby authors: - Sam Stephenson - Josh Peek -autorequire: +autorequire: bindir: bin cert_chain: [] -date: 2016-05-20 00:00:00.000000000 Z +date: 2021-05-14 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rake @@ -42,7 +42,6 @@ - lib/execjs/external_runtime.rb - lib/execjs/mini_racer_runtime.rb - lib/execjs/module.rb -- lib/execjs/ruby_racer_runtime.rb - lib/execjs/ruby_rhino_runtime.rb - lib/execjs/runtime.rb - lib/execjs/runtimes.rb @@ -57,7 +56,7 @@ licenses: - MIT metadata: {} -post_install_message: +post_install_message: rdoc_options: [] require_paths: - lib @@ -72,9 +71,8 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubyforge_project: -rubygems_version: 2.5.1 -signing_key: +rubygems_version: 3.2.15 +signing_key: specification_version: 4 summary: Run JavaScript code from Ruby test_files: []
