Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.

Commit

Permalink
Add InstanceInfo/KlassInfo#initializer_body.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Feb 15, 2012
1 parent ab05e2e commit 62f9853
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/furnace-avm2/abc/metadata/instance_info.rb
Expand Up @@ -28,6 +28,10 @@ def klass
root.klasses[root.instances.index(self)]
end

def initializer_body
root.method_bodies.find { |body| body.method_idx == initializer_idx }
end

def to_astlet
if interface?
root = AST::Node.new(:interface)
Expand Down
4 changes: 4 additions & 0 deletions lib/furnace-avm2/abc/metadata/klass_info.rb
Expand Up @@ -6,6 +6,10 @@ class KlassInfo < Record

abc_array_of :trait, :nested, :class => TraitInfo

def initializer_body
root.method_bodies.find { |body| body.method_idx == initializer_idx }
end

def to_astlet
root = AST::Node.new(:klass)

Expand Down

0 comments on commit 62f9853

Please sign in to comment.