<commit_before>export default class RestrictedDomNode{
    constructor(domElement, topElement = domElement){
        if(!domElement) return domElement;

        this.topElement = topElement;
        this.domElement = domElement;

        return new Proxy(document, {
            get: this.wrapGetter.bind(this)
        });
    }

    wrapGetter(target, name){                
        if(name in this)
            return this[name];

        let realValue = this.domElement[name];
        let returnValue = undefined;

        if(typeof realValue == 'function'){
            let realFunction = realValue;

            returnValue = function(){
                let realFunctionOutput = realFunction.apply(this.domElement, arguments);

                return this.wrapResult(realFunctionOutput);
            }.bind(this);
        }else<commit_msg>fixed proxy target and added setter trap<commit_after>export default class RestrictedDomNode{
    constructor(domElement, topElement = domElement){
        if(!domElement) return domElement;

        this.topElement = topElement;
        this.domElement = domElement;

        return new Proxy(this.domElement, {
            get: this.wrapGetter.bind(this),
            set: (target, property, value) => {
                target[property] = value;
                return true;
            }
        });
    }

    wrapGetter(target, name){                
        if(name in this)
            return this[name];

        let realValue = target[name];
        let returnValue = undefined;

        if(typeof realValue == 'function'){
            let realFunction = realValue;

            returnValue = function(){
                let realFunctionOutput = realFunction.apply(target, arguments);

                return this.wrapResult(realFunctionOutput);
            }.bind(this);
        }else
{'fraction_non_alphanumeric': 0.09140369967355821, 'fraction_numerical': 0.0, 'mean_word_length': 1.9471153846153846, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2866862', 'n_tokens_mistral': 469, 'n_tokens_neox': 448, 'n_words': 109}