Make LocalJumpError a subclass of ScriptError.

It's incompatible with CRuby, but it is required for mruby because
it cannot detect `break` outside of loops in the parsing time, but
in the code generation time where it cannot raise `SyntaxError`.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-06-23 18:00:32 +09:00
parent d0717efda6
commit b30eba6a13
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -2,8 +2,8 @@
class ArgumentError < StandardError
end
# ISO 15.2.25
class LocalJumpError < StandardError
# ISO 15.2.25 says "LocalJumpError < StandardError"
class LocalJumpError < ScriptError
end
# ISO 15.2.26
+2 -1
View File
@@ -23,7 +23,8 @@
[:Exception, :Object, '15.2.22.2'],
[:StandardError, :Exception, '15.2.23.2'],
[:ArgumentError, :StandardError, '15.2.24.2'],
[:LocalJumpError, :StandardError, '15.2.25.2'],
# [:LocalJumpError, :StandardError, '15.2.25.2'],
[:LocalJumpError, :ScriptError, '15.2.25.2'], # mruby specific
[:RangeError, :StandardError, '12.2.26.2'],
[:RegexpError, :StandardError, '12.2.27.2'],
[:RuntimeError, :StandardError, '12.2.28.2'],