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

Unified Diff: src/messages.h

Issue 1087633005: Start migrating error message templates to the runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix windows build 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/factory.cc ('k') | src/messages.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.h
diff --git a/src/messages.h b/src/messages.h
index 1dbc0fafc51eceb3974498c54f73f29daef3fcbf..ba130427225e3e239eb3dbade563855a4b9597d8 100644
--- a/src/messages.h
+++ b/src/messages.h
@@ -10,8 +10,6 @@
#ifndef V8_MESSAGES_H_
#define V8_MESSAGES_H_
-#include "src/handles-inl.h"
-
// Forward declaration of MessageLocation.
namespace v8 {
namespace internal {
@@ -89,6 +87,25 @@ class MessageHandler {
Handle<Object> data);
};
+
+#define MESSAGE_TEMPLATES(T) \
+ T(PropertyNotFunction, "Property '%' of object % is not a function") \
+ T(WithExpression, "% has no properties")
+
+class MessageTemplate {
+ public:
+ enum Template {
+#define TEMPLATE(NAME, STRING) k##NAME,
+ MESSAGE_TEMPLATES(TEMPLATE)
+#undef TEMPLATE
+ kLastMessage
+ };
+
+ static MaybeHandle<String> FormatMessage(int template_index,
+ Handle<String> arg0,
+ Handle<String> arg1,
+ Handle<String> arg2);
+};
} } // namespace v8::internal
#endif // V8_MESSAGES_H_
« no previous file with comments | « src/factory.cc ('k') | src/messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698