First, JavaScript is not my specialty and this is a former developers code I'm trying to fix.
I'm upgrading some IE code that needs to run on Edge, Chrome... and I'm getting an issue with the following code block:
XMLDocument.prototype.selectNodes = function(cXPathString, xNode) {
if( !xNode ) { xNode = this; }
var oNSResolver = this.createNSResolver(this.documentElement);
var aItems = this.evaluate(cXPathString, xNode, oNSResolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
var aResult = [];
for( var i = 0; i < aItems.snapshotLength; i++) {
aResult[i] = aItems.snapshotItem(i);
}
return aResult;
}
The error I'm getting is: Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at Function....
From what I've read I think it has something to do with the use of 'this' in the function or 'callee' is not defined in Strict mode? I tried to replace 'this' with document, which is the DOM Document but that didn't fix it.
I'm probably way off so any help would be appreciated.
Thanks, Scott.