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

Unified Diff: test/mjsunit/messages.js

Issue 1118273004: Migrate error messages, part 8. (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/typedarray.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 3eae74cd354e66bc0400dfaf5304f3185714d4b4..5a63e733694aa111bca1fa27d491bc79fb6cae9b 100644
--- a/test/mjsunit/messages.js
+++ b/test/mjsunit/messages.js
@@ -72,6 +72,11 @@ test(function() {
Uint16Array(1);
}, "Constructor Uint16Array requires 'new'", TypeError);
+// kDataViewNotArrayBuffer
+test(function() {
+ new DataView(1);
+}, "First argument to DataView constructor must be an ArrayBuffer", TypeError);
+
// kDateType
test(function() {
Date.prototype.setYear.call({}, 1);
@@ -145,6 +150,11 @@ test(function() {
new Map([1]);
}, "Iterator value 1 is not an entry object", TypeError);
+// kNotAPromise
+test(function() {
+ Promise.prototype.chain.call(1);
+}, "1 is not a promise", TypeError);
+
// kNotConstructor
test(function() {
new Symbol();
@@ -233,6 +243,11 @@ test(function() {
[].reduce(function() {});
}, "Reduce of empty array with no initial value", TypeError);
+// kResolverNotAFunction
+test(function() {
+ new Promise(1);
+}, "Promise resolver 1 is not a function", TypeError);
+
// kSymbolToPrimitive
test(function() {
1 + Object(Symbol());
@@ -293,6 +308,16 @@ test(function() {
Object.defineProperty([], "length", { value: 1E100 });
}, "defineProperty() array length out of range", RangeError);
+// kInvalidArrayBufferLength
+test(function() {
+ new ArrayBuffer(-1);
+}, "Invalid array buffer length", RangeError);
+
+// kInvalidArrayLength
+test(function() {
+ [].length = -1;
+}, "Invalid array length", RangeError);
+
// kInvalidCodePoint
test(function() {
String.fromCodePoint(-1);
@@ -303,6 +328,11 @@ test(function() {
"a".repeat(-1);
}, "Invalid count value", RangeError);
+// kInvalidArrayBufferLength
+test(function() {
+ new Uint16Array(-1);
+}, "Invalid typed array length", RangeError);
+
// kNormalizationForm
test(function() {
"".normalize("ABC");
« no previous file with comments | « src/typedarray.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698