summaryrefslogtreecommitdiffstats
path: root/V8Binding/v8/test/mjsunit/json.js
diff options
context:
space:
mode:
Diffstat (limited to 'V8Binding/v8/test/mjsunit/json.js')
-rw-r--r--V8Binding/v8/test/mjsunit/json.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/V8Binding/v8/test/mjsunit/json.js b/V8Binding/v8/test/mjsunit/json.js
index 4758264..bf44f78 100644
--- a/V8Binding/v8/test/mjsunit/json.js
+++ b/V8Binding/v8/test/mjsunit/json.js
@@ -195,3 +195,13 @@ assertEquals('{"y":6,"x":5}', JSON.stringify({x:5,y:6}, ['y', 'x']));
assertEquals(undefined, JSON.stringify(undefined));
assertEquals(undefined, JSON.stringify(function () { }));
+
+function checkIllegal(str) {
+ assertThrows(function () { JSON.parse(str); }, SyntaxError);
+}
+
+checkIllegal('1); throw "foo"; (1');
+
+var x = 0;
+eval("(1); x++; (1)");
+checkIllegal('1); x++; (1');