<div dir="ltr">I'm getting deja vu again</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 19 Mar 2019 at 14:31 Isiah Meadows <<a href="mailto:isiahmeadows@gmail.com">isiahmeadows@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>UX workflows aren't all of JS. Classes exist for many more reasons than that, and 99% of my classes are for abstracting non-trivial business logic and ensuring *those* are easily testable, not directly UI/UX.</div><br clear="all"><div><div dir="ltr" class="m_-6190946184790335060gmail_signature" data-smartmail="gmail_signature">-----<br><br>Isiah Meadows<br><a href="mailto:contact@isiahmeadows.com" target="_blank">contact@isiahmeadows.com</a><br><a href="http://www.isiahmeadows.com" target="_blank">www.isiahmeadows.com</a></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 17, 2019 at 2:35 AM kai zhu <<a href="mailto:kaizhu256@gmail.com" target="_blank">kaizhu256@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>*rant warning*</div><div><br></div><div>-1 because classes generally have little-value in UX-workflow programming.</div><div><br></div>the example class RequestManager (given in this discussion), realistically has little reusability-value -- its no better than employing a throwaway static-function (both are equally likely to get rewritten each time UX-workflow features are added.).<div><br></div><div>for example, a common feature-request is adding visual-progress-bar.  there is no "simple" way to extend RequestManager to do this, other than significant-refactoring of the base-class (and risk breaking class-dependencies downstream).</div><div><br></div><div>some other common UX feature-requests that would likely invalidate "reusability" of your class-based design include:</div><div><br></div><div>1. needing to upload a binary-file (social-images, receipt-signatures, screenshots, etc...)</div><div>2. needing to upload multiple binary-files in parallel (keeping track of timeouts of each)</div><div>3. needing to upload multiple binary-files in parallel (keeping track of timeouts of each),</div><div>    and then download their thumbnail-previews from server to visually confirm uploads were correct</div><div>4. needing to make parallel http-requests from 3rd-party sources and "joining" the response-data</div><div>5. needing the sign-up-page to additionally pre-validate</div><div>    email / username / mobile-number / credit-card / etc... before form-submission to server</div><div><br></div><div>many frontend-engineers with experience "extending" products with additional UX-workflow features, know its rarely as simple as modifying some class-methods and be done with it -- it oftentimes require rewriting nearly every-piece-of-code that touches the given workflow needing enhancement.</div><div><div><br></div><div>p.s. -- here's a "simple" fully-working UX-example [1] on how to add visual-progress-bar to http-requests.  if i had to additionally add some of the other UX-features mentioned above, it would likely entail me completely rewriting the throwaway static-function, rather than waste time trying to extend it.</div><div><br></div><div>[1] <a href="https://jsfiddle.net/kaizhu256/t9ubdenf/" target="_blank">https://jsfiddle.net/kaizhu256/t9ubdenf/</a></div><div><br></div><div><div><font face="Courier" size="1">```html</font></div><div><div><font face="Courier" size="1"><style></font></div><div><font face="Courier" size="1">/* jslint utility2:true */</font></div><div><font face="Courier" size="1">/* csslint ignore:start */</font></div><div><font face="Courier" size="1">*,</font></div><div><font face="Courier" size="1">*:after,</font></div><div><font face="Courier" size="1">*:before {</font></div><div><font face="Courier" size="1">    box-sizing: border-box;</font></div><div><font face="Courier" size="1">}</font></div><div><font face="Courier" size="1">/* csslint ignore:end */</font></div><div><font face="Courier" size="1">body {</font></div><div><font face="Courier" size="1">    background: #eee;</font></div><div><font face="Courier" size="1">    font-family: Arial, Helvetica, sans-serif;</font></div><div><font face="Courier" size="1">    font-size: small;</font></div><div><font face="Courier" size="1">}</font></div><div><font face="Courier" size="1">input {</font></div><div><font face="Courier" size="1">    width: 100%;</font></div><div><font face="Courier" size="1">}</font></div><div><font face="Courier" size="1">textarea {</font></div><div><font face="Courier" size="1">    font-family: Consolas, Menlo, monospace;</font></div><div><font face="Courier" size="1">    font-size: smaller;</font></div><div><font face="Courier" size="1">    overflow: auto;</font></div><div><font face="Courier" size="1">    width: 100%;</font></div><div><font face="Courier" size="1">}</font></div><div><font face="Courier" size="1"></style></font></div><div><font face="Courier" size="1"><br></font></div><div><font face="Courier" size="1"><div id="ajaxProgressDiv1" style="background: #d00; height: 5px; left: 0; margin: 0; padding: 0; position: fixed; top: 0; transition: background 500ms, width 1500ms; width: 0%; z-index: 1;"></div></font></div><div><font face="Courier" size="1"><br></font></div><div><font face="Courier" size="1"><label>ajax-request</label><br></font></div><div><font face="Courier" size="1"><textarea id="input1" style="height: 10rem;">{</font></div><div><font face="Courier" size="1">    "method": "GET",</font></div><div><font face="Courier" size="1">    "url": "<a href="https://api.github.com/orgs/octokit/repos" target="_blank">https://api.github.com/orgs/octokit/repos</a>",</font></div><div><font face="Courier" size="1">    "headers": {</font></div><div><font face="Courier" size="1">        "accept": "application/vnd.github.v3+json"</font></div><div><font face="Courier" size="1">    },</font></div><div><font face="Courier" size="1">    "data": "hello world!"</font></div><div><font face="Courier" size="1">}</textarea><br><br></font></div><div><font face="Courier" size="1"><br></font></div><div><font face="Courier" size="1"><button id="submit1">submit ajax-request</button><br><br></font></div><div><font face="Courier" size="1"><br></font></div><div><font face="Courier" size="1"><label>ajax-response</label><br></font></div><div><font face="Courier" size="1"><textarea id="output1" style="height: 20rem;"></textarea><br><br></font></div><div><font face="Courier" size="1"><br></font></div><div><font face="Courier" size="1"><script></font></div><div><font face="Courier" size="1">/*jslint browser*/</font></div><div><font face="Courier" size="1">(function () {</font></div><div><font face="Courier" size="1">    "use strict";</font></div><div><font face="Courier" size="1">    var local;</font></div><div><font face="Courier" size="1">    local = {};</font></div><div><font face="Courier" size="1">    window.local = local;</font></div><div><font face="Courier" size="1"><br></font></div><div><font face="Courier" size="1">    local.ajax = function (opt, onError) {</font></div><div><font face="Courier" size="1">    /*</font></div><div><font face="Courier" size="1">     * simple, throwaway ajax-function that can be easily rewritten</font></div><div><font face="Courier" size="1">     * to accomodate new [async] ux-features</font></div><div><font face="Courier" size="1">     */</font></div><div><font face="Courier" size="1">        var resHandler;</font></div><div><font face="Courier" size="1">        var xhr;</font></div><div><font face="Courier" size="1">        opt.headers = opt.headers || {};</font></div><div><font face="Courier" size="1">        opt.method = opt.method || "GET";</font></div><div><font face="Courier" size="1">        xhr = new XMLHttpRequest();</font></div><div><font face="Courier" size="1">        // open url</font></div><div><font face="Courier" size="1">        xhr.open(opt.method, opt.url);</font></div><div><font face="Courier" size="1">        // set req-headers</font></div><div><font face="Courier" size="1">        Object.entries(opt.headers).forEach(function (entry) {</font></div><div><font face="Courier" size="1">            xhr.setRequestHeader(entry[0], entry[1]);</font></div><div><font face="Courier" size="1">        });</font></div><div><font face="Courier" size="1">        // send data</font></div><div><font face="Courier" size="1">        xhr.send(opt.data);</font></div><div><font face="Courier" size="1">        // init request-handling</font></div><div><font face="Courier" size="1">        resHandler = function (evt) {</font></div><div><font face="Courier" size="1">        /*</font></div><div><font face="Courier" size="1">         * this function will handle ajax-response</font></div><div><font face="Courier" size="1">         */</font></div><div><font face="Courier" size="1">            switch (evt.type) {</font></div><div><font face="Courier" size="1">            case "abort":</font></div><div><font face="Courier" size="1">            case "error":</font></div><div><font face="Courier" size="1">                // decrement ajaxProgressCounter</font></div><div><font face="Courier" size="1">                local.ajaxProgressCounter = Math.max(</font></div><div><font face="Courier" size="1">                    local.ajaxProgressCounter - 1,</font></div><div><font face="Courier" size="1">                    0</font></div><div><font face="Courier" size="1">                );</font></div><div><font face="Courier" size="1">                onError(new Error(evt.type), xhr);</font></div><div><font face="Courier" size="1">                break;</font></div><div><font face="Courier" size="1">            case "load":</font></div><div><font face="Courier" size="1">                // decrement ajaxProgressCounter</font></div><div><font face="Courier" size="1">                local.ajaxProgressCounter = Math.max(</font></div><div><font face="Courier" size="1">                    local.ajaxProgressCounter - 1,</font></div><div><font face="Courier" size="1">                    0</font></div><div><font face="Courier" size="1">                );</font></div><div><font face="Courier" size="1">                onError(null, xhr);</font></div><div><font face="Courier" size="1">                break;</font></div><div><font face="Courier" size="1">            }</font></div><div><font face="Courier" size="1">            // increment ajax-progress-bar</font></div><div><font face="Courier" size="1">            local.ajaxProgressUpdate();</font></div><div><font face="Courier" size="1">        };</font></div><div><font face="Courier" size="1">        // increment ajaxProgressCounter</font></div><div><font face="Courier" size="1">        local.ajaxProgressCounter = local.ajaxProgressCounter || 0;</font></div><div><font face="Courier" size="1">        local.ajaxProgressCounter += 1;</font></div><div><font face="Courier" size="1">        // increment ajax-progress-bar</font></div><div><font face="Courier" size="1">        local.ajaxProgressUpdate();</font></div><div><font face="Courier" size="1">        xhr.addEventListener("abort", resHandler);</font></div><div><font face="Courier" size="1">        xhr.addEventListener("error", resHandler);</font></div><div><font face="Courier" size="1">        xhr.addEventListener("load", resHandler);</font></div><div><font face="Courier" size="1">        xhr.addEventListener("loadstart", resHandler);</font></div><div><font face="Courier" size="1">        xhr.addEventListener("progress", resHandler);</font></div><div><font face="Courier" size="1">    };</font></div><div><font face="Courier" size="1"><br></font></div><div><font face="Courier" size="1">    local.ajaxProgressUpdate = function () {</font></div><div><font face="Courier" size="1">    /*</font></div><div><font face="Courier" size="1">     * this function will update ajax-progress-bar</font></div><div><font face="Courier" size="1">     */</font></div><div><font face="Courier" size="1">        var ajaxProgressDiv1;</font></div><div><font face="Courier" size="1">        // init state</font></div><div><font face="Courier" size="1">        local.ajaxProgressCounter = local.ajaxProgressCounter || 0;</font></div><div><font face="Courier" size="1">        local.ajaxProgressState = local.ajaxProgressState || 0;</font></div><div><font face="Courier" size="1">        ajaxProgressDiv1 = document.querySelector(</font></div><div><font face="Courier" size="1">            "#ajaxProgressDiv1"</font></div><div><font face="Courier" size="1">        );</font></div><div><font face="Courier" size="1">        // init ajaxProgressDiv1StyleBackground</font></div><div><font face="Courier" size="1">        local.ajaxProgressDiv1StyleBackground = (</font></div><div><font face="Courier" size="1">            local.ajaxProgressDiv1StyleBackground</font></div><div><font face="Courier" size="1">            || ajaxProgressDiv1.style.background</font></div><div><font face="Courier" size="1">        );</font></div><div><font face="Courier" size="1">        // show ajaxProgress</font></div><div><font face="Courier" size="1">        ajaxProgressDiv1.style.background = (</font></div><div><font face="Courier" size="1">            local.ajaxProgressDiv1StyleBackground</font></div><div><font face="Courier" size="1">        );</font></div><div><font face="Courier" size="1">        // increment ajaxProgress</font></div><div><font face="Courier" size="1">        if (local.ajaxProgressCounter > 0) {</font></div><div><font face="Courier" size="1">            local.timerIntervalAjaxProgressHide = (</font></div><div><font face="Courier" size="1">                local.timerIntervalAjaxProgressHide</font></div><div><font face="Courier" size="1">                || setInterval(local.ajaxProgressUpdate, 2000)</font></div><div><font face="Courier" size="1">            );</font></div><div><font face="Courier" size="1">            // this algorithm will indefinitely increment ajaxProgressBar</font></div><div><font face="Courier" size="1">            // with successively smaller increments without ever reaching 100%</font></div><div><font face="Courier" size="1">            if ((ajaxProgressDiv1.style.width.slice(0, -1) | 0) > 95) {</font></div><div><font face="Courier" size="1">                ajaxProgressDiv1.style.width = "0%";</font></div><div><font face="Courier" size="1">                local.ajaxProgressState = 0;</font></div><div><font face="Courier" size="1">            }</font></div><div><font face="Courier" size="1">            local.ajaxProgressState += 1;</font></div><div><font face="Courier" size="1">            ajaxProgressDiv1.style.width = Math.max(</font></div><div><font face="Courier" size="1">                100 - 75 * Math.exp(-0.125 * local.ajaxProgressState),</font></div><div><font face="Courier" size="1">                ajaxProgressDiv1.style.width.slice(0, -1) | 0</font></div><div><font face="Courier" size="1">            ) + "%";</font></div><div><font face="Courier" size="1">        } else {</font></div><div><font face="Courier" size="1">            // finish ajaxProgress</font></div><div><font face="Courier" size="1">            ajaxProgressDiv1.style.width = "100%";</font></div><div><font face="Courier" size="1">        }</font></div><div><font face="Courier" size="1">        // cleanup timerTimeout</font></div><div><font face="Courier" size="1">        clearTimeout(local.timerTimeoutAjaxProgressHide);</font></div><div><font face="Courier" size="1">        // hide ajaxProgress</font></div><div><font face="Courier" size="1">        local.timerTimeoutAjaxProgressHide = setTimeout(function () {</font></div><div><font face="Courier" size="1">            ajaxProgressDiv1.style.background = "transparent";</font></div><div><font face="Courier" size="1">            local.ajaxProgressCounter = 0;</font></div><div><font face="Courier" size="1">            local.ajaxProgressState = 0;</font></div><div><font face="Courier" size="1">            // reset ajaxProgress</font></div><div><font face="Courier" size="1">            clearInterval(local.timerIntervalAjaxProgressHide);</font></div><div><font face="Courier" size="1">            local.timerIntervalAjaxProgressHide = null;</font></div><div><font face="Courier" size="1">            setTimeout(function () {</font></div><div><font face="Courier" size="1">                if (!local.ajaxProgressState) {</font></div><div><font face="Courier" size="1">                    ajaxProgressDiv1.style.width = "0%";</font></div><div><font face="Courier" size="1">                }</font></div><div><font face="Courier" size="1">            }, 500);</font></div><div><font face="Courier" size="1">        }, (</font></div><div><font face="Courier" size="1">            local.ajaxProgressCounter > 0</font></div><div><font face="Courier" size="1">            ? local.timeoutDefault</font></div><div><font face="Courier" size="1">            : 1000</font></div><div><font face="Courier" size="1">        ));</font></div><div><font face="Courier" size="1">    };</font></div><div><font face="Courier" size="1"><br></font></div><div><font face="Courier" size="1">    // init event-handling</font></div><div><font face="Courier" size="1">    document.querySelector(</font></div><div><font face="Courier" size="1">        "#submit1"</font></div><div><font face="Courier" size="1">    ).addEventListener("click", function () {</font></div><div><font face="Courier" size="1">        var output1;</font></div><div><font face="Courier" size="1">        output1 = document.querySelector(</font></div><div><font face="Courier" size="1">            "#output1"</font></div><div><font face="Courier" size="1">        );</font></div><div><font face="Courier" size="1">        // reset #output1</font></div><div><font face="Courier" size="1">        output1.innerHTML = "";</font></div><div><font face="Courier" size="1">        try {</font></div><div><font face="Courier" size="1">            local.ajax(JSON.parse(document.querySelector(</font></div><div><font face="Courier" size="1">                "#input1"</font></div><div><font face="Courier" size="1">            ).textContent), function (err, xhr) {</font></div><div><font face="Courier" size="1">                // handler err</font></div><div><font face="Courier" size="1">                if (err) {</font></div><div><font face="Courier" size="1">                    output1.textContent = err.stack;</font></div><div><font face="Courier" size="1">                    return;</font></div><div><font face="Courier" size="1">                }</font></div><div><font face="Courier" size="1">                // output response-headers</font></div><div><font face="Courier" size="1">                output1.textContent = (</font></div><div><font face="Courier" size="1">                    "status-code:\n"</font></div><div><font face="Courier" size="1">                    + xhr.status</font></div><div><font face="Courier" size="1">                    + "\n\nresponse-headers:\n"</font></div><div><font face="Courier" size="1">                    + xhr.getAllResponseHeaders()</font></div><div><font face="Courier" size="1">                    + "\n\nresponse-text:\n"</font></div><div><font face="Courier" size="1">                    + xhr.responseText</font></div><div><font face="Courier" size="1">                );</font></div><div><font face="Courier" size="1">            });</font></div><div><font face="Courier" size="1">        // handler errCaught</font></div><div><font face="Courier" size="1">        } catch (errCaught) {</font></div><div><font face="Courier" size="1">            output1.textContent = errCaught.stack;</font></div><div><font face="Courier" size="1">        }</font></div><div><font face="Courier" size="1">    });</font></div><div><font face="Courier" size="1">}());</font></div><div><font face="Courier" size="1"></script></font></div></div><div><font face="Courier" size="1">```</font></div></div></div><div><br></div><div><img id="m_-6190946184790335060gmail-m_-221851145310461611EFAAFAC2-BDAF-4157-B4DA-1C7D5E558990" src="cid:169946d19df426abf041"></div><div><br><blockquote type="cite"><div>On 12 Mar 2019, at 15:49, guest271314 <<a href="mailto:guest271314@gmail.com" target="_blank">guest271314@gmail.com</a>> wrote:</div><br class="m_-6190946184790335060gmail-m_-221851145310461611Apple-interchange-newline"><div><div dir="ltr"><div dir="ltr"><div>```class RequestManager {</div><div>  __THIS__(method) {</div><div>    return new Proxy(method, {</div><div>      apply: (target, thisArg, argumentsList) => {</div><div>        return method.apply(thisArg, [...argumentsList, {</div><div>          THIS: this</div><div>        }])</div><div>      }</div><div>    })</div><div>  }</div><div>  constructor() {</div><div>    this.successMessage = "Xhr successful.";</div><div>  }</div><div>  makeRequest() {</div><div>    var oReq = new XMLHttpRequest();</div><div>    oReq.addEventListener("load", this.__THIS__(this.responseHandler));</div><div>    oReq.open("GET", "data:,");</div><div>    oReq.send();</div><div>  }</div><div><br></div><div>  responseHandler(e, {THIS} = {}) {</div><div>    console.log(this, e);</div><div>    window.alert(THIS.successMessage)</div><div>  }</div><div>}</div><div><br></div><div>var reqManager = new RequestManager();</div><div><br></div><div>reqManager.makeRequest();```</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 11, 2019 at 8:59 AM john larson <<a href="mailto:johnlarsondev1@gmail.com" target="_blank">johnlarsondev1@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p class="MsoNormal" style="margin:0pt 0pt 8pt;text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">First of all, thank you all for taking the time to review the proposal and sharing your valuable opinions. I would like to note that the proposal aims not to add a new capability that was not possible to do before but rather move the standard forward on the way for a modern, better and easier to use language for all the developers. Advancements of the language, or any language in that matter, throughout the last decade also followed a similar path because we were already able to do everything in one way or the other. We actually strive for the same thing, a better Javascript.</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"></span></p><div style="margin:0pt 0pt 8pt;text-indent:0pt;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><p class="MsoNormal" style="margin:0pt 0pt 8pt;text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">That being said, l</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">et me try to clarify my proposal further by walking you through my thought process:</span><span style="letter-spacing:0pt;font-size:11pt"></span></p><div style="margin:0pt 0pt 8pt;text-indent:0pt;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><span style="letter-spacing:0pt;font-size:11pt"></span><br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><p class="MsoNormal" style="margin:0pt 0pt 8pt;text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">Normally if I try to write a class similar to the sample code I have given in my first email using an object oriented programming language like Java, C# etc., I would be writing something similar to the following:</span><span style="letter-spacing:0pt;font-size:11pt"></span></p><div style="margin:0pt 0pt 8pt;text-indent:0pt;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><span style="letter-spacing:0pt;font-size:11pt"></span><br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">   </span><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt"> </span><span style="font-family:Consolas;color:rgb(0,0,255);letter-spacing:0pt;font-size:9.5pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">class</span><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt"> </span><span style="font-family:Consolas;color:rgb(43,145,175);letter-spacing:0pt;font-size:9.5pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">RequestManager</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">    {</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">        </span><span style="font-family:Consolas;color:rgb(0,0,255);letter-spacing:0pt;font-size:9.5pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">string</span><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt"> successMessage = </span><span style="font-family:Consolas;color:rgb(163,21,21);letter-spacing:0pt;font-size:9.5pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">"Xhr successful."</span><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">;</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><p class="MsoNormal" style="margin:0pt;text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt"> </span><span style="letter-spacing:0pt;font-size:11pt"></span></p><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">        </span><span style="font-family:Consolas;color:rgb(0,0,255);letter-spacing:0pt;font-size:9.5pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">void</span><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt"> makeRequest()</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">        {</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">            </span><span style="font-family:Consolas;color:rgb(0,0,255);letter-spacing:0pt;font-size:9.5pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">var</span><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt"> oReq = </span><span style="font-family:Consolas;color:rgb(0,0,255);letter-spacing:0pt;font-size:9.5pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">new</span><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt"> XMLHttpRequest();</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">            oReq.addEventListener(</span><span style="font-family:Consolas;color:rgb(163,21,21);letter-spacing:0pt;font-size:9.5pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">"load"</span><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">, responseHandler);</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">            oReq.open(</span><span style="font-family:Consolas;color:rgb(163,21,21);letter-spacing:0pt;font-size:9.5pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">"GET"</span><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">, </span><span style="font-family:Consolas;color:rgb(163,21,21);letter-spacing:0pt;font-size:9.5pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">"</span><a><u><span class="m_-6190946184790335060gmail-m_-221851145310461611gmail-m_-2222847355274947397gmail-15" style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">www.google.com</span></u></a><span style="font-family:Consolas;color:rgb(163,21,21);letter-spacing:0pt;font-size:9.5pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">"</span><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">);</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">            oReq.send();</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">        }</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><p class="MsoNormal" style="margin:0pt;text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt"> </span><span style="letter-spacing:0pt;font-size:11pt"></span></p><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">        </span><span style="font-family:Consolas;color:rgb(0,0,255);letter-spacing:0pt;font-size:9.5pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">void</span><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt"> responseHandler()</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">        {</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">            window.alert(successMessage);</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">        }</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><p class="MsoNormal" style="margin:0pt 0pt 8pt;text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt">    }</span><span style="letter-spacing:0pt;font-size:11pt"></span></p><div style="margin:0pt 0pt 8pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Consolas;letter-spacing:0pt;font-size:9.5pt"> </span><span style="letter-spacing:0pt;font-size:11pt"></span><br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><p class="MsoNormal" style="margin:0pt 0pt 8pt;text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">As you can see, I do not even have to use a special keyword for referring to methods from inside the class. </span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">Because they are already in lexical scope. </span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">Now, if this can be accomplished in Javascript without hitting some limitation/restriction due to the current state of the language, I think it would be the ideal solution. (This limitation might be the class syntax being just a syntactical sugar or some other reason</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> that I cannot foresee right now and that would require a breaking change</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">.)</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> And I would happily change the proposal that way: “A no-keyword alternative for the “this””. If I should summarize this approach, I can say that every method of the class is going to assume the behavior we now have with arrow functions, but without requiring the use of the “this” and the arrow function syntax.</span><span style="letter-spacing:0pt;font-size:11pt"></span></p><div style="margin:0pt 0pt 8pt;text-indent:0pt;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><span style="letter-spacing:0pt;font-size:11pt"></span><br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><p class="MsoNormal" style="margin:0pt 0pt 8pt;text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">As contrary to the ideal solution, the last thing I would want would be to use a context-dependant keyword like </span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">the </span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">“this” to refer to methods/properties of the object and then try to set the context right by using binding or arrow functions. This referral should be lexical, not context-dependant. If I have the intent of referring to the instance method/property, that intent should manifest itself right there where I am using this method/property. I shouldn’t be looking at if this takes place inside an ar</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">r</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">ow function, or if the enclosing method is called with a binding or not.</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> Why should I care about the enclosing of the call, right?</span><span style="letter-spacing:0pt;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 8pt;text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">By the way</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">, MDN also </span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">mentions the following about the use of arrow functions</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">: </span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">“Arrow function expressions are ill suited as methods”.</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"></span></p><p class="MsoNormal" style="margin:0pt 0pt 8pt;text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Calibri"><b style="text-indent:0pt"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">@Yulia:</span></b><span style="text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;letter-spacing:0pt;font-size:11pt"> Thanks for pointing out the decorator </span><span style="text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;letter-spacing:0pt;font-size:11pt">approach</span><span style="text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;letter-spacing:0pt;font-size:11pt">. But that also seems to deal with the enclosing and tries to solve the problem with a “context binding” approach. The only difference is the way it determines the binding. I am against this binding approach all together. Only the lexical scope of the code should be taken into consideration.</span><br></p><div style="margin:0pt 0pt 8pt;text-indent:0pt;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"></span><br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><div style="margin:0pt 0pt 8pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Arial;color:rgb(51,51,51);letter-spacing:-0.05pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><span style="letter-spacing:0pt;font-size:11pt"></span><br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><p class="MsoNormal" style="margin:0pt 0pt 8pt;text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">So far</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">,</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> I have la</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">i</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">d out what I think the ideal solution is and what I think the problematic state we are in right now. And as a middle</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">-</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">ground, in case the ideal solution cannot be applied, I proposed a new keyword to use instead of the “this” so that it will always refer to the instance</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">, regardless of execution context binding</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">. In which case, when you replace the “this” in the problematic sample code in my initial email, it will work just fine. Let’ assume for the sake of this example that the new keyword is “self”:</span><span style="letter-spacing:0pt;font-size:11pt"></span></p><div style="margin:0pt 0pt 8pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Arial;color:rgb(51,51,51);letter-spacing:-0.05pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><span style="letter-spacing:0pt;font-size:11pt"></span><br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">class RequestManager{</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><p class="MsoNormal" style="margin:0pt;text-indent:0pt;background:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><span style="letter-spacing:0pt;font-size:11pt"></span></p><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">    constructor(){</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">        </span><b><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">self</span></b><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">.successMessage = "Xhr successful.";</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">    }</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><p class="MsoNormal" style="margin:0pt;text-indent:0pt;background:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><span style="letter-spacing:0pt;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt;text-indent:0pt;background:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><span style="letter-spacing:0pt;font-size:11pt"></span></p><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">    makeRequest() {</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">        var oReq = new XMLHttpRequest();</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">        oReq.addEventListener("load",</span><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><b><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">self</span></b><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">.responseHandler);</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">        oReq.open("GET", "</span><a><u><span class="m_-6190946184790335060gmail-m_-221851145310461611gmail-m_-2222847355274947397gmail-15" style="font-family:Consolas;letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">www.google.com</span></u></a><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">");</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">        oReq.send();</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">    }</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><p class="MsoNormal" style="margin:0pt;text-indent:0pt;background:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><span style="letter-spacing:0pt;font-size:11pt"></span></p><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">    responseHandler() {</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">        window.alert(</span><b><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">self</span></b><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">.successMessage);</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">    }</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">}</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><p class="MsoNormal" style="margin:0pt;text-indent:0pt;background:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><span style="letter-spacing:0pt;font-size:11pt"></span></p><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">var reqManager = new RequestManager();</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt;text-indent:0pt;background-color:rgb(246,248,250);font-family:Calibri"><span style="font-family:Consolas;color:rgb(36,41,46);letter-spacing:0pt;font-size:9pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">reqManager.makeRequest();</span><span style="letter-spacing:0pt;font-size:11pt"></span></div><div style="margin:0pt 0pt 8pt;text-indent:0pt;font-family:Calibri"><span style="font-family:Arial;color:rgb(51,51,51);letter-spacing:-0.05pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><span style="letter-spacing:0pt;font-size:11pt"></span><br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><p class="MsoNormal" style="margin:0pt 0pt 8pt;text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">As you can see, self.responseHandler will always point to the responseHandler method no matter whether the enclosing is a method, an arrow function or if it is called using a bind syntax or not. </span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"></span></p><p class="MsoNormal" style="margin:0pt 0pt 8pt;text-indent:0pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Calibri"><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">I would be happy to further address your concerns about this explanation if you have any.</span><span style="letter-spacing:0pt;font-size:11pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri"> </p></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 10, 2019 at 10:30 PM guest271314 <<a href="mailto:guest271314@gmail.com" target="_blank">guest271314@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">This is probably not the pattern that is being proposed though outputs the expected result<div><br></div><div><div>    ```class RequestManager {</div><div>      constructor() {</div><div>        this.successMessage = "Xhr successful.";</div><div>        RequestManager.THIS = this;</div><div>      }</div><div><br></div><div>      makeRequest() {</div><div>        var oReq = new XMLHttpRequest();</div><div>        oReq.addEventListener("load", this.responseHandler);</div><div>        oReq.open("GET", "");</div><div>        oReq.send();</div><div>      }</div><div><br></div><div>      responseHandler(e) {</div><div>        console.log(e, this); // `e`: event, `this`: XMLHttpRequest instance</div><div>        console.log(RequestManager.THIS.successMessage);</div><div>      }</div><div><br></div><div>    }</div><div><br></div><div>    var reqManager = new RequestManager();</div><div><br></div><div>    reqManager.makeRequest();```</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 9, 2019 at 11:42 AM john larson <<a href="mailto:johnlarsondev1@gmail.com" target="_blank">johnlarsondev1@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif"><b style="font-size:11pt"><u>Summary of the problem:</u></b><br></p><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">“this” keyword in Javascript is context dependent. And this is one of the culprits of most subtle and latent errors in Javascript. Moreover, use of “this” cannot be avoided if we are using classes and trying to reference instance properties.</p><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">When “this” is used in callback functions or in functions given to forEach as argument, IDEs rightfully cannot raise any design-time errors, giving developers the false sense of security, but we get run-time errors because “this” is undefined.</p><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">There seem to be two work-arounds:</p><div style="margin:0in 0in 0.0001pt 0.5in;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">1.<span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:7pt;line-height:normal;font-family:"Times New Roman"">      </span>Using arrow functions</div><p class="m_-6190946184790335060gmail-m_-221851145310461611gmail-m_-2222847355274947397gmail-m_-8918587750585472385gmail-m_-8001099771182452640gmail-m_-1339185979708762546gmail-m_-8854047637254780782gmail-MsoListParagraphCxSpLast" style="margin:0in 0in 8pt 0.5in;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">2.<span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:7pt;line-height:normal;font-family:"Times New Roman"">      </span>Using .bind(this) syntax</p><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">Just assuming we forgot to use an arrow function or a .bind(), the IDE will not be able to raise an error and we will encounter the error in run-time.</p><div style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif"> <br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif"><b><u>What I propose:</u></b></p><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">I am proposing a new keyword that will be the alternative of "this" and will always point to the instance of the class. The name of the new keyword can be chosen with consensus from the community such that it would minimize/eliminate collision in existing codebases.</p><div style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif"> <br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">Here is a sample js code:</p><div style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif"> <br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">class RequestManager{</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in"> </span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">    constructor(){</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">        this.successMessage = "Xhr successful.";</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">    }</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in"> </span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in"> </span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">    makeRequest() {</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">        var oReq = new XMLHttpRequest();</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">        oReq.addEventListener("load", this.responseHandler);</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">        oReq.open("GET", "<a href="http://www.google.com/" target="_blank">www.google.com</a>");</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">        oReq.send();</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">    }</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in"> </span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">    responseHandler() {</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">        window.alert(this.successMessage);</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">    }</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">}</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in"> </span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">var reqManager = new RequestManager();</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">reqManager.makeRequest();</span></code><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46)"></span></pre><div style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif"> <br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">This piece of code will alert “undefined” because “this” is undefined in the callback function in strict mode.</p><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">Now let’s assume a new keyword is used insetead of “this” that will always point to the class instance.</p><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">As per its implementation, as described on <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes" style="color:rgb(5,99,193)" target="_blank">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes</a>:</p><p class="MsoNormal" style="margin:0in 0in 8pt 0.5in;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif"><i><span style="font-family:Arial,sans-serif;color:rgb(51,51,51);letter-spacing:-0.05pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">“</span>JavaScript classes, introduced in ECMAScript 2015, are primarily syntactical sugar over JavaScript's existing prototype-based inheritance. The class syntax does not introduce a new object-oriented inheritance model to JavaScript.”</i><i><span style="font-family:Arial,sans-serif;color:rgb(51,51,51);letter-spacing:-0.05pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"></span></i></p><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">So with the new keyword introduced, behind the scenes, previous class could be interpreted as a piece of code along the lines of:</p><div style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif"> <br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">var RequestManager = function () {</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">    var self = this;</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">    self.successMessage = "Xhr successful";</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in"> </span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">    self.makeRequest = function () {</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">        var oReq = new XMLHttpRequest();</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">        oReq.addEventListener("load", responseHandler);</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">        oReq.open("GET", "<a href="http://www.google.com/" target="_blank">www.google.com</a>");</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">        oReq.send();</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">    };</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in"> </span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">    var responseHandler = function () {</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">        window.alert(self.successMessage);</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">    };</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">};</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">var reqManager = new RequestManager();</span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in"> </span></code></pre><pre style="white-space:pre-wrap;background:rgb(246,248,250);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><code style="font-family:"Courier New""><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46);border:1pt none windowtext;padding:0in">reqManager.makeRequest();</span></code><span style="font-size:9pt;font-family:Consolas;color:rgb(36,41,46)"></span></pre><div style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:10.5pt;line-height:14.98px;font-family:"Segoe UI",sans-serif;color:rgb(36,41,46);background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> </span><br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">I believe this way, we would not have to resort to work-arounds for such a fundamental construct of the language and this would ease developers’ lives as someone forgetting to have used an arrow function or the .bind(this) syntax will not be a problem anymore.</p><div style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif"> <br class="m_-6190946184790335060gmail-m_-221851145310461611webkit-block-placeholder"></div><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">Best Regards,</p><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">John</p></div><div id="m_-6190946184790335060gmail-m_-221851145310461611gmail-m_-2222847355274947397gmail-m_-8918587750585472385gmail-m_-8001099771182452640gmail-m_-1339185979708762546DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top:1px solid rgb(211,212,222)">
        <tbody><tr>
        <td style="width:55px;padding-top:13px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon" target="_blank"><img alt="" width="46" height="29" style="width:46px;height:29px"></a></td>
                <td style="width:470px;padding-top:12px;color:rgb(65,66,78);font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link" style="color:rgb(68,83,234)" target="_blank">www.avast.com</a>
                </td>
        </tr>
</tbody></table><a width="1" height="1"></a></div>
_______________________________________________<br>
es-discuss mailing list<br>
<a href="mailto:es-discuss@mozilla.org" target="_blank">es-discuss@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/es-discuss" rel="noreferrer" target="_blank">https://mail.mozilla.org/listinfo/es-discuss</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>es-discuss mailing list<br><a href="mailto:es-discuss@mozilla.org" target="_blank">es-discuss@mozilla.org</a><br><a href="https://mail.mozilla.org/listinfo/es-discuss" target="_blank">https://mail.mozilla.org/listinfo/es-discuss</a><br></div></blockquote></div><br></div>_______________________________________________<br>
es-discuss mailing list<br>
<a href="mailto:es-discuss@mozilla.org" target="_blank">es-discuss@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/es-discuss" rel="noreferrer" target="_blank">https://mail.mozilla.org/listinfo/es-discuss</a><br>
</blockquote></div>
_______________________________________________<br>
es-discuss mailing list<br>
<a href="mailto:es-discuss@mozilla.org" target="_blank">es-discuss@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/es-discuss" rel="noreferrer" target="_blank">https://mail.mozilla.org/listinfo/es-discuss</a><br>
</blockquote></div>