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
a66a1e92
Commit
a66a1e92
authored
Jul 25, 2016
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Jul 25, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3179 from ksss/struct
Should not define to `Struct` class
parents
34ac707e
bf21063a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
mrbgems/mruby-struct/src/struct.c
mrbgems/mruby-struct/src/struct.c
+1
-1
mrbgems/mruby-struct/test/struct.rb
mrbgems/mruby-struct/test/struct.rb
+3
-0
No files found.
mrbgems/mruby-struct/src/struct.c
View file @
a66a1e92
...
...
@@ -299,7 +299,7 @@ mrb_struct_s_def(mrb_state *mrb, mrb_value klass)
}
st
=
make_struct
(
mrb
,
name
,
rest
,
struct_class
(
mrb
));
if
(
!
mrb_nil_p
(
b
))
{
mrb_yield_with_class
(
mrb
,
b
,
1
,
&
st
,
st
,
mrb_class_ptr
(
klass
));
mrb_yield_with_class
(
mrb
,
b
,
1
,
&
st
,
st
,
mrb_class_ptr
(
st
));
}
return
st
;
...
...
mrbgems/mruby-struct/test/struct.rb
View file @
a66a1e92
...
...
@@ -23,6 +23,9 @@ assert('Struct#==', '15.2.18.4.1') do
cc1
=
c
.
new
(
1
,
2
)
cc2
=
c
.
new
(
1
,
2
)
assert_true
cc1
==
cc2
Struct
.
new
(
:m1
,
:m2
)
{
def
foo
;
end
}
assert_raise
(
NoMethodError
)
{
Struct
.
new
(
:m1
).
new
.
foo
}
end
assert
(
'Struct#[]'
,
'15.2.18.4.2'
)
do
...
...
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