Skip to content

Commit b30eba6

Browse files
committed
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`.
1 parent d0717ef commit b30eba6

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎mrblib/10error.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
class ArgumentError < StandardError
33
end
44

5-
# ISO 15.2.25
6-
class LocalJumpError < StandardError
5+
# ISO 15.2.25 says "LocalJumpError < StandardError"
6+
class LocalJumpError < ScriptError
77
end
88

99
# ISO 15.2.26

‎test/t/superclass.rb‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
[:Exception, :Object, '15.2.22.2'],
2424
[:StandardError, :Exception, '15.2.23.2'],
2525
[:ArgumentError, :StandardError, '15.2.24.2'],
26-
[:LocalJumpError, :StandardError, '15.2.25.2'],
26+
# [:LocalJumpError, :StandardError, '15.2.25.2'],
27+
[:LocalJumpError, :ScriptError, '15.2.25.2'], # mruby specific
2728
[:RangeError, :StandardError, '12.2.26.2'],
2829
[:RegexpError, :StandardError, '12.2.27.2'],
2930
[:RuntimeError, :StandardError, '12.2.28.2'],

0 commit comments

Comments
 (0)