![]() |
![]() |
![]() |
Seed Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
Creating JavaScript classesCreating JavaScript classes — Dealing with Seed class definitions and constructors |
#include <seed/seed.h> enum SeedPropertyAttributes; enum SeedClassAttributes; typedef SeedClass; #define seed_empty_class SeedClass seed_create_class (seed_class_definition *def); SeedObject seed_make_constructor (SeedContext ctx, SeedClass class, SeedObjectCallAsConstructorCallback constructor);
typedef enum { SEED_PROPERTY_ATTRIBUTE_NONE = 0, SEED_PROPERTY_ATTRIBUTE_READ_ONLY = 1 << 1, SEED_PROPERTY_ATTRIBUTE_DONT_ENUM = 1 << 2, SEED_PROPERTY_ATTRIBUTE_DONT_DELETE = 1 << 3 } SeedPropertyAttributes;
typedef enum { SEED_CLASS_ATTRIBUTE_NONE = 0, SEED_CLASS_ATTRIBUTE_NO_SHARED_PROTOTYPE = 1 << 1 } SeedClassAttributes;
SeedClass seed_create_class (seed_class_definition *def);
|
A JSClassDefinition. |
Returns : |
A SeedClass, described by def .
|
SeedObject seed_make_constructor (SeedContext ctx, SeedClass class, SeedObjectCallAsConstructorCallback constructor);
|
A SeedContext. |
|
A SeedClass to use as the default for constructed objects. |
|
The JSObjectCallAsConstructorCallback function to call when the constructor is invoked with 'new'. |
Returns : |
A SeedObject, which is a constructor function. |