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

Unified Diff: test/mjsunit/messages.js

Issue 1140053002: Migrate error messages, part 11. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/weak-collection.js ('k') | no next file » | 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 56470b1e5e7cc14ee0c4c355b9cb7c39967187ba..8dce6f0ab332cda1e0c3b895ed5f4b5a1f382193 100644
--- a/test/mjsunit/messages.js
+++ b/test/mjsunit/messages.js
@@ -353,15 +353,47 @@ test(function() {
}, "Reflect.construct: Arguments list has wrong type", TypeError);
-//=== SyntaxError ===
+// === SyntaxError ===
+// kInvalidRegExpFlags
+test(function() {
+ /a/x.test("a");
+}, "Invalid flags supplied to RegExp constructor 'x'", SyntaxError);
+
+// kMalformedRegExp
+test(function() {
+ /(/.test("a");
+}, "Invalid regular expression: /(/: Unterminated group", SyntaxError);
+
+// kParenthesisInArgString
test(function() {
new Function(")", "");
}, "Function arg string contains parenthesis", SyntaxError);
+// kUnexpectedEOS
+test(function() {
+ JSON.parse("{")
+}, "Unexpected end of input", SyntaxError);
+
+// kUnexpectedToken
+test(function() {
+ JSON.parse("/")
+}, "Unexpected token /", SyntaxError);
+
+// kUnexpectedTokenNumber
+test(function() {
+ JSON.parse("{ 1")
+}, "Unexpected number", SyntaxError);
+
+// kUnexpectedTokenString
+test(function() {
+ JSON.parse('"""')
+}, "Unexpected string", SyntaxError);
+
// === ReferenceError ===
+// kNotDefined
test(function() {
"use strict";
o;
« no previous file with comments | « src/weak-collection.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698