简体   繁体   中英

JS Invalid left-hand side expression in postfix operation?

I am playing with a javascript and am running into an error. The error is this:

Invalid left-hand side expression in postfix operation.

And the script is long but I think this is this issue. The weird thing is this works when I run it locally, but when it is packaged, using asset_packager, it fails.

Any ideas why I might be getting this error?

UPDATE: After doing more research I found this function. The error seems to happen after in the "while" statement and I assume it's the "++ + a + ". This is a plugin so I didn't want to go messing with the code...but do you thing this could be it?

m.getInternetExplorerMajorVersion = function() {
            var a = m.getInternetExplorerMajorVersion.cached = typeof m.getInternetExplorerMajorVersion.cached != "undefined" ? m.getInternetExplorerMajorVersion.cached : function() {
                var a = 3, b = d.createElement("div"), c = b.getElementsByTagName("i");
                while ((b.innerHTML = "<!--[if gt IE "++ + a + "]><i></i><![endif]-->") && c[0])
Uncaught ReferenceError: Invalid left-hand side expression in postfix operation
                    ;
                return a > 4 ? a : !1
            }();
            return a
        }

I am playing with a javascript and am running into an error. The error is this:

Invalid left-hand side expression in postfix operation.

And the script is long but I think this is this issue. The weird thing is this works when I run it locally, but when it is packaged, using asset_packager, it fails.

Any ideas why I might be getting this error?

UPDATE: After doing more research I found this function. The error seems to happen after in the "while" statement and I assume it's the "++ + a + ". This is a plugin so I didn't want to go messing with the code...but do you thing this could be it?

m.getInternetExplorerMajorVersion = function() {
            var a = m.getInternetExplorerMajorVersion.cached = typeof m.getInternetExplorerMajorVersion.cached != "undefined" ? m.getInternetExplorerMajorVersion.cached : function() {
                var a = 3, b = d.createElement("div"), c = b.getElementsByTagName("i");
                while ((b.innerHTML = "<!--[if gt IE "++ + a + "]><i></i><![endif]-->") && c[0])
Uncaught ReferenceError: Invalid left-hand side expression in postfix operation
                    ;
                return a > 4 ? a : !1
            }();
            return a
        }

I am playing with a javascript and am running into an error. The error is this:

Invalid left-hand side expression in postfix operation.

And the script is long but I think this is this issue. The weird thing is this works when I run it locally, but when it is packaged, using asset_packager, it fails.

Any ideas why I might be getting this error?

UPDATE: After doing more research I found this function. The error seems to happen after in the "while" statement and I assume it's the "++ + a + ". This is a plugin so I didn't want to go messing with the code...but do you thing this could be it?

m.getInternetExplorerMajorVersion = function() {
            var a = m.getInternetExplorerMajorVersion.cached = typeof m.getInternetExplorerMajorVersion.cached != "undefined" ? m.getInternetExplorerMajorVersion.cached : function() {
                var a = 3, b = d.createElement("div"), c = b.getElementsByTagName("i");
                while ((b.innerHTML = "<!--[if gt IE "++ + a + "]><i></i><![endif]-->") && c[0])
Uncaught ReferenceError: Invalid left-hand side expression in postfix operation
                    ;
                return a > 4 ? a : !1
            }();
            return a
        }

Before the increment always the variable to be incremented in calibraces

 existingPost? existingPost.reactions[reaction]++: ""

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM