Skip to content
Snippets Groups Projects
Commit ab5f9c37 authored by David Fugate's avatar David Fugate
Browse files
parent d8add6e8
No related branches found
No related tags found
No related merge requests found
......@@ -8,18 +8,17 @@
* @description Checking by using eval
*/
var match = String.prototype.match;
var match = String.prototype.match.bind(fnGlobalObject());
if (typeof toString === "undefined"){
toString = Object.prototype.toString;
}
var __class__ = toString();
try {
fnGlobalObject().toString = Object.prototype.toString;
} catch (e) { ; }
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (match(eval("\"bj\""))[0] !== "bj") {
$ERROR('#1: match = String.prototype.match; match(eval("\\"bj\\""))[0] === "bj". Actual: '+match(eval("\"bj\""))[0] );
if ((fnGlobalObject().toString === Object.prototype.toString) && //Ensure we could overwrite global obj's toString
(match(eval("\"bj\""))[0] !== "bj")) {
$ERROR('#1: match = String.prototype.match.bind(this); match(eval("\\"bj\\""))[0] === "bj". Actual: '+match(eval("\"bj\""))[0] );
}
//
//////////////////////////////////////////////////////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment