/* jshint browser:true */
/* jshint node:true */

// object with "eval" key
var obj = {
	eval: function (str) {
		return str;
	},
	wrapper: function (str) {
		// method calling "eval" key from context
		// permitted use
		return this.eval(str);
	}
};

// object-key use, permitted
obj["eval"]('console.log(\'hello world\');');
obj.eval('console.log(\'hello world\');');

// global use, forbidden
global["eval"]('console.log(\'hello world\');');
global.eval("1+1");
eval('console.log(\'hello world\');');

window.eval('4+2');
window['eval']('4+2');

document.eval('4+2');
document['eval']('4+2');

this.eval('2+2');

@@ -278,33 +278,33 @@
 ted%0Aobj%5B%22eval%22%5D(
-'
+%22
 console.log(%5C'he
@@ -291,33 +291,32 @@
 %22%5D(%22console.log(
-%5C
 'hello world%5C');
@@ -311,21 +311,20 @@
 lo world
-%5C
 ');
-'
+%22
 );%0Aobj.e
@@ -323,25 +323,25 @@
 );%0Aobj.eval(
-'
+%22
 console.log(
@@ -332,33 +332,32 @@
 al(%22console.log(
-%5C
 'hello world%5C');
@@ -348,29 +348,28 @@
 'hello world
-%5C
 ');
-'
+%22
 );%0A%0A// globa
@@ -400,17 +400,17 @@
 %22eval%22%5D(
-'
+%22
 console.
@@ -405,33 +405,32 @@
 %22%5D(%22console.log(
-%5C
 'hello world%5C');
@@ -425,21 +425,20 @@
 lo world
-%5C
 ');
-'
+%22
 );%0Agloba
@@ -457,17 +457,17 @@
 );%0Aeval(
-'
+%22
 console.
@@ -470,17 +470,16 @@
 ole.log(
-%5C
 'hello w
@@ -486,13 +486,12 @@
 orld
-%5C
 ');
-'
+%22
 );%0A%0A
@@ -502,21 +502,21 @@
 ow.eval(
-'4+2'
+%224+2%22
 );%0Awindo
@@ -517,29 +517,29 @@
 %0Awindow%5B
-'
+%22
 eval
-'%5D('4+2'
+%22%5D(%224+2%22
 );%0A%0Adocu
@@ -548,21 +548,21 @@
 nt.eval(
-'4+2'
+%224+2%22
 );%0Adocum
@@ -569,21 +569,21 @@
 ent%5B
-'
+%22
 eval
-'%5D('4+2'
+%22%5D(%224+2%22
 );%0A%0A
@@ -596,12 +596,12 @@
 val(
-'2+2'
+%222+2%22
 );%0A

Use double quotes in test code