Skip to content

Commit

Permalink
Cleanup method definition bytecode generation.
Browse files Browse the repository at this point in the history
Don't automatically set the accessibility of a method (default to public and set explicitly, if needed).
  • Loading branch information
bakkdoor committed Aug 28, 2012
1 parent 1c42f62 commit 5efd465
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 17 deletions.
4 changes: 0 additions & 4 deletions boot/rbx-compiler/compiler/ast/method_def.rb
Expand Up @@ -29,10 +29,6 @@ def generate_ivar_assignment
end

def bytecode(g)
g.push_self
g.send @access, 0
g.pop

if @name.to_s =~ /^initialize:(\S)+/
define_constructor_class_method g
end
Expand Down
7 changes: 0 additions & 7 deletions boot/rbx-compiler/compiler/ast/singleton_method_def.rb
Expand Up @@ -12,13 +12,6 @@ def initialize(line, obj_ident, method_ident, args, body, access = :public)
@body = SingletonMethodDefScope.new line, @name, args, body
@access = access
end

def bytecode(g)
g.push_self
g.send @access, 0
g.pop
super(g)
end
end

class SingletonMethodDefScope < Rubinius::AST::DefineSingletonScope
Expand Down
3 changes: 0 additions & 3 deletions lib/compiler/ast/method_def.fy
Expand Up @@ -24,9 +24,6 @@ class Fancy AST {

def bytecode: g {
pos(g)
g push_self()
g send(@access, 0)
g pop()

@name to_s =~ /^initialize:(\S)+/ if_true: {
define_constructor_class_method: g
Expand Down
3 changes: 0 additions & 3 deletions lib/compiler/ast/singleton_method_def.fy
Expand Up @@ -7,9 +7,6 @@ class Fancy AST {

def bytecode: g {
pos(g)
g push_self()
g send(@access, 0)
g pop()
bytecode(g)
}
}
Expand Down

0 comments on commit 5efd465

Please sign in to comment.