Skip to content

Commit

Permalink
Slightly cleanup class declaration generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 6, 2013
1 parent f58c758 commit 006819e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/opal/parser.rb
Expand Up @@ -947,8 +947,7 @@ def process_class(sexp, level)
indent do
in_scope(:class) do
@scope.name = name
@scope.add_temp "self = #{name}",
"#{@scope.proto} = #{name}._proto",
@scope.add_temp "#{@scope.proto} = #{name}._proto",
"$scope = #{name}._scope"

body = process(returns(body), :stmt)
Expand All @@ -964,7 +963,7 @@ def process_class(sexp, level)

spacer = "\n#{@indent}#{INDENT}"
cls = "function #{name}() {};"
boot = "self = #{name} = $klass($base, $super, #{name.inspect}, #{name});"
boot = "var self = #{name} = $klass($base, $super, #{name.inspect}, #{name});"

[f("(function($base, $super){#{spacer}#{cls}#{spacer}#{boot}\n", sexp),
code, f("\n#@indent})", sexp), f("(", sexp), base, f(", ", sexp), sup, f(")", sexp)]
Expand Down

0 comments on commit 006819e

Please sign in to comment.