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

Unified Diff: test/mjsunit/messages.js

Issue 2814043006: [errors] Improve NotGeneric error message (Closed)
Patch Set: Address comments Created 3 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/runtime/runtime-internal.cc ('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 9c250048612946b54e103c6150f4a6060d16872a..ff91185a7270a6025302e8f8e44f912a262b74f5 100644
--- a/test/mjsunit/messages.js
+++ b/test/mjsunit/messages.js
@@ -192,33 +192,33 @@ test(function() {
}, "this is not a Date object.", TypeError);
// kNotGeneric
-test(function() {
- String.prototype.toString.call(1);
-}, "String.prototype.toString is not generic", TypeError);
+test(() => String.prototype.toString.call(1),
+ "String.prototype.toString requires that 'this' be a String",
+ TypeError);
-test(function() {
- String.prototype.valueOf.call(1);
-}, "String.prototype.valueOf is not generic", TypeError);
+test(() => String.prototype.valueOf.call(1),
+ "String.prototype.valueOf requires that 'this' be a String",
+ TypeError);
-test(function() {
- Boolean.prototype.toString.call(1);
-}, "Boolean.prototype.toString is not generic", TypeError);
+test(() => Boolean.prototype.toString.call(1),
+ "Boolean.prototype.toString requires that 'this' be a Boolean",
+ TypeError);
-test(function() {
- Boolean.prototype.valueOf.call(1);
-}, "Boolean.prototype.valueOf is not generic", TypeError);
+test(() => Boolean.prototype.valueOf.call(1),
+ "Boolean.prototype.valueOf requires that 'this' be a Boolean",
+ TypeError);
-test(function() {
- Number.prototype.toString.call({});
-}, "Number.prototype.toString is not generic", TypeError);
+test(() => Number.prototype.toString.call({}),
+ "Number.prototype.toString requires that 'this' be a Number",
+ TypeError);
-test(function() {
- Number.prototype.valueOf.call({});
-}, "Number.prototype.valueOf is not generic", TypeError);
+test(() => Number.prototype.valueOf.call({}),
+ "Number.prototype.valueOf requires that 'this' be a Number",
+ TypeError);
-test(function() {
- Function.prototype.toString.call(1);
-}, "Function.prototype.toString is not generic", TypeError);
+test(() => Function.prototype.toString.call(1),
+ "Function.prototype.toString requires that 'this' be a Function",
+ TypeError);
// kNotTypedArray
test(function() {
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698