Function.prototype.toString throws when called on Proxy

RESOLVED INVALID

Status

()

Core
JavaScript Engine
RESOLVED INVALID
3 years ago
3 years ago

People

(Reporter: vladsv88, Unassigned)

Tracking

38 Branch
x86_64
Windows 8.1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36

Steps to reproduce:

This code throws a exception on Firefox 38a2:

var f1 = function() { };
var f2 = new Proxy(f1, { });
f2.toString(); // throws exception


Actual results:

TypeError: Function.prototype.toString called on incompatible object


Expected results:

function() { }
(Reporter)

Updated

3 years ago
Component: Untriaged → JavaScript Engine
Product: Firefox → Core

Comment 1

3 years ago
regression range:
good=2015-01-31
bad=2015-02-01
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=d7e156a7a0a6&tochange=c2359a6a6958

Tom Schuster — Bug 1100936 - Handle various operations on revoked proxies. r=efaust

Not sure if it's a valid regression anyway. CC'ed Tom.
Blocks: 1100936
Flags: needinfo?(evilpies)
This was a conscious decision, the ES6 spec doesn't allow this kind of unwrapping behavior.
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-function.prototype.tostring: Proxies are neither a bound function nor do they have an [[ECMAScriptCode]] internal slot. They just have [[Call]].
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Flags: needinfo?(evilpies)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.