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

Unified Diff: src/ic/ic.cc

Issue 1126043004: Migrate error messages, part 10. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed and rebased 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/ic/ic.h ('k') | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index daf7704c71d5ffa5d197ce4fb06bbb95255e8b4d..628da7d2055aaa5570509f41366ba4ace0c96662 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -16,7 +16,6 @@
#include "src/ic/ic-inl.h"
#include "src/ic/ic-compiler.h"
#include "src/ic/stub-cache.h"
-#include "src/messages.h"
#include "src/prototype.h"
#include "src/runtime/runtime.h"
@@ -362,11 +361,10 @@ void IC::UpdateState(Handle<Object> receiver, Handle<Object> name) {
}
-MaybeHandle<Object> IC::TypeError(const char* type, Handle<Object> object,
- Handle<Object> key) {
+MaybeHandle<Object> IC::TypeError(MessageTemplate::Template index,
+ Handle<Object> object, Handle<Object> key) {
HandleScope scope(isolate());
- Handle<Object> args[2] = {key, object};
- THROW_NEW_ERROR(isolate(), NewTypeError(type, HandleVector(args, 2)), Object);
+ THROW_NEW_ERROR(isolate(), NewTypeError(index, key, object), Object);
}
@@ -696,7 +694,7 @@ MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<Name> name) {
// If the object is undefined or null it's illegal to try to get any
// of its properties; throw a TypeError in that case.
if (object->IsUndefined() || object->IsNull()) {
- return TypeError("non_object_property_load", object, name);
+ return TypeError(MessageTemplate::kNonObjectPropertyLoad, object, name);
}
// Check if the name is trivially convertible to an index and get
@@ -1558,7 +1556,7 @@ MaybeHandle<Object> StoreIC::Store(Handle<Object> object, Handle<Name> name,
Handle<Context> script_context = ScriptContextTable::GetContext(
script_contexts, lookup_result.context_index);
if (lookup_result.mode == CONST) {
- return TypeError("const_assign", object, name);
+ return TypeError(MessageTemplate::kConstAssign, object, name);
}
Handle<Object> previous_value =
@@ -1594,7 +1592,7 @@ MaybeHandle<Object> StoreIC::Store(Handle<Object> object, Handle<Name> name,
// If the object is undefined or null it's illegal to try to set any
// properties on it; throw a TypeError in that case.
if (object->IsUndefined() || object->IsNull()) {
- return TypeError("non_object_property_store", object, name);
+ return TypeError(MessageTemplate::kNonObjectPropertyStore, object, name);
}
// Check if the given name is an array index.
« no previous file with comments | « src/ic/ic.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698