| Index: Source/bindings/core/v8/custom/V8WindowCustom.cpp
|
| diff --git a/Source/bindings/core/v8/custom/V8WindowCustom.cpp b/Source/bindings/core/v8/custom/V8WindowCustom.cpp
|
| index 5af2203cbf40bc00d14d517ac9ff96c88dea094e..f2d3ecc95104851b0406ae4abc62cb7a0a550285 100644
|
| --- a/Source/bindings/core/v8/custom/V8WindowCustom.cpp
|
| +++ b/Source/bindings/core/v8/custom/V8WindowCustom.cpp
|
| @@ -218,10 +218,17 @@
|
| exceptionState.throwIfNeeded();
|
| }
|
|
|
| -// TODO(arv): Remove this custom method and implement Symbol.toStringTag instead.
|
| +// FIXME(fqian): returning string is cheating, and we should
|
| +// fix this by calling toString function on the receiver.
|
| +// However, V8 implements toString in JavaScript, which requires
|
| +// switching context of receiver. I consider it is dangerous.
|
| void V8Window::toStringMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| - v8SetReturnValueString(info, "[object Window]", info.GetIsolate());
|
| + v8::Local<v8::Object> domWrapper = V8Window::findInstanceInPrototypeChain(info.This(), info.GetIsolate());
|
| + v8::Local<v8::Object> target = domWrapper.IsEmpty() ? info.This() : domWrapper;
|
| + v8::Local<v8::String> value;
|
| + if (target->ObjectProtoToString(info.GetIsolate()->GetCurrentContext()).ToLocal(&value))
|
| + v8SetReturnValue(info, value);
|
| }
|
|
|
| void V8Window::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
|
|
|