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-5.1.1 lib/ruby2js/converter/defined.rb
ruby2js-5.1.0 lib/ruby2js/converter/defined.rb
ruby2js-5.0.1 lib/ruby2js/converter/defined.rb
ruby2js-5.0.0 lib/ruby2js/converter/defined.rb
ruby2js-4.2.2 lib/ruby2js/converter/defined.rb
ruby2js-4.2.1 lib/ruby2js/converter/defined.rb
ruby2js-4.2.0 lib/ruby2js/converter/defined.rb
ruby2js-4.1.7 lib/ruby2js/converter/defined.rb
ruby2js-4.1.6 lib/ruby2js/converter/defined.rb
ruby2js-4.1.5 lib/ruby2js/converter/defined.rb
ruby2js-4.1.4 lib/ruby2js/converter/defined.rb
ruby2js-4.1.3 lib/ruby2js/converter/defined.rb
ruby2js-4.1.2 lib/ruby2js/converter/defined.rb
ruby2js-4.1.1 lib/ruby2js/converter/defined.rb
ruby2js-4.1.0 lib/ruby2js/converter/defined.rb
ruby2js-4.0.5 lib/ruby2js/converter/defined.rb
ruby2js-4.0.4 lib/ruby2js/converter/defined.rb
ruby2js-4.0.3 lib/ruby2js/converter/defined.rb
ruby2js-4.0.2 lib/ruby2js/converter/defined.rb
ruby2js-4.0.1 lib/ruby2js/converter/defined.rb