luci-base: luci.js: enable strict mode
authorJo-Philipp Wich <jo@mein.io>
Fri, 5 Apr 2019 05:51:16 +0000 (07:51 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sun, 7 Jul 2019 13:36:24 +0000 (15:36 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/luci.js

index bf7f65a7d120b44dc33459a7f56185a6f8c10a6e..19f4a54c76d641ead17bc5d322668ec97481f025 100644 (file)
@@ -1,4 +1,6 @@
 (function(window, document, undefined) {
+       'use strict';
+
        /* Object.assign polyfill for IE */
        if (typeof Object.assign !== 'function') {
                Object.defineProperty(Object, 'assign', {
         * HTTP Request helper
         */
 
-       Headers = Class.extend({
+       var Headers = Class.extend({
                __name__: 'LuCI.XHR.Headers',
                __init__: function(xhr) {
                        var hdrs = this.headers = {};
                }
        });
 
-       Response = Class.extend({
+       var Response = Class.extend({
                __name__: 'LuCI.XHR.Response',
                __init__: function(xhr, url, duration) {
                        this.ok = (xhr.status >= 200 && xhr.status <= 299);
                }
        });
 
-       Request = Class.singleton({
+       var Request = Class.singleton({
                __name__: 'LuCI.Request',
 
                interceptors: [],
            originalCBIInit = null,
            classes = {};
 
-       LuCI = Class.extend({
+       var LuCI = Class.extend({
                __name__: 'LuCI',
                __init__: function(env) {
 
 
                                /* load dependencies and instantiate class */
                                return Promise.all(depends).then(function(instances) {
+                                       var _factory, _class;
+
                                        try {
                                                _factory = eval(
                                                        '(function(window, document, L%s) { %s })\n\n//# sourceURL=%s\n'
                })
        });
 
-       XHR = Class.extend({
+       var XHR = Class.extend({
                __name__: 'LuCI.XHR',
                __init__: function() {
                        if (window.console && console.debug)