Conversation
opal/corelib/runtime.js
Outdated
| } | ||
|
|
||
| if (obj.$method_added && !obj.$method_added.$$stub) { | ||
| if (obj.$method_added && !obj.$method_added.$$stub && (obj.$$singleton_of !== Opal.BasicObject)) { |
There was a problem hiding this comment.
In light of what pointed out by @eregon in ruby/spec#200 (comment) this probably should look like
if (obj.$method_added && !obj.$method_added.$$stub && !obj.$$singleton_of) {
…
}
else if (obj.$singleton_method_added && !obj.$singleton_method_added.$$stub && obj.$$singleton_of) {
…
}and that would probably fix some more ruby specs too… :)
3b67693 to
673b9cc
Compare
|
@elia - Implemented your feedback. I've always found it a little odd to grasp the singleton class stuff, but as the code in this PR stands now. Should we be calling $singleton_method_added inside the else on obj instead? Or alternatively, should the else look like this? else if (singleton_of && singleton_of.$singleton_method_added && !singleton_of.$singleton_method_added.$$stub) |
|
Honestly I'm not sure without delving into it again, in doubt skip the else :) |
|
It passes the rubyspecs either way, which makes me uncomfortable. Maybe I can dig in and find out why. |
|
@wied03 I think your condition above in the comment is good. |
Latest rubyspecs, filter out new ruby specs that we don't pass
673b9cc to
e6fd395
Compare
|
OK. That makes sense. I pushed that change as well and squashed the commits. |
Ruby specs - ruby/spec#200
Another RSpec related issue