<commit_before>// Copyright (c) 2006-2008 by <NAME> <<EMAIL>>
// Copyright (c) 2007-2011 by <NAME> <<EMAIL>>
// Copyright (c) 2008-2014 <NAME> <<EMAIL>>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
"use strict";

/**
 * @scope modules
 * @instance marks
 */
var Marks = Module("marks", {
    init: function init() {
        this._localMarks = storage.newMap("local-marks", { privateData: true, replacer: Storage.Replacer.skipXpcom, store: true });
        this._urlMarks = storage.newMap("url-marks", { privateData: true, replacer: Storage.Replacer.skipXpcom, store: true });

        try {
            if (isArray(Iterator(this._localMarks).next()[1]))
                this._localMarks.clear();
        }
        catch (e) {}

        this._pendingJumps = [];
    },

    /**
     * @property {Array} Returns all marks, both local and URL, in a sorted
     *     array.
     */
    get all() iter(this._localMarks.get(this.localURI) || {},
                   this._urlMarks
                  ).sort((a, b) => String.localeCompare(a[0], b[0])),

    get localURI() buffer.focusedFrame.document.documentURI.replace(/#.*/, ""),

    Mark: function Mark(params={}) {
        let win = buffer.focusedFrame;
        let doc = win.document;

        params.location = doc.documentURI.replace(/#.*/, ""),
        params.offset = buffer.scrollPosition;
        params.path = DOM(buffer.findScrollable(0, false)).xpath;
        params.timestamp = Date.now() * 1000;
        params.equals = function (m) this.location == m.location
                                  && this.offset.x == m.offset.x
                                  && this.offset.y == m.offset.y<commit_msg>Fix :marks.<commit_after>// Copyright (c) 2006-2008 by <NAME> <<EMAIL>>
// Copyright (c) 2007-2011 by <NAME> <<EMAIL>>
// Copyright (c) 2008-2014 <NAME> <<EMAIL>>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
"use strict";

/**
 * @scope modules
 * @instance marks
 */
var Marks = Module("marks", {
    init: function init() {
        this._localMarks = storage.newMap("local-marks", { privateData: true, replacer: Storage.Replacer.skipXpcom, store: true });
        this._urlMarks = storage.newMap("url-marks", { privateData: true, replacer: Storage.Replacer.skipXpcom, store: true });

        try {
            if (isArray(Iterator(this._localMarks).next()[1]))
                this._localMarks.clear();
        }
        catch (e) {}

        this._pendingJumps = [];
    },

    /**
     * @property {Array} Returns all marks, both local and URL, in a sorted
     *     array.
     */
    get all() iter(this._localMarks.get(this.localURI) || {},
                   this._urlMarks
                  ).sort((a, b) => String.localeCompare(a[0], b[0]))
                   .toArray(),

    get localURI() buffer.focusedFrame.document.documentURI.replace(/#.*/, ""),

    Mark: function Mark(params={}) {
        let win = buffer.focusedFrame;
        let doc = win.document;

        params.location = doc.documentURI.replace(/#.*/, ""),
        params.offset = buffer.scrollPosition;
        params.path = DOM(buffer.findScrollable(0, false)).xpath;
        params.timestamp = Date.now() * 1000;
        params.equals = function (m) this.location == m.location
                                  && this.offset.x == m.offset.x
                                  && this.offset.y == m.offset.y
{'fraction_non_alphanumeric': 0.15465380249716232, 'fraction_numerical': 0.018161180476730987, 'mean_word_length': 2.1987295825771325, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7113724', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1027, 'n_words': 253}