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
4b83fe8b
Commit
4b83fe8b
authored
Jun 07, 2019
by
KOBAYASHI Shuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `Kernel#global_variables` from core
This method is defined in `mruby-metaprog` gem.
parent
2847692d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
17 deletions
+13
-17
mrbgems/mruby-metaprog/src/metaprog.c
mrbgems/mruby-metaprog/src/metaprog.c
+1
-1
mrbgems/mruby-metaprog/test/metaprog.rb
mrbgems/mruby-metaprog/test/metaprog.rb
+12
-0
src/kernel.c
src/kernel.c
+0
-1
test/t/kernel.rb
test/t/kernel.rb
+0
-15
No files found.
mrbgems/mruby-metaprog/src/metaprog.c
View file @
4b83fe8b
...
@@ -686,7 +686,7 @@ mrb_mruby_metaprog_gem_init(mrb_state* mrb)
...
@@ -686,7 +686,7 @@ mrb_mruby_metaprog_gem_init(mrb_state* mrb)
struct
RClass
*
krn
=
mrb
->
kernel_module
;
struct
RClass
*
krn
=
mrb
->
kernel_module
;
struct
RClass
*
mod
=
mrb
->
module_class
;
struct
RClass
*
mod
=
mrb
->
module_class
;
mrb_define_method
(
mrb
,
krn
,
"global_variables"
,
mrb_f_global_variables
,
MRB_ARGS_NONE
());
/* 15.3.1.
2.4
*/
mrb_define_method
(
mrb
,
krn
,
"global_variables"
,
mrb_f_global_variables
,
MRB_ARGS_NONE
());
/* 15.3.1.
3.14 (15.3.1.2.4)
*/
mrb_define_method
(
mrb
,
krn
,
"local_variables"
,
mrb_local_variables
,
MRB_ARGS_NONE
());
/* 15.3.1.3.28 */
mrb_define_method
(
mrb
,
krn
,
"local_variables"
,
mrb_local_variables
,
MRB_ARGS_NONE
());
/* 15.3.1.3.28 */
mrb_define_method
(
mrb
,
krn
,
"singleton_class"
,
mrb_singleton_class
,
MRB_ARGS_NONE
());
mrb_define_method
(
mrb
,
krn
,
"singleton_class"
,
mrb_singleton_class
,
MRB_ARGS_NONE
());
...
...
mrbgems/mruby-metaprog/test/metaprog.rb
View file @
4b83fe8b
...
@@ -99,6 +99,18 @@ assert('Kernel#singleton_methods', '15.3.1.3.45') do
...
@@ -99,6 +99,18 @@ assert('Kernel#singleton_methods', '15.3.1.3.45') do
assert_equal
singleton_methods
.
class
,
Array
assert_equal
singleton_methods
.
class
,
Array
end
end
assert
(
'Kernel.global_variables'
,
'15.3.1.2.4'
)
do
assert_equal
Array
,
Kernel
.
global_variables
.
class
end
assert
(
'Kernel#global_variables'
,
'15.3.1.3.14'
)
do
variables
=
global_variables
assert_equal
Array
,
variables
.
class
1
.
upto
(
9
)
do
|
i
|
assert_equal
variables
.
include?
(
:"$
#{
i
}
"
),
true
end
end
assert
(
'Kernel.local_variables'
,
'15.3.1.2.7'
)
do
assert
(
'Kernel.local_variables'
,
'15.3.1.2.7'
)
do
a
,
b
=
0
,
1
a
,
b
=
0
,
1
a
+=
b
a
+=
b
...
...
src/kernel.c
View file @
4b83fe8b
...
@@ -783,7 +783,6 @@ mrb_init_kernel(mrb_state *mrb)
...
@@ -783,7 +783,6 @@ mrb_init_kernel(mrb_state *mrb)
mrb_define_method
(
mrb
,
krn
,
"extend"
,
mrb_obj_extend_m
,
MRB_ARGS_ANY
());
/* 15.3.1.3.13 */
mrb_define_method
(
mrb
,
krn
,
"extend"
,
mrb_obj_extend_m
,
MRB_ARGS_ANY
());
/* 15.3.1.3.13 */
mrb_define_method
(
mrb
,
krn
,
"freeze"
,
mrb_obj_freeze
,
MRB_ARGS_NONE
());
mrb_define_method
(
mrb
,
krn
,
"freeze"
,
mrb_obj_freeze
,
MRB_ARGS_NONE
());
mrb_define_method
(
mrb
,
krn
,
"frozen?"
,
mrb_obj_frozen
,
MRB_ARGS_NONE
());
mrb_define_method
(
mrb
,
krn
,
"frozen?"
,
mrb_obj_frozen
,
MRB_ARGS_NONE
());
mrb_define_method
(
mrb
,
krn
,
"global_variables"
,
mrb_f_global_variables
,
MRB_ARGS_NONE
());
/* 15.3.1.3.14 */
mrb_define_method
(
mrb
,
krn
,
"hash"
,
mrb_obj_hash
,
MRB_ARGS_NONE
());
/* 15.3.1.3.15 */
mrb_define_method
(
mrb
,
krn
,
"hash"
,
mrb_obj_hash
,
MRB_ARGS_NONE
());
/* 15.3.1.3.15 */
mrb_define_method
(
mrb
,
krn
,
"initialize_copy"
,
mrb_obj_init_copy
,
MRB_ARGS_REQ
(
1
));
/* 15.3.1.3.16 */
mrb_define_method
(
mrb
,
krn
,
"initialize_copy"
,
mrb_obj_init_copy
,
MRB_ARGS_REQ
(
1
));
/* 15.3.1.3.16 */
mrb_define_method
(
mrb
,
krn
,
"inspect"
,
mrb_obj_inspect
,
MRB_ARGS_NONE
());
/* 15.3.1.3.17 */
mrb_define_method
(
mrb
,
krn
,
"inspect"
,
mrb_obj_inspect
,
MRB_ARGS_NONE
());
/* 15.3.1.3.17 */
...
...
test/t/kernel.rb
View file @
4b83fe8b
...
@@ -31,10 +31,6 @@ end
...
@@ -31,10 +31,6 @@ end
# Kernel.eval is provided by the mruby-gem mrbgem. '15.3.1.2.3'
# Kernel.eval is provided by the mruby-gem mrbgem. '15.3.1.2.3'
assert
(
'Kernel.global_variables'
,
'15.3.1.2.4'
)
do
assert_equal
Array
,
Kernel
.
global_variables
.
class
end
assert
(
'Kernel.iterator?'
,
'15.3.1.2.5'
)
do
assert
(
'Kernel.iterator?'
,
'15.3.1.2.5'
)
do
assert_false
Kernel
.
iterator?
assert_false
Kernel
.
iterator?
end
end
...
@@ -266,10 +262,6 @@ assert('Kernel#frozen?') do
...
@@ -266,10 +262,6 @@ assert('Kernel#frozen?') do
assert_true
0.0
.
frozen?
assert_true
0.0
.
frozen?
end
end
assert
(
'Kernel#global_variables'
,
'15.3.1.3.14'
)
do
assert_equal
Array
,
global_variables
.
class
end
assert
(
'Kernel#hash'
,
'15.3.1.3.15'
)
do
assert
(
'Kernel#hash'
,
'15.3.1.3.15'
)
do
assert_equal
hash
,
hash
assert_equal
hash
,
hash
end
end
...
@@ -488,13 +480,6 @@ assert('Kernel#respond_to_missing?') do
...
@@ -488,13 +480,6 @@ assert('Kernel#respond_to_missing?') do
assert_false
Test4RespondToMissing
.
new
.
respond_to?
(
:no_method
)
assert_false
Test4RespondToMissing
.
new
.
respond_to?
(
:no_method
)
end
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
assert
(
'stack extend'
)
do
def
recurse
(
count
,
stop
)
def
recurse
(
count
,
stop
)
return
count
if
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