[前][次][番号順一覧][スレッド一覧]

ruby-changes:66597

From: Aaron <ko1@a...>
Date: Fri, 25 Jun 2021 17:29:38 +0900 (JST)
Subject: [ruby-changes:66597] b036a44e57 (master): [ruby/racc] Remove Object monkey patch

https://git.ruby-lang.org/ruby.git/commit/?id=b036a44e57

From b036a44e57a662d94ba2e67512f6d390b1e36b45 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Tue, 27 Apr 2021 11:49:20 -0700
Subject: [ruby/racc] Remove Object monkey patch

I don't think we need this monkey patch anymore, so lets remove it!

https://github.com/ruby/racc/commit/464485e912
---
 lib/racc/statetransitiontable.rb | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lib/racc/statetransitiontable.rb b/lib/racc/statetransitiontable.rb
index 4252ba0..4d54287 100644
--- a/lib/racc/statetransitiontable.rb
+++ b/lib/racc/statetransitiontable.rb
@@ -12,12 +12,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/racc/statetransitiontable.rb#L12
 
 require 'racc/parser'
 
-unless Object.method_defined?(:funcall)
-  class Object
-    alias funcall __send__
-  end
-end
-
 module Racc
 
   StateTransitionTable = Struct.new(:action_table,
@@ -300,9 +294,9 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/statetransitiontable.rb#L294
       c.module_eval "def _reduce_none(vals, vstack) vals[0] end"
       @grammar.each do |rule|
         if rule.action.empty?
-          c.funcall(:alias_method, "_reduce_#{rule.ident}", :_reduce_none)
+          c.alias_method("_reduce_#{rule.ident}", :_reduce_none)
         else
-          c.funcall(:define_method, "_racc_action_#{rule.ident}", &rule.action.proc)
+          c.define_method("_racc_action_#{rule.ident}", &rule.action.proc)
           c.module_eval(<<-End, __FILE__, __LINE__ + 1)
             def _reduce_#{rule.ident}(vals, vstack)
               _racc_action_#{rule.ident}(*vals)
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]