diff --git a/AUTHORS b/AUTHORS index 42a9f29d89..3d219a59db 100644 --- a/AUTHORS +++ b/AUTHORS @@ -167,6 +167,7 @@ Milton Chiang Mu Tao Myeong-bo Shim Nicolas Antonius Ernst Leopold Maria Kaiser +Niek van der Maas Niklas Hambüchen Noj Vek Oleksandr Chekhovskyi @@ -235,6 +236,7 @@ Yi Wang Yong Wang Youfeng Hao Yu Yin +Yusif Khudhur Zac Hansen Zeynep Cankara Zhao Jiazhong diff --git a/src/objects/objects.cc b/src/objects/objects.cc index 1a420d06bb..4b6f5e816e 100644 --- a/src/objects/objects.cc +++ b/src/objects/objects.cc @@ -461,6 +461,9 @@ Handle Object::NoSideEffectsToString(Isolate* isolate, if (input->IsString() || input->IsNumber() || input->IsOddball()) { return Object::ToString(isolate, input).ToHandleChecked(); + } else if (input->IsJSProxy()) { + HeapObject target = Handle::cast(input)->target(isolate); + return NoSideEffectsToString(isolate, Handle(target, isolate)); } else if (input->IsBigInt()) { MaybeHandle maybe_string = BigInt::ToString(isolate, Handle::cast(input), 10, kDontThrow); diff --git a/test/cctest/test-object.cc b/test/cctest/test-object.cc index bad0ae59da..33acd05c15 100644 --- a/test/cctest/test-object.cc +++ b/test/cctest/test-object.cc @@ -77,6 +77,11 @@ TEST(NoSideEffectsToString) { "Error: fisk hest"); CheckObject(isolate, factory->NewJSObject(isolate->object_function()), "#"); + CheckObject( + isolate, + factory->NewJSProxy(factory->NewJSObject(isolate->object_function()), + factory->NewJSObject(isolate->object_function())), + "#"); } TEST(EnumCache) {