So, I use a script on my Weebly website for which a full-featured scientific calculator is being created. Unfortunately, the script throws an error:
"Ignoring the get or set property of having [LenientThis] because the 'this' object is invalid."
When I returned to the script to see what was happening, I noticed that some of the characters were changed (see below), which rendered the script unusable. Here is a piece of code that should look like this:
(function(window) {
'use strict';
var calcSS3 = document.querySelector('.calc-main'),
display = calcSS3.querySelector('.calc-display span'),
radDeg = calcSS3.querySelector('.calc-rad'),
smallerButton = calcSS3.querySelector('.calc-smaller'),
hold = calcSS3.querySelector('.calc-hold'),
lnButton = calcSS3.querySelector('.calc-ln'),
helpButton = calcSS3.querySelector('.calc-info'),
secondKeySet = [].slice.call(calcSS3.querySelector('.calc-left').children, 12, 20),
hiddenCopy = calcSS3.querySelector('textarea'),
pressedKey,
frozenKey,
secondActive = false,
bracketKey,
brackets = 0,
calculator = [],
deg = false,
memory = 0,
resBuffer = '0',
bigger = false,
ln = 0,
buffStr = [],
sav = ['secondActive', 'deg', 'memory', 'buffStr', 'resBuffer'],
keyBoard = {},
secondLayer = [
['sin', 'cos', 'tan', 'ln', 'sinh', 'cosh', 'tanh', 'e<sup>x</sup>'],
[
'sin<sup>-1</sup>', 'cos<sup>-1</sup>', 'tan<sup>-1</sup>', 'log<sub>2</sub>',
'sinh<sup>-1</sup>', 'cosh<sup>-1</sup>', 'tanh<sup>-1</sup>', '2<sup>x</sup>'
]
],
Calculator = function() {
this.stack = [],
this.num = 0,
this.res = 0,
this.buff = [false, false];
this.curr = true;
this.rank = {
'=': 0,
'+': 1, '-': 1,
'/': 2, '*': 2,
'yx': 3, 'x√y': 3, 'EE': 3
};
};
In the third last line, this is what I get:
'yx': 3, 'xây': 3, 'EE': 3
I get similar results appearing elsewhere throughout the script. What's happening?