<commit_before>class Class
  def self.new(sup = Object, &block)
    %x{
      function AnonClass(){};
      var klass   = Opal.boot(sup, AnonClass)
      klass._name = nil;
      klass._scope = sup._scope;

      sup.$inherited(klass);

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

      return klass;
    }
  end

  def allocate
    %x{
      var obj = new #{self};
      obj._id = Opal.uid();
      return obj;
    }
  end

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

  # FIXME: alias_native is now depreceated
  def alias_native(mid, jsid)
    `Opal.puts("Class#alias_native is now depreceated");`
    `#{self}.prototype['$' + mid] = #{self}.prototype[jsid]`
  end

  def ancestors
    %x{
      var parent = #{self},
          result = [];
<commit_msg>Remove alias_native warning (for now)w<commit_after>class Class
  def self.new(sup = Object, &block)
    %x{
      function AnonClass(){};
      var klass   = Opal.boot(sup, AnonClass)
      klass._name = nil;
      klass._scope = sup._scope;

      sup.$inherited(klass);

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

      return klass;
    }
  end

  def allocate
    %x{
      var obj = new #{self};
      obj._id = Opal.uid();
      return obj;
    }
  end

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

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

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

{'fraction_non_alphanumeric': 0.1489010989010989, 'fraction_numerical': 0.0, 'mean_word_length': 2.1505190311418687, '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': '6770365', 'n_tokens_mistral': 636, 'n_tokens_neox': 640, 'n_words': 147}