Index: src/code-stub-assembler.cc |
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc |
index b83ffbd53d48f4203aa9b38b334c3900de566da4..c4b26ef697ae52d5fcfac2399b44edb7fc65e685 100644 |
--- a/src/code-stub-assembler.cc |
+++ b/src/code-stub-assembler.cc |
@@ -2900,10 +2900,27 @@ Node* CodeStubAssembler::ToThisValue(Node* context, Node* value, |
BIND(&done_throw); |
{ |
+ const char* primitive_name = nullptr; |
+ switch (primitive_type) { |
+ case PrimitiveType::kBoolean: |
+ primitive_name = "Boolean"; |
+ break; |
+ case PrimitiveType::kNumber: |
+ primitive_name = "Number"; |
+ break; |
+ case PrimitiveType::kString: |
+ primitive_name = "String"; |
+ break; |
+ case PrimitiveType::kSymbol: |
+ primitive_name = "Symbol"; |
+ break; |
+ } |
+ CHECK_NOT_NULL(primitive_name); |
+ |
// The {value} is not a compatible receiver for this method. |
- CallRuntime(Runtime::kThrowNotGeneric, context, |
- HeapConstant(factory()->NewStringFromAsciiChecked(method_name, |
- TENURED))); |
+ CallRuntime(Runtime::kThrowTypeError, context, |
+ SmiConstant(MessageTemplate::kNotGeneric), |
+ CStringConstant(method_name), CStringConstant(primitive_name)); |
Unreachable(); |
} |