Sha256: ea1653d3794fbff4c8131cc2832f3d615ca08f5a11cf3aceac5eed616849a101

Contents?: true

Size: 395 Bytes

Versions: 5

Compression:

Stored size: 395 Bytes

Contents

module Ruby2JS
  class Converter

   # (args
   #   (arg :a)
   #   (restarg :b)
   #   (blockarg :c))

    handle :args do |*args|
      parse_all(*args, join: ', ')
    end

    handle :mlhs do |*args|
      if es2015
        put '['
        parse_all(*args, join: ', ')
        put ']'
      else
        raise NotImplementedError, "destructuring requires ES2015"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby2js-3.0.4 lib/ruby2js/converter/args.rb
ruby2js-3.0.3 lib/ruby2js/converter/args.rb
ruby2js-3.0.2 lib/ruby2js/converter/args.rb
ruby2js-3.0.1 lib/ruby2js/converter/args.rb
ruby2js-3.0.0 lib/ruby2js/converter/args.rb