Sha256: 4fc872ee92352be9cc57730c078ce43d8e455e9beabc4912546c3670cccd21ba

Contents?: true

Size: 576 Bytes

Versions: 12

Compression:

Stored size: 576 Bytes

Contents

# frozen_string_literal: true

require 'opal/nodes/base'

module Opal
  module Nodes
    module Args
      # A utility node responsible for preparing
      # post-argument for :extract_post_* nodes
      class PreparePostArgs < Base
        handle :prepare_post_args
        children :offset

        def compile
          add_temp '$post_args'

          helper :slice

          if offset == 0
            push "$post_args = $slice(arguments)"
          else
            push "$post_args = $slice(arguments, #{offset})"
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
opal-1.8.3.rc1 lib/opal/nodes/args/prepare_post_args.rb
opal-1.8.2 lib/opal/nodes/args/prepare_post_args.rb
opal-1.8.1 lib/opal/nodes/args/prepare_post_args.rb
opal-1.8.0 lib/opal/nodes/args/prepare_post_args.rb
opal-1.8.0.beta1 lib/opal/nodes/args/prepare_post_args.rb
opal-1.7.4 lib/opal/nodes/args/prepare_post_args.rb
opal-1.8.0.alpha1 lib/opal/nodes/args/prepare_post_args.rb
opal-1.7.3 lib/opal/nodes/args/prepare_post_args.rb
opal-1.7.2 lib/opal/nodes/args/prepare_post_args.rb
opal-1.7.1 lib/opal/nodes/args/prepare_post_args.rb
opal-1.7.0 lib/opal/nodes/args/prepare_post_args.rb
opal-1.7.0.rc1 lib/opal/nodes/args/prepare_post_args.rb