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

ruby-changes:66663

From: Yusuke <ko1@a...>
Date: Fri, 2 Jul 2021 16:48:40 +0900 (JST)
Subject: [ruby-changes:66663] 3a95834739 (master): [ruby/error_highlight] Suppress SyntaxError during RubyVM::AST.of

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

From 3a95834739aababba9eac418d7f122a1e499684b Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Fri, 2 Jul 2021 16:45:48 +0900
Subject: [ruby/error_highlight] Suppress SyntaxError during RubyVM::AST.of

When the original source code is erb, RubyVM::AST.of does not work well.
https://github.com/rails/rails/issues/42678.

https://github.com/ruby/error_highlight/commit/b1572761a6
---
 lib/error_highlight/core_ext.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/error_highlight/core_ext.rb b/lib/error_highlight/core_ext.rb
index d8d2175..1e91deb 100644
--- a/lib/error_highlight/core_ext.rb
+++ b/lib/error_highlight/core_ext.rb
@@ -29,7 +29,7 @@ module ErrorHighlight https://github.com/ruby/ruby/blob/trunk/lib/error_highlight/core_ext.rb#L29
 
         spot = ErrorHighlight.spot(node, **opts)
 
-      rescue Errno::ENOENT
+      rescue Errno::ENOENT, SyntaxError
       end
 
       if spot
-- 
cgit v1.1


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

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