Skip to content

Commit

Permalink
Fix bug with parsing method calls for 'special'
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 26, 2013
1 parent 78a2cc6 commit d453167
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion corelib/kernel.rb
Expand Up @@ -103,7 +103,9 @@ def dup
%x{
for (var name in #{self}) {
if (name.charAt(0) !== '$') {
copy[name] = #{self}[name];
if (name !== '_id' && name !== '_klass') {
copy[name] = #{self}[name];
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/opal/nodes/call.rb
Expand Up @@ -9,7 +9,7 @@ class CallNode < Base

def compile
# if we handle this call specially, just do that and return early
return if self.handle_special
return if self.handle_special_call

compiler.method_calls << meth.to_sym

Expand Down Expand Up @@ -82,7 +82,7 @@ def using_irb?
# Handle "special" method calls, e.g. require(). Subclasses can override
# this method. If this method returns nil, then the method will continue
# to be generated by CallNode.
def handle_special
def handle_special_call
if respond_to? "handle_#{meth}"
push __send__("handle_#{meth}")
return true
Expand Down
3 changes: 3 additions & 0 deletions stdlib/thread.rb
Expand Up @@ -15,3 +15,6 @@ def []=(key, val)
@vars[key] = val
end
end

class Queue
end
4 changes: 2 additions & 2 deletions tasks/mspec.rake
Expand Up @@ -7,9 +7,9 @@ require 'opal-sprockets'
# do this at the top level). We figure out which file we are including, and
# add it to our require list
class Opal::Nodes::CallNode
alias_method :mspec_handle_special, :handle_special
alias_method :mspec_handle_special, :handle_special_call

def handle_special
def handle_special_call
if meth == :language_version and scope.top?
lang_type = arglist[2][1]
target = "rubyspec/language/versions/#{lang_type}_1.9"
Expand Down

0 comments on commit d453167

Please sign in to comment.