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
5519bd69
Commit
5519bd69
authored
Feb 10, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1692 from Paxa/Kernel_global_variables
Fix Kernel#global_variables for $1-$9
parents
00bdaec7
411168de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
src/variable.c
src/variable.c
+1
-1
test/t/kernel.rb
test/t/kernel.rb
+8
-1
No files found.
src/variable.c
View file @
5519bd69
...
...
@@ -1052,7 +1052,7 @@ mrb_f_global_variables(mrb_state *mrb, mrb_value self)
buf
[
2
]
=
0
;
for
(
i
=
1
;
i
<=
9
;
++
i
)
{
buf
[
1
]
=
(
char
)(
i
+
'0'
);
mrb_ary_push
(
mrb
,
ary
,
mrb_symbol_value
(
mrb_intern
_lit
(
mrb
,
buf
)));
mrb_ary_push
(
mrb
,
ary
,
mrb_symbol_value
(
mrb_intern
(
mrb
,
buf
,
2
)));
}
return
ary
;
}
...
...
test/t/kernel.rb
View file @
5519bd69
...
...
@@ -479,7 +479,7 @@ assert('Kernel#!=') do
assert_false
(
str2
!=
str1
)
end
# operator "!~" is defined in ISO Ruby 11.4.4.
# operator "!~" is defined in ISO Ruby 11.4.4.
assert
(
'Kernel#!~'
)
do
x
=
"x"
def
x
.
=
~
(
other
)
...
...
@@ -511,6 +511,13 @@ assert('Kernel#respond_to_missing?') do
assert_false
Test4RespondToMissing
.
new
.
respond_to?
(
:no_method
)
end
assert
(
'Kernel#global_variables'
)
do
variables
=
global_variables
1
.
upto
(
9
)
do
|
i
|
assert_equal
variables
.
include?
(
:"$
#{
i
}
"
),
true
end
end
assert
(
'stack extend'
)
do
def
recurse
(
count
,
stop
)
return
count
if
count
>
stop
...
...
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