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
4348639e
Commit
4348639e
authored
Jun 12, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
raise error if string arg is given to Kernel#instance_eval
parent
b5ffbea4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/kernel.c
src/kernel.c
+6
-6
No files found.
src/kernel.c
View file @
4348639e
...
...
@@ -557,12 +557,10 @@ mrb_obj_init_copy(mrb_state *mrb, mrb_value self)
/* 15.3.1.3.18 */
/*
* call-seq:
* obj.instance_eval(string [, filename [, lineno]] ) -> obj
* obj.instance_eval {| | block } -> obj
*
* Evaluates a string containing Ruby source code, or the given block,
* within the context of the receiver (_obj_). In order to set the
* context, the variable +self+ is set to _obj_ while
* Evaluates the given block,within the context of the receiver (_obj_).
* In order to set the context, the variable +self+ is set to _obj_ while
* the code is executing, giving the code access to _obj_'s
* instance variables. In the version of <code>instance_eval</code>
* that takes a +String+, the optional second and third
...
...
@@ -580,9 +578,11 @@ mrb_obj_init_copy(mrb_state *mrb, mrb_value self)
mrb_value
mrb_obj_instance_eval
(
mrb_state
*
mrb
,
mrb_value
self
)
{
mrb_value
b
;
mrb_value
a
,
b
;
mrb_get_args
(
mrb
,
"&"
,
&
b
);
if
(
mrb_get_args
(
mrb
,
"|S&"
,
&
a
,
&
b
)
==
1
)
{
mrb_raise
(
mrb
,
mrb
->
eRuntimeError_class
,
"instance_eval with string not implemented"
);
}
return
mrb_yield_with_self
(
mrb
,
b
,
0
,
0
,
self
);
}
...
...
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