<commit_before>class Module
  def self.new(&block)
    %x{
      function AnonModule(){}
      var klass = Opal.boot(Module, AnonModule);
      klass._name = nil;
      klass._scope = Module._scope;
      klass._klass = Module;

      if (block !== nil) {
        var block_self = block._s;
        block._s = null;
        block.call(klass);
        block._s = block_self;
      }

      return klass;
    }
  end

  def ===(object)
    %x{
      if (object == null) {
        return false;
      }

      var search = object._klass;

      while (search) {
        if (search === #{self}) {
          return true;
        }

        search = search._super;
      }

      return false;
    }
  end

  def alias_method(newname, oldname)
    `#{self}._proto['$' + newname] = #{self}._proto['$' + oldname]`
    self
  end

  def alias_native(mid, jsid)
    `#{self}._proto['$' + mid] = #{self}._proto[jsid]`
  end

  def ancestors
    %x{
      var parent = #{self},
          result = [];

      while (parent) {
        result.push(parent);
        parent = parent._super;
      }
<commit_msg>Default old to new in Module#alias_native<commit_after>class Module
  def self.new(&block)
    %x{
      function AnonModule(){}
      var klass = Opal.boot(Module, AnonModule);
      klass._name = nil;
      klass._scope = Module._scope;
      klass._klass = Module;

      if (block !== nil) {
        var block_self = block._s;
        block._s = null;
        block.call(klass);
        block._s = block_self;
      }

      return klass;
    }
  end

  def ===(object)
    %x{
      if (object == null) {
        return false;
      }

      var search = object._klass;

      while (search) {
        if (search === #{self}) {
          return true;
        }

        search = search._super;
      }

      return false;
    }
  end

  def alias_method(newname, oldname)
    `#{self}._proto['$' + newname] = #{self}._proto['$' + oldname]`
    self
  end

  def alias_native(mid, jsid = mid)
    `#{self}._proto['$' + mid] = #{self}._proto[jsid]`
  end

  def ancestors
    %x{
      var parent = #{self},
          result = [];

      while (parent) {
        result.push(parent);
        parent = parent._super;
      }

{'fraction_non_alphanumeric': 0.14311431143114312, 'fraction_numerical': 0.0, 'mean_word_length': 1.77875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6464767', 'n_tokens_mistral': 746, 'n_tokens_neox': 745, 'n_words': 170}