Skip to content

Commit

Permalink
Fix bug where colon2 was being processed as an array, not sexp
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 17, 2013
1 parent 9a84bfa commit e7d9f16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/opal/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def process_defined(sexp, level)
f("($opal.cvars[#{part[1].to_s.inspect}] != null ? 'class variable' : nil)", sexp)
when :colon2
# TODO: avoid try/catch, probably a #process_colon2 alternative that does not raise errors is needed
[f('(function(){try { return ((', sexp), process_colon2(part[1..-1], level), f(") != null ? 'constant' : nil); } "+
[f('(function(){try { return ((', sexp), process(part, level), f(") != null ? 'constant' : nil); } "+
"catch(err) { if(err._klass === Opal.NameError) { return nil; } else { throw(err); } }; })()" , sexp)]
when :colon3
f("($opal.Object._scope.#{sexp[0][1]} == null ? nil : 'constant')", sexp)
Expand Down

0 comments on commit e7d9f16

Please sign in to comment.