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
98a61083
Commit
98a61083
authored
May 06, 2014
by
take_cheeze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement Kernel.fail and Kernel#fail .
parent
12915f95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
src/kernel.c
src/kernel.c
+2
-0
test/t/kernel.rb
test/t/kernel.rb
+4
-0
No files found.
src/kernel.c
View file @
98a61083
...
...
@@ -1189,6 +1189,8 @@ mrb_init_kernel(mrb_state *mrb)
mrb_define_method
(
mrb
,
krn
,
"to_s"
,
mrb_any_to_s
,
MRB_ARGS_NONE
());
/* 15.3.1.3.46 */
mrb_define_method
(
mrb
,
krn
,
"__case_eqq"
,
mrb_obj_ceqq
,
MRB_ARGS_REQ
(
1
));
/* internal */
mrb_define_module_function
(
mrb
,
krn
,
"fail"
,
mrb_f_raise
,
MRB_ARGS_NONE
());
mrb_include_module
(
mrb
,
mrb
->
object_class
,
mrb
->
kernel_module
);
mrb_alias_method
(
mrb
,
mrb
->
module_class
,
mrb_intern_lit
(
mrb
,
"dup"
),
mrb_intern_lit
(
mrb
,
"clone"
));
}
test/t/kernel.rb
View file @
98a61083
...
...
@@ -563,3 +563,7 @@ assert('stack extend') do
end
end
assert
(
'Kernel.fail, Kernel#fail'
)
do
assert_raise
(
RuntimeError
)
{
fail
}
assert_raise
(
RuntimeError
)
{
Kernel
.
fail
}
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