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

Unified Diff: test/mjsunit/messages.js

Issue 1122033002: Migrate error messages, part 7. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase 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 20a93615094eb8af84688c8c16fb1b2e8272c665..3eae74cd354e66bc0400dfaf5304f3185714d4b4 100644
--- a/test/mjsunit/messages.js
+++ b/test/mjsunit/messages.js
@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --stack-size=100 --harmony --harmony-reflect
+// Flags: --stack-size=100 --harmony --harmony-reflect --harmony-arrays
+// Flags: --harmony-regexps
function test(f, expected, type) {
try {
@@ -66,6 +67,11 @@ test(function() {
[].join(Object(Symbol(1)));
}, "Cannot convert object to primitive value", TypeError);
+// kConstructorNotFunction
+test(function() {
+ Uint16Array(1);
+}, "Constructor Uint16Array requires 'new'", TypeError);
+
// kDateType
test(function() {
Date.prototype.setYear.call({}, 1);
@@ -85,6 +91,11 @@ test(function() {
}, "First argument to String.prototype.startsWith " +
"must not be a regular expression", TypeError);
+// kFlagsGetterNonObject
+test(function() {
+ Object.getOwnPropertyDescriptor(RegExp.prototype, "flags").get.call(1);
+}, "RegExp.prototype.flags getter called on non-object 1", TypeError);
+
// kFunctionBind
test(function() {
Function.prototype.bind.call(1);
@@ -122,6 +133,18 @@ test(function() {
1 in 1;
}, "Cannot use 'in' operator to search for '1' in 1", TypeError);
+// kIteratorResultNotAnObject
+test(function() {
+ var obj = {};
+ obj[Symbol.iterator] = function() { return { next: function() { return 1 }}};
+ Array.from(obj);
+}, "Iterator result 1 is not an object", TypeError);
+
+// kIteratorValueNotAnObject
+test(function() {
+ new Map([1]);
+}, "Iterator value 1 is not an entry object", TypeError);
+
// kNotConstructor
test(function() {
new Symbol();
@@ -156,6 +179,11 @@ test(function() {
Function.prototype.toString.call(1);
}, "Function.prototype.toString is not generic", TypeError);
+// kNotTypedArray
+test(function() {
+ Uint16Array.prototype.forEach.call(1);
+}, "this is not a typed array.", TypeError);
+
// kObjectGetterExpectingFunction
test(function() {
({}).__defineGetter__("x", 0);
« 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