Commit b499ad67 authored by Christopher Aue's avatar Christopher Aue

Fixed return value of Module#include and #prepend

parent 46960936
......@@ -15,6 +15,7 @@ class Module
m.append_features(self)
m.included(self)
end
self
end
def prepend(*args)
......@@ -22,5 +23,6 @@ class Module
m.prepend_features(self)
m.prepended(self)
end
self
end
end
......@@ -309,10 +309,14 @@ assert('Module#include', '15.2.2.4.27') do
Const4Include = 42
end
module Test4Include2
include Test4Include
@include_result = include Test4Include
class << self
attr_reader :include_result
end
end
assert_equal 42, Test4Include2.const_get(:Const4Include)
assert_equal Test4Include2, Test4Include2.include_result
end
assert('Module#include?', '15.2.2.4.28') do
......@@ -540,6 +544,18 @@ end
assert_equal(expected, obj.m1)
end
assert('Module#prepend result') do
module TestPrepended; end
module TestPrependResult
@prepend_result = prepend TestPrepended
class << self
attr_reader :prepend_result
end
end
assert_equal TestPrependResult, TestPrependResult.prepend_result
end
# mruby shouldn't be affected by this since there is
# no visibility control (yet)
assert('Module#prepend public') do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment