Closed Bug 993389 Opened 8 years ago Closed 4 years ago

isGenerator fails for bound functions

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: mano, Unassigned)

References

Details

var f = function*() { }.bind(this);
f.isGenerator()

returns false.
Summary: isGenerator fails for bounded functions → isGenerator fails for bound functions
The isGenerator() method is "not a well-motivated reflective operation", so it's not clear it should even exist.  You'd do better to write your code in such a way that you don't even have to ask the question, at least if my understanding of #jslang discussion is correct.
Hey Jeff, Do you mind looking at the use case in PlacesTransaction.jsm (the transact method) - isGenerator is used for input validation.
isGenerator will be removed in bug 1119777, as it works only for legacy generator that will also be removed near future.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
See Also: → 1119777
You need to log in before you can comment on or make changes to this bug.