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

Unified Diff: test/mjsunit/messages.js

Issue 1116953002: Migrate error messages, part 6. (string.js and date.js) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: . Created 5 years, 8 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/string.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 4b6915d6407add40209d5b2d52c22716d7cf21c1..20a93615094eb8af84688c8c16fb1b2e8272c665 100644
--- a/test/mjsunit/messages.js
+++ b/test/mjsunit/messages.js
@@ -79,6 +79,17 @@ test(function() {
Object.defineProperty(o, "x", { value: 1 });
}, "Cannot define property:x, object is not extensible.", TypeError);
+// kFirstArgumentNotRegExp
+test(function() {
+ "a".startsWith(/a/);
+}, "First argument to String.prototype.startsWith " +
+ "must not be a regular expression", TypeError);
+
+// kFunctionBind
+test(function() {
+ Function.prototype.bind.call(1);
+}, "Bind must be called on a function", TypeError);
+
// kGeneratorRunning
test(function() {
var iter;
@@ -87,11 +98,6 @@ test(function() {
iter.next();
}, "Generator is already running", TypeError);
-// kFunctionBind
-test(function() {
- Function.prototype.bind.call(1);
-}, "Bind must be called on a function", TypeError);
-
// kIncompatibleMethodReceiver
test(function() {
RegExp.prototype.compile.call(RegExp.prototype);
@@ -259,6 +265,16 @@ test(function() {
Object.defineProperty([], "length", { value: 1E100 });
}, "defineProperty() array length out of range", RangeError);
+// kInvalidCodePoint
+test(function() {
+ String.fromCodePoint(-1);
+}, "Invalid code point -1", RangeError);
+
+// kInvalidCountValue
+test(function() {
+ "a".repeat(-1);
+}, "Invalid count value", RangeError);
+
// kNormalizationForm
test(function() {
"".normalize("ABC");
@@ -266,11 +282,11 @@ test(function() {
// kNumberFormatRange
test(function() {
-Number(1).toFixed(100);
+ Number(1).toFixed(100);
}, "toFixed() digits argument must be between 0 and 20", RangeError);
test(function() {
-Number(1).toExponential(100);
+ Number(1).toExponential(100);
}, "toExponential() argument must be between 0 and 20", RangeError);
// kStackOverflow
« no previous file with comments | « src/string.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698