Sha256: a74e11efeaa097873d9973390d5af5b2e9585481370c0e241216c7bd286bd206

Contents?: true

Size: 458 Bytes

Versions: 52

Compression:

Stored size: 458 Bytes

Contents

module Ruby2JS
  class Converter

    # (const nil :C)

    handle :const do |receiver, name|
      # resolve anonymous receivers against rbstack
      receiver ||= @rbstack.map {|rb| rb[name]}.compact.last

      if receiver
        if Parser::AST::Node === receiver and receiver.type == :cbase
          put 'Function("return this")().'
        else
          parse receiver
          put '.'
        end

      end
      
      put name
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
ruby2js-5.1.1 lib/ruby2js/converter/const.rb
ruby2js-5.1.0 lib/ruby2js/converter/const.rb
ruby2js-5.0.1 lib/ruby2js/converter/const.rb
ruby2js-5.0.0 lib/ruby2js/converter/const.rb
ruby2js-4.2.2 lib/ruby2js/converter/const.rb
ruby2js-4.2.1 lib/ruby2js/converter/const.rb
ruby2js-4.2.0 lib/ruby2js/converter/const.rb
ruby2js-4.1.7 lib/ruby2js/converter/const.rb
ruby2js-4.1.6 lib/ruby2js/converter/const.rb
ruby2js-4.1.5 lib/ruby2js/converter/const.rb
ruby2js-4.1.4 lib/ruby2js/converter/const.rb
ruby2js-4.1.3 lib/ruby2js/converter/const.rb
ruby2js-4.1.2 lib/ruby2js/converter/const.rb
ruby2js-4.1.1 lib/ruby2js/converter/const.rb
ruby2js-4.1.0 lib/ruby2js/converter/const.rb
ruby2js-4.0.5 lib/ruby2js/converter/const.rb
ruby2js-4.0.4 lib/ruby2js/converter/const.rb
ruby2js-4.0.3 lib/ruby2js/converter/const.rb
ruby2js-4.0.2 lib/ruby2js/converter/const.rb
ruby2js-4.0.1 lib/ruby2js/converter/const.rb