<commit_before>#ifndef IV_LV5_JSOBJECT_H_
#define IV_LV5_JSOBJECT_H_
#include <vector>
#include <gc/gc_cpp.h>
#include "ast.h"
#include "lv5/gc_template.h"
#include "lv5/property.h"
#include "lv5/hint.h"
#include "lv5/symbol.h"
#include "lv5/heap_object.h"
#include "lv5/class.h"
namespace iv {
namespace lv5 {

class Map;
class Slot;
class JSVal;
class JSFunction;
class Callable;
class Context;
class Error;

class JSObject : public HeapObject {
 public:
  enum EnumerationMode {
    kExcludeNotEnumerable,
    kIncludeNotEnumerable
  };
  typedef GCHashMap<Symbol, PropertyDescriptor>::type Properties;

  JSObject(Map* map);
  JSObject(Map* map, JSObject* proto, Class* cls, bool extensible);

  virtual ~JSObject() { }

  virtual JSVal DefaultValue(Context* ctx,
                             Hint::Object hint, Error* e);

  virtual JSVal Get(Context* ctx, Symbol name, Error* e);

  // if you handle it, override GetOwnPropertySlot
  PropertyDescriptor GetOwnProperty(Context* ctx, Symbol name) const;

  virtual PropertyDescriptor GetProperty(Context* ctx, Symbol name) const;

  // hook these functions

  virtual bool GetPropertySlot(Context* ctx, Symbol name, Slot* slot) const;

  virtual bool GetOwnPropertySlot(Context* ctx, Symbol name, Slot* slot) const;

  virtual bool CanPut(Context* ctx, Symbol name) const;

  virtual void Put(Context* context, Symbol name,
                   const JSVal& val, bool th, Error* e);

  virtual bool HasProperty(Context* ctx, Symbol name) const;

  virtual bool Delete(Context* ctx, Symbol name, bool th, Error* e);

  virtual bool DefineOwnProperty(Context* ctx,
                                 Symbol name,
                                 const PropertyDescriptor& desc,
                                 bool th, Error* e);

  virtual void GetPropertyNames(Context* ctx,
                                std::vector<Symbol>* vec, EnumerationMode mode) const;
<commit_msg>rm virtual from GetProperty (if you override it, override GetPropertySlot)<commit_after>#ifndef IV_LV5_JSOBJECT_H_
#define IV_LV5_JSOBJECT_H_
#include <vector>
#include <gc/gc_cpp.h>
#include "ast.h"
#include "lv5/gc_template.h"
#include "lv5/property.h"
#include "lv5/hint.h"
#include "lv5/symbol.h"
#include "lv5/heap_object.h"
#include "lv5/class.h"
namespace iv {
namespace lv5 {

class Map;
class Slot;
class JSVal;
class JSFunction;
class Callable;
class Context;
class Error;

class JSObject : public HeapObject {
 public:
  enum EnumerationMode {
    kExcludeNotEnumerable,
    kIncludeNotEnumerable
  };
  typedef GCHashMap<Symbol, PropertyDescriptor>::type Properties;

  JSObject(Map* map);
  JSObject(Map* map, JSObject* proto, Class* cls, bool extensible);

  virtual ~JSObject() { }

  virtual JSVal DefaultValue(Context* ctx,
                             Hint::Object hint, Error* e);

  virtual JSVal Get(Context* ctx, Symbol name, Error* e);

  // if you handle it, override GetOwnPropertySlot
  PropertyDescriptor GetOwnProperty(Context* ctx, Symbol name) const;

  // if you handle it, override GetPropertySlot
  PropertyDescriptor GetProperty(Context* ctx, Symbol name) const;

  // hook these functions

  virtual bool GetPropertySlot(Context* ctx, Symbol name, Slot* slot) const;

  virtual bool GetOwnPropertySlot(Context* ctx, Symbol name, Slot* slot) const;

  virtual bool CanPut(Context* ctx, Symbol name) const;

  virtual void Put(Context* context, Symbol name,
                   const JSVal& val, bool th, Error* e);

  virtual bool HasProperty(Context* ctx, Symbol name) const;

  virtual bool Delete(Context* ctx, Symbol name, bool th, Error* e);

  virtual bool DefineOwnProperty(Context* ctx,
                                 Symbol name,
                                 const PropertyDescriptor& desc,
                                 bool th, Error* e);

  virtual void GetPropertyNames(Context* ctx,
                                std::vector<Symbol>* vec, EnumerationMode mode) const;

{'fraction_non_alphanumeric': 0.09314097696785624, 'fraction_numerical': 0.004555808656036446, 'mean_word_length': 3.2586206896551726, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7276341', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1145, 'n_words': 374}