// Returns empty generator as expected.
function yieldOnly(): Generator
{
yield;
}
// Throws TypeError as expected.
function returnOnly(): Generator
{
return;
}
// Returns empty generator???
function returnAndYield(): Generator
{
return;
yield;
}
The return value of returnAndYield() is an empty Generator, although I was expecting it to throw a TypeError. Is this the expected behavior? I could not find it documented anywhere and am wondering if this is potentially a bug that should be reported.