New issue
Advanced search Search tips

Issue 907432 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Dec 4
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Calling toString on a Proxy object returns wrong result

Reported by ali.baha...@gmail.com, Nov 21

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/70.0.3538.77 Chrome/70.0.3538.77 Safari/537.36

Steps to reproduce the problem:
Run the following code in the Console:

const f = () => {}
const p = new Proxy(f, {})
console.log(f.toString())
console.log(p.toString())

What is the expected behavior?
It should print:

() => {}
() => {}

What went wrong?
It prints:

() => {}
function () { [native code] }

Did this work before? N/A 

Chrome version: 70.0.3538.77  Channel: n/a
OS Version: 
Flash Version: 

p.toString() raises a TypeError in FF.
 
Chrome 65 and older threw a type error.
Bisected to f7d7b5c6a4a55baa8984525fba6d0d5e1355b3b0 landed in 66.0.3354.0 via r538709.

	Without --harmony-function-tostring, anything other than a JSFunction
	or JSBoundFunction throw when Function.prototype.toString is called on
	them. But with the toString revision, anything callable allows toString
	(and for non-Functions returns the good old "function () { [native code] }"
	string).

Looks like the change was intended.
FF Nightly behaves same as modern Chrome.

Components: -Blink Blink>JavaScript
Labels: Needs-Triage-M70
The Firefox folks say that the current behavior of Chrome is the right behavior, see

https://bugzilla.mozilla.org/show_bug.cgi?id=1508968#c1

I personally find this awkward.
Cc: susan.boorgula@chromium.org
Labels: Triaged-ET Target-72 M-72 FoundIn-71 FoundIn-70 FoundIn-72 OS-Mac OS-Windows
Status: Untriaged (was: Unconfirmed)
ali.baharev@ Thanks for the issue.

Able to reproduce this issue on Mac OS 10.13.6,Windows 10 and Ubuntu 17.10 on the reported version 70.0.3538.77 and latest Canary 72.0.3617.0.
This is a Non-Regression issue as this behavior is observed from M-66(66.0.3354.0) chrome build as per comment #1.

Hence marking this as Untriaged for further updates from Dev.

Thanks..
Components: -Blink>JavaScript Blink>JavaScript>Language
Status: WontFix (was: Untriaged)
working as intended.

Sign in to add a comment