Sha256: e70a9bfb0a3601b2ae7f2315342ffcfb488393e5e3705143739fd8d9e23e7e2a

Contents?: true

Size: 511 Bytes

Versions: 48

Compression:

Stored size: 511 Bytes

Contents

module Ruby2JS
  class Converter

    # (prototype expr) 

    # NOTE: prototype is a synthetic 

    handle :prototype do |expr|
      begin
        @block_this, @block_depth = false, 0
        prototype, @prototype = @prototype, true
        mark = output_location
        parse(expr)

        if @block_this
          insert mark, "#{es2015 ? 'let' : 'var'} self = this#{@sep}" 
        end
      ensure
        @prototype = prototype
        @block_this, @block_depth = nil, nil
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

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