Sha256: 58bf4f9dbd7270436311dab85ffd403cb4b50de9ed07cecb3cecf7ba865d9657

Contents?: true

Size: 552 Bytes

Versions: 28

Compression:

Stored size: 552 Bytes

Contents

module Ruby2JS
  class Converter

    # (cvasgn :@@a
    #   (int 1))

    handle :cvasgn do |var, expression=nil|
      multi_assign_declarations if @state == :statement

      prefix = underscored_private ? '_' : '#$'

      if @class_name
        parse @class_name
        put var.to_s.sub('@@', ".#{prefix}")
      elsif @prototype
        put var.to_s.sub('@@', "this.#{prefix}")
      else
        put var.to_s.sub('@@', "this.constructor.#{prefix}")
      end

      if expression
        put " = "; parse expression
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

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