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
3daa53ce
Commit
3daa53ce
authored
5 years ago
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement `bind_call` method from Ruby2.7.
parent
a016d1d0
master
removing-y-tab-c
revert-5391-throw
stable
3.1.0-rc
3.0.0
3.0.0-rc
3.0.0-preview
2.1.2
2.1.2-rc2
2.1.2-rc
2.1.1
2.1.1-rc2
2.1.1-rc
2.1.0
2.1.0-rc
No related merge requests found
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
132 additions
and
93 deletions
+132
-93
mrbgems/mruby-method/mrblib/method.rb
mrbgems/mruby-method/mrblib/method.rb
+0
-12
mrbgems/mruby-method/mrblib/unbound_method.rb
mrbgems/mruby-method/mrblib/unbound_method.rb
+0
-9
mrbgems/mruby-method/src/method.c
mrbgems/mruby-method/src/method.c
+124
-72
mrbgems/mruby-method/test/method.rb
mrbgems/mruby-method/test/method.rb
+8
-0
No files found.
mrbgems/mruby-method/mrblib/method.rb
View file @
3daa53ce
...
...
@@ -6,18 +6,6 @@ class Method
}
end
def
owner
@owner
end
def
receiver
@recv
end
def
name
@name
end
def
<<
(
other
)
->
(
*
args
,
&
block
)
{
call
(
other
.
call
(
*
args
,
&
block
))
}
end
...
...
This diff is collapsed.
Click to expand it.
mrbgems/mruby-method/mrblib/unbound_method.rb
deleted
100644 → 0
View file @
a016d1d0
class
UnboundMethod
def
owner
@owner
end
def
name
@name
end
end
This diff is collapsed.
Click to expand it.
mrbgems/mruby-method/src/method.c
View file @
3daa53ce
This diff is collapsed.
Click to expand it.
mrbgems/mruby-method/test/method.rb
View file @
3daa53ce
...
...
@@ -441,3 +441,11 @@ assert 'UnboundMethod#bind' do
assert_raise
(
TypeError
)
{
Array
.
instance_method
(
:each
).
bind
(
1
)
}
assert_kind_of
Method
,
Object
.
instance_method
(
:object_id
).
bind
(
Object
.
new
)
end
assert
'UnboundMethod#bind_call'
do
m
=
Array
.
instance_method
(
:size
)
assert_equal
(
:size
,
m
.
name
)
assert_equal
(
0
,
m
.
bind_call
([]))
assert_equal
(
1
,
m
.
bind_call
([
1
]))
assert_equal
(
2
,
m
.
bind_call
([
1
,
2
]))
end
This diff is collapsed.
Click to expand it.
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