Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
6be5160e
Unverified
Commit
6be5160e
authored
Dec 06, 2016
by
Bouke van der Bijl
Committed by
Clayton Smith
Jan 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
36fc1f14
not checking in the right location
parent
db1bd078
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
src/error.c
src/error.c
+3
-2
test/t/nomethoderror.rb
test/t/nomethoderror.rb
+18
-0
No files found.
src/error.c
View file @
6be5160e
...
@@ -280,8 +280,6 @@ mrb_exc_set(mrb_state *mrb, mrb_value exc)
...
@@ -280,8 +280,6 @@ mrb_exc_set(mrb_state *mrb, mrb_value exc)
mrb
->
exc
=
0
;
mrb
->
exc
=
0
;
}
}
else
{
else
{
if
(
!
mrb_obj_is_kind_of
(
mrb
,
exc
,
mrb
->
eException_class
))
mrb_raise
(
mrb
,
E_TYPE_ERROR
,
"exception object expected"
);
mrb
->
exc
=
mrb_obj_ptr
(
exc
);
mrb
->
exc
=
mrb_obj_ptr
(
exc
);
}
}
}
}
...
@@ -289,6 +287,9 @@ mrb_exc_set(mrb_state *mrb, mrb_value exc)
...
@@ -289,6 +287,9 @@ mrb_exc_set(mrb_state *mrb, mrb_value exc)
MRB_API
mrb_noreturn
void
MRB_API
mrb_noreturn
void
mrb_exc_raise
(
mrb_state
*
mrb
,
mrb_value
exc
)
mrb_exc_raise
(
mrb_state
*
mrb
,
mrb_value
exc
)
{
{
if
(
!
mrb_obj_is_kind_of
(
mrb
,
exc
,
mrb
->
eException_class
))
{
mrb_raise
(
mrb
,
E_TYPE_ERROR
,
"exception object expected"
);
}
mrb_exc_set
(
mrb
,
exc
);
mrb_exc_set
(
mrb
,
exc
);
if
(
!
mrb
->
gc
.
out_of_memory
)
{
if
(
!
mrb
->
gc
.
out_of_memory
)
{
exc_debug_info
(
mrb
,
mrb
->
exc
);
exc_debug_info
(
mrb
,
mrb
->
exc
);
...
...
test/t/nomethoderror.rb
View file @
6be5160e
...
@@ -51,3 +51,21 @@ assert('Can still call super when BasicObject#method_missing is removed') do
...
@@ -51,3 +51,21 @@ assert('Can still call super when BasicObject#method_missing is removed') do
end
end
end
end
end
end
assert
(
"NoMethodError#new does not return an exception"
)
do
begin
class
<<
NoMethodError
def
new
(
*
)
nil
end
end
assert_raise
(
TypeError
)
do
Object
.
q
end
ensure
class
<<
NoMethodError
remove_method
:new
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment