Sha256: c8fb8905f11c485fe17b77dc5a8e0023fa344ad107463e0abc5a2580aae3826e

Contents?: true

Size: 310 Bytes

Versions: 99

Compression:

Stored size: 310 Bytes

Contents

module Ruby2JS
  class Converter

    # (defined? :@a)

    # (undefined? :@a)

    # NOTE: undefined is not produced directly by Parser

    handle :defined?, :undefined? do |var|
      op = (@ast.type == :defined? ? :"!==" : :===)
      put "typeof "; parse var; put " #{ op } 'undefined'"
    end
  end
end

Version data entries

99 entries across 99 versions & 1 rubygems

Version Path
ruby2js-2.1.19 lib/ruby2js/converter/defined.rb
ruby2js-2.1.18 lib/ruby2js/converter/defined.rb
ruby2js-2.1.17 lib/ruby2js/converter/defined.rb
ruby2js-2.1.16 lib/ruby2js/converter/defined.rb
ruby2js-2.1.15 lib/ruby2js/converter/defined.rb
ruby2js-2.1.14 lib/ruby2js/converter/defined.rb
ruby2js-2.1.13 lib/ruby2js/converter/defined.rb
ruby2js-2.1.12 lib/ruby2js/converter/defined.rb
ruby2js-2.1.11 lib/ruby2js/converter/defined.rb
ruby2js-2.1.10 lib/ruby2js/converter/defined.rb
ruby2js-2.1.9 lib/ruby2js/converter/defined.rb
ruby2js-2.1.8 lib/ruby2js/converter/defined.rb
ruby2js-2.1.7 lib/ruby2js/converter/defined.rb
ruby2js-2.1.6 lib/ruby2js/converter/defined.rb
ruby2js-2.1.5 lib/ruby2js/converter/defined.rb
ruby2js-2.1.4 lib/ruby2js/converter/defined.rb
ruby2js-2.1.3 lib/ruby2js/converter/defined.rb
ruby2js-2.1.2 lib/ruby2js/converter/defined.rb
ruby2js-2.1.1 lib/ruby2js/converter/defined.rb
ruby2js-2.1.0 lib/ruby2js/converter/defined.rb