Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: test/mjsunit/messages.js

Issue 1681513002: [json parser] add position to error message. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix BUILD.gn Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime-json.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/messages.js
diff --git a/test/mjsunit/messages.js b/test/mjsunit/messages.js
index 8da7e6bd7b950420d214e64b2f880ba9c1080f59..772670a06c3de3eb1e2a496957b53282e9496df1 100644
--- a/test/mjsunit/messages.js
+++ b/test/mjsunit/messages.js
@@ -345,36 +345,35 @@ test(function() {
eval("/a/x.test(\"a\");");
}, "Invalid regular expression flags", SyntaxError);
-// kMalformedRegExp
-test(function() {
- /(/.test("a");
-}, "Invalid regular expression: /(/: Unterminated group", SyntaxError);
-
-// kParenthesisInArgString
-test(function() {
- new Function(")", "");
-}, "Function arg string contains parenthesis", SyntaxError);
-
-// kUnexpectedEOS
+//kJsonParseUnexpectedEOS
test(function() {
JSON.parse("{")
-}, "Unexpected end of input", SyntaxError);
+}, "Unexpected end of JSON input", SyntaxError);
-// kUnexpectedToken
+// kJsonParseUnexpectedTokenAt
test(function() {
JSON.parse("/")
-}, "Unexpected token /", SyntaxError);
+}, "Unexpected token / in JSON at position 0", SyntaxError);
-// kUnexpectedTokenNumber
+// kJsonParseUnexpectedTokenNumberAt
test(function() {
JSON.parse("{ 1")
-}, "Unexpected number", SyntaxError);
+}, "Unexpected number in JSON at position 2", SyntaxError);
-// kUnexpectedTokenString
+// kJsonParseUnexpectedTokenStringAt
test(function() {
JSON.parse('"""')
-}, "Unexpected string", SyntaxError);
+}, "Unexpected string in JSON at position 2", SyntaxError);
+// kMalformedRegExp
+test(function() {
+ /(/.test("a");
+}, "Invalid regular expression: /(/: Unterminated group", SyntaxError);
+
+// kParenthesisInArgString
+test(function() {
+ new Function(")", "");
+}, "Function arg string contains parenthesis", SyntaxError);
// === ReferenceError ===
« no previous file with comments | « src/runtime/runtime-json.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698