<commit_before>'use strict';

function $$UrlUtilsProvider() {
  this.$get = ['$document', function($document) {
    var urlParsingNode = $document[0].createElement("a"),
        // NOTE:  The usage of window instead of $window here is deliberate.  When the browser
        // resolves a URL for XHR, it doesn't know about any mocked $window.  $$urlUtils
        // resolves URLs just as the browser would.  Using $window here would confuse the
        // isSameOrigin check causing unexpected failures.  We avoid that by using the real window
        // object.
        originUrl = resolve(window.location.href, true);

    /**
     * @description
     * Normalizes and optionally parses a URL.
     *
     * NOTE:  This is a private service.  The API is subject to change unpredictably in any commit.
     *<commit_msg>fix($$urlUtils): use document instead of $document<commit_after>'use strict';

function $$UrlUtilsProvider() {
  this.$get = [function() {
    var urlParsingNode = document.createElement("a"),
        // NOTE:  The usage of window and document instead of $window and $document here is
        // deliberate.  This service depends on the specific behavior of anchor nodes created by the
        // browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and
        // cause us to break tests.  In addition, when the browser resolves a URL for XHR, it
        // doesn't know about mocked locations and resolves URLs to the real document - which is
        // exactly the behavior needed here.  There is little value is mocking these our for this
        // service.
        originUrl = resolve(window.location.href, true);

    /**
     * @description
     * Normalizes and optionally parses a URL.
     *
     * NOTE:  This is a private service.  The API is subject to change unpredictably in any commit.
     *
{'fraction_non_alphanumeric': 0.08275120902740463, 'fraction_numerical': 0.0005373455131649651, 'mean_word_length': 2.7091633466135456, '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': '1633795', 'n_tokens_mistral': 481, 'n_tokens_neox': 464, 'n_words': 219}