Permalink
Browse files

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`.
  • Loading branch information...
matz committed Jun 23, 2017
1 parent d0717ef commit b30eba6a13fef8994a7556654b5d4e3e54622f65
Showing with 4 additions and 3 deletions.
  1. +2 −2 mrblib/10error.rb
  2. +2 −1 test/t/superclass.rb
View
@@ -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
View
@@ -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'],

0 comments on commit b30eba6

Please sign in to comment.