Sha256: c0f48f1ee7a68b771e333b1b69d3698a6c8d8127d7788fa2fce83c2e1498c9a1

Contents?: true

Size: 795 Bytes

Versions: 6

Compression:

Stored size: 795 Bytes

Contents

class BasicObject
  def initialize(*)
  end

  def ==(other)
    `#{self} === other`
  end

  def __send__(symbol, *args, &block)
    %x{
      return #{self}['$' + symbol].apply(#{self}, args);
    }
  end

  alias eql? ==
  alias equal? ==

  def instance_eval(&block)
    %x{
      if (block === nil) {
        no_block_given();
      }

      var block_self = block._s, result;

      block._s = null;
      result = block.call(#{self}, #{self});
      block._s = block_self;

      return result;
    }
  end

  def instance_exec(*args, &block)
    %x{
      if (block === nil) {
        no_block_given();
      }

      var block_self = block._s, result;

      block._s = null;
      result = block.apply(#{self}, args);
      block._s = block_self;

      return result;
    }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opal-0.3.37 lib/assets/javascripts/opal/basic_object.rb
opal-0.3.36 lib/assets/javascripts/opal/basic_object.rb
opal-0.3.35 lib/assets/javascripts/opal/basic_object.rb
opal-0.3.34 lib/assets/javascripts/opal/basic_object.rb
opal-0.3.33 core/basic_object.rb
opal-0.3.32 core/basic_object.rb