As I keep track of errors on a webpage that utilizes JavaScript, an issue arises when running the following code:
JSON.stringify(
Object.getOwnPropertyDescriptors(Node.prototype)
);
An error is thrown stating:
undefined is not a function
I suspect this occurs when the page is loaded via a WebView rather than a standard browser.
To investigate further, I tested the page on both a normal browser and a WebView test app within an Android Emulator - it worked without any problems.
What other steps can I take to troubleshoot this recurring error?
Edit
To gather more information, I added additional logging and inspected the following:
Object.getOwnPropertyDescriptor(Node.prototype, "childNodes");
Object.getOwnPropertyDescriptor(Node.prototype, "parentNode");
Object.getOwnPropertyDescriptor(Node.prototype, "hasChildNodes");
Interestingly, only the hasChildNodes
property returns a value.