I am trying to write a simple function to test whether a value is an integer or not in a CasperJS script however it keeps giving me Syntax Error. The function in question is the following:
function isInteger(possibleInteger) {
var intMatchPattern = new RegExp("/^[\d]+$/");
return intMatchPattern.test(possibleInteger);
}
I see nothing wrong with this function however CasperJS refuses to work until I remove the line with ".test" on it.
Is this a known CasperJS bug (Currently using the latest 1.1.0-DEV)? Or maybe a PhantomJS bug?
.