Sha256: 6a85d2bb6011fb580f3c05ef965ca281dfbf38a778c5c4878ae9b9b3d8809217

Contents?: true

Size: 569 Bytes

Versions: 22

Compression:

Stored size: 569 Bytes

Contents

# frozen_string_literal: true

require 'opal/nodes/base'

module Opal
  module Nodes
    module Args
      # Compiles extraction of the block argument
      # def m(&block); end
      #       ^^^^^^
      #
      # This node doesn't exist in the original AST,
      # InlineArgs rewriter creates it to simplify compilation
      class ExtractBlockarg < Base
        handle :extract_blockarg
        children :name

        def compile
          scope.uses_block!
          scope.add_arg name

          scope.prepare_block(name)
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
opal-1.8.3.rc1 lib/opal/nodes/args/extract_block_arg.rb
opal-1.8.2 lib/opal/nodes/args/extract_block_arg.rb
opal-1.8.1 lib/opal/nodes/args/extract_block_arg.rb
opal-1.8.0 lib/opal/nodes/args/extract_block_arg.rb
opal-1.8.0.beta1 lib/opal/nodes/args/extract_block_arg.rb
opal-1.7.4 lib/opal/nodes/args/extract_block_arg.rb
opal-1.8.0.alpha1 lib/opal/nodes/args/extract_block_arg.rb
opal-1.7.3 lib/opal/nodes/args/extract_block_arg.rb
opal-1.7.2 lib/opal/nodes/args/extract_block_arg.rb
opal-1.7.1 lib/opal/nodes/args/extract_block_arg.rb
opal-1.7.0 lib/opal/nodes/args/extract_block_arg.rb
opal-1.7.0.rc1 lib/opal/nodes/args/extract_block_arg.rb
opal-1.6.1 lib/opal/nodes/args/extract_block_arg.rb
opal-1.6.0 lib/opal/nodes/args/extract_block_arg.rb
opal-1.6.0.rc1 lib/opal/nodes/args/extract_block_arg.rb
opal-1.6.0.alpha1 lib/opal/nodes/args/extract_block_arg.rb
opal-1.5.1 lib/opal/nodes/args/extract_block_arg.rb
opal-1.5.0 lib/opal/nodes/args/extract_block_arg.rb
opal-1.5.0.rc1 lib/opal/nodes/args/extract_block_arg.rb
opal-1.4.1 lib/opal/nodes/args/extract_block_arg.rb