Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
justin808 committed Apr 2, 2016
1 parent 88ef6d2 commit e6a6526
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Metrics/PerceivedComplexity:
Max: 10

Metrics/ClassLength:
Max: 114
Max: 140

Metrics/ParameterLists:
Max: 5
Expand Down
18 changes: 12 additions & 6 deletions lib/react_on_rails/server_rendering_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,25 @@ def execjs_timer_polyfills
}
function setInterval() {
#{trace_react_on_rails? ?
"console.error('setInterval is not defined for execJS. See https://github.com/sstephenson/execjs#faq');\n"\
" console.error(getStackTrace().join('\\n'));" : "" }
#{undefined_for_exec_js_logging('setInterval')}
}
function setTimeout() {
#{trace_react_on_rails? ?
"console.error('setTimeout is not defined for execJS. See https://github.com/sstephenson/execjs#faq. Note babel-polyfill will call this.');\n"\
" console.error(getStackTrace().join('\\n'));" : "" }
#{undefined_for_exec_js_logging('setTimeout')}
}
JS
end

def undefined_for_exec_js_logging(function_name)
if trace_react_on_rails?
"console.error('#{function_name} is not defined for execJS. See "\
"https://github.com/sstephenson/execjs#faq. Note babel-polyfill may call this.');\n"\
" console.error(getStackTrace().join('\\n'));"
else
""
end
end

# Reimplement console methods for replaying on the client
def console_polyfill
<<-JS
Expand Down

0 comments on commit e6a6526

Please sign in to comment.