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

Unified Diff: src/builtins/builtins-number.cc

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/builtins/builtins-function.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-number.cc
diff --git a/src/builtins/builtins-number.cc b/src/builtins/builtins-number.cc
index 25a1bad240137fbd50fc8b54cd94d76db9c58eb5..346bafa1aebee80fd219fd4c284377dd83a67929 100644
--- a/src/builtins/builtins-number.cc
+++ b/src/builtins/builtins-number.cc
@@ -29,7 +29,8 @@ BUILTIN(NumberPrototypeToExponential) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kNotGeneric,
isolate->factory()->NewStringFromAsciiChecked(
- "Number.prototype.toExponential")));
+ "Number.prototype.toExponential"),
+ isolate->factory()->Number_string()));
}
double const value_number = value->Number();
@@ -72,7 +73,8 @@ BUILTIN(NumberPrototypeToFixed) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kNotGeneric,
isolate->factory()->NewStringFromAsciiChecked(
- "Number.prototype.toFixed")));
+ "Number.prototype.toFixed"),
+ isolate->factory()->Number_string()));
}
double const value_number = value->Number();
@@ -114,7 +116,8 @@ BUILTIN(NumberPrototypeToLocaleString) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kNotGeneric,
isolate->factory()->NewStringFromAsciiChecked(
- "Number.prototype.toLocaleString")));
+ "Number.prototype.toLocaleString"),
+ isolate->factory()->Number_string()));
}
// Turn the {value} into a String.
@@ -135,7 +138,8 @@ BUILTIN(NumberPrototypeToPrecision) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kNotGeneric,
isolate->factory()->NewStringFromAsciiChecked(
- "Number.prototype.toPrecision")));
+ "Number.prototype.toPrecision"),
+ isolate->factory()->Number_string()));
}
double const value_number = value->Number();
@@ -179,7 +183,8 @@ BUILTIN(NumberPrototypeToString) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kNotGeneric,
isolate->factory()->NewStringFromAsciiChecked(
- "Number.prototype.toString")));
+ "Number.prototype.toString"),
+ isolate->factory()->Number_string()));
}
double const value_number = value->Number();
« no previous file with comments | « src/builtins/builtins-function.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698