From 7a2622bcbd1937dd2862d27fa18258198de7a153 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 27 Aug 2014 17:58:59 -0700 Subject: remove dead code the ERB has already been compiled to Ruby code by the time we're calling module_eval. Nothing that module eval raises will be caught by a blank `rescue`, so I think we can remove this --- actionview/lib/action_view/template.rb | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'actionview/lib/action_view/template.rb') diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb index 9d39d02a37..07522778b7 100644 --- a/actionview/lib/action_view/template.rb +++ b/actionview/lib/action_view/template.rb @@ -293,18 +293,8 @@ module ActionView raise WrongEncodingError.new(@source, Encoding.default_internal) end - begin - mod.module_eval(source, identifier, 0) - ObjectSpace.define_finalizer(self, Finalizer[method_name, mod]) - rescue => e # errors from template code - if logger = (view && view.logger) - logger.debug "ERROR: compiling #{method_name} RAISED #{e}" - logger.debug "Function body: #{source}" - logger.debug "Backtrace: #{e.backtrace.join("\n")}" - end - - raise ActionView::Template::Error.new(self, e) - end + mod.module_eval(source, identifier, 0) + ObjectSpace.define_finalizer(self, Finalizer[method_name, mod]) end def handle_render_error(view, e) #:nodoc: -- cgit v1.2.3 From cab85e9926c62094d1bada4437b6d1b6bc51e5e8 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 27 Aug 2014 17:59:34 -0700 Subject: remove useless parameter --- actionview/lib/action_view/template.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionview/lib/action_view/template.rb') diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb index 07522778b7..eb0f2e8a57 100644 --- a/actionview/lib/action_view/template.rb +++ b/actionview/lib/action_view/template.rb @@ -242,7 +242,7 @@ module ActionView end instrument("!compile_template") do - compile(view, mod) + compile(mod) end # Just discard the source if we have a virtual path. This @@ -264,7 +264,7 @@ module ActionView # encode the source into Encoding.default_internal. # In general, this means that templates will be UTF-8 inside of Rails, # regardless of the original source encoding. - def compile(view, mod) #:nodoc: + def compile(mod) #:nodoc: encode! method_name = self.method_name code = @handler.call(self) -- cgit v1.2.3