Sha256: 073e43a24f97152a3e1b928fab69fe49456370b3dbe444d542b28f6517b61669

Contents?: true

Size: 909 Bytes

Versions: 15

Compression:

Stored size: 909 Bytes

Contents

require 'opal/nodes'

class Opal::Nodes::CallNode
  # Rubyspec uses this call to load in language specific features at runtime.
  # We can't do this at runtime, so handle it during compilation
  add_special :language_version do
    if scope.top?
      lang_type = arglist[2][1]
      target = "ruby/language/versions/#{lang_type}_1.9"

      if File.exist?(target)
        compiler.requires << target
      end

      push fragment("nil")
    end
  end

  add_special :not_supported_on do
    unless arglist.flatten.include? :opal
      compile_default!
    end
  end

  add_special :not_compliant_on do
    unless arglist.flatten.include? :opal
      compile_default!
    end
  end

  add_special :platform_is_not do
    unless arglist.flatten.include? :opal
      compile_default!
    end
  end

  add_special :platform_is do
    if arglist.flatten.include? :opal
      compile_default!
    end
  end
end


Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
opal-0.10.6 tasks/testing/mspec_special_calls.rb
opal-0.10.6.beta tasks/testing/mspec_special_calls.rb
opal-0.10.5 tasks/testing/mspec_special_calls.rb
opal-0.10.4 tasks/testing/mspec_special_calls.rb
opal-0.10.3 tasks/testing/mspec_special_calls.rb
opal-0.10.2 tasks/testing/mspec_special_calls.rb
opal-0.10.1 tasks/testing/mspec_special_calls.rb
opal-0.10.0 tasks/testing/mspec_special_calls.rb
opal-0.10.0.rc2 tasks/testing/mspec_special_calls.rb
opal-0.10.0.rc1 tasks/testing/mspec_special_calls.rb
opal-0.10.0.beta5 tasks/testing/mspec_special_calls.rb
opal-0.10.0.beta4 tasks/testing/mspec_special_calls.rb
opal-0.10.0.beta3 tasks/testing/mspec_special_calls.rb
opal-0.10.0.beta2 tasks/testing/mspec_special_calls.rb
opal-0.10.0.beta1 tasks/testing/mspec_special_calls.rb