<commit_before>var Class = require('uclass');
var merge = require("mout/object/merge")

var Options = new Class({

  initialize : function(){
    if(!this.options)
      this.options = {};
    //this.options = should clone here 
  },

  setOptions: function(options){
      var args = [{}, this.options]
      args.push.apply(args, arguments)
      this.options = merge.apply(null, args)
      return this
  }
});

module.exports = Options;<commit_msg>Make options recurse among all prototypes<commit_after>var Class = require('uclass');
var merge = require("mout/object/merge")

var Options = new Class({

  setOptions: function(options){
      var optionsStack = Array.prototype.slice.call(arguments,0),
          tmp = Object.getPrototypeOf(this);
      while(tmp) {
        optionsStack.push(tmp.options);
        if(!tmp.constructor)
          break;
        tmp = tmp.constructor.parent;
      }
      optionsStack.push({});
      optionsStack.reverse();

      this.options = merge.apply(null, optionsStack)
      return this
  }
});

module.exports = Options;
{'fraction_non_alphanumeric': 0.13495782567947517, 'fraction_numerical': 0.0009372071227741331, 'mean_word_length': 2.985074626865672, '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': '182032', 'n_tokens_mistral': 314, 'n_tokens_neox': 307, 'n_words': 68}