Currently, generator functions are rejected by the comptime serializer. There's a few reasons for this. Given a function* f():
Object.getPrototypeOf f:: is not Object::, but rather a special generator prototype. I added this check as an attempt to detect and reject classes, but this does not work anyways.
f:: is an object with no constructor. The check currently expects either undefined, or an object whose constructor is the function itself.
If it's a method on an object literal, i.e. { *f() {} } the current check for computed names wouldn't work anyways. It would have to be changed from string.0 is '[' to /^(\*\s*)?\[/.test string, since the * for a generator method with a computed name goes before the open bracket.
Currently, generator functions are rejected by the comptime serializer. There's a few reasons for this. Given a
function* f()
:Object.getPrototypeOf f::
is notObject::
, but rather a special generator prototype. I added this check as an attempt to detect and reject classes, but this does not work anyways.f::
is an object with no constructor. The check currently expects eitherundefined
, or an object whose constructor is the function itself.{ *f() {} }
the current check for computed names wouldn't work anyways. It would have to be changed fromstring.0 is '['
to/^(\*\s*)?\[/.test string
, since the*
for a generator method with a computed name goes before the open bracket.