Skip to content

Commit

Permalink
Support class variables in defined? (fixes #217)
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Aug 2, 2013
1 parent e9a8db5 commit a93c18c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/opal/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,8 @@ def process_defined(sexp, level)
[f("(typeof(", sexp), process(part, :expr), f(") !== 'undefined')", sexp)]
when :const
f("($scope.#{part[1].to_s} != null)", sexp)
when :cvar
f("($opal.cvars[#{part[1].to_s.inspect}] != null ? 'class-variable' : nil)", sexp)
when :colon2
f("false", sexp)
when :colon3
Expand Down

0 comments on commit a93c18c

Please sign in to comment.