mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Catch syntax error even if fatal
This commit is contained in:
parent
afab8122c3
commit
601f1fb456
1 changed files with 2 additions and 0 deletions
|
@ -359,6 +359,8 @@ EOT
|
||||||
code = code.dup.force_encoding(Encoding::UTF_8)
|
code = code.dup.force_encoding(Encoding::UTF_8)
|
||||||
RubyVM::InstructionSequence.compile(code, fname, fname, line)
|
RubyVM::InstructionSequence.compile(code, fname, fname, line)
|
||||||
:ok
|
:ok
|
||||||
|
ensure
|
||||||
|
raise if SyntaxError === $!
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
def syntax_check(code, fname, line)
|
def syntax_check(code, fname, line)
|
||||||
|
|
Loading…
Add table
Reference in a new issue