| Index: src/ic/ic.cc
|
| diff --git a/src/ic/ic.cc b/src/ic/ic.cc
|
| index 628da7d2055aaa5570509f41366ba4ace0c96662..daf7704c71d5ffa5d197ce4fb06bbb95255e8b4d 100644
|
| --- a/src/ic/ic.cc
|
| +++ b/src/ic/ic.cc
|
| @@ -16,6 +16,7 @@
|
| #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"
|
|
|
| @@ -361,10 +362,11 @@
|
| }
|
|
|
|
|
| -MaybeHandle<Object> IC::TypeError(MessageTemplate::Template index,
|
| - Handle<Object> object, Handle<Object> key) {
|
| +MaybeHandle<Object> IC::TypeError(const char* type, Handle<Object> object,
|
| + Handle<Object> key) {
|
| HandleScope scope(isolate());
|
| - THROW_NEW_ERROR(isolate(), NewTypeError(index, key, object), Object);
|
| + Handle<Object> args[2] = {key, object};
|
| + THROW_NEW_ERROR(isolate(), NewTypeError(type, HandleVector(args, 2)), Object);
|
| }
|
|
|
|
|
| @@ -694,7 +696,7 @@
|
| // 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(MessageTemplate::kNonObjectPropertyLoad, object, name);
|
| + return TypeError("non_object_property_load", object, name);
|
| }
|
|
|
| // Check if the name is trivially convertible to an index and get
|
| @@ -1556,7 +1558,7 @@
|
| Handle<Context> script_context = ScriptContextTable::GetContext(
|
| script_contexts, lookup_result.context_index);
|
| if (lookup_result.mode == CONST) {
|
| - return TypeError(MessageTemplate::kConstAssign, object, name);
|
| + return TypeError("const_assign", object, name);
|
| }
|
|
|
| Handle<Object> previous_value =
|
| @@ -1592,7 +1594,7 @@
|
| // 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(MessageTemplate::kNonObjectPropertyStore, object, name);
|
| + return TypeError("non_object_property_store", object, name);
|
| }
|
|
|
| // Check if the given name is an array index.
|
|
|