Skip to content

Commit

Permalink
Repair locations that try to emit bytecodes into a class builder.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@6184 961051c9-f516-0410-bf72-c9f7e237a7b7
  • Loading branch information
headius committed Mar 12, 2008
1 parent f2be210 commit eacc068
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions lib/ruby/site_ruby/1.8/compiler/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ def package(name)
yield
@package.pop
end

def method?
false
end
end

class ClassBuilder
Expand Down Expand Up @@ -318,6 +322,10 @@ def field(name, type = nil)
def field_type(name)
@fields[name].type
end

def method?
false
end
end

class MethodBuilder
Expand Down Expand Up @@ -419,5 +427,9 @@ def static_signature(name, arg_types)
def type(sym)
@class_builder.type(sym)
end

def method?
true
end
end
end
6 changes: 3 additions & 3 deletions lib/ruby/site_ruby/1.8/compiler/duby/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ def compile(builder)

class BlockNode
def compile(builder)
builder.aconst_null
builder.aconst_null if builder.method?
child_nodes.each do |node|
node = node.next_node while NewlineNode === node
next unless node

builder.line node.position.start_line
builder.line node.position.start_line + 1

builder.pop
builder.pop if builder.method?
node.compile(builder)
end
end
Expand Down

0 comments on commit eacc068

Please sign in to comment.