This commit is contained in:
rogerl%netscape.com 2002-08-06 17:34:32 +00:00
Родитель 178cd7c22b
Коммит 56f02f49f3
2 изменённых файлов: 41 добавлений и 4 удалений

Просмотреть файл

@ -119,6 +119,17 @@ namespace MetaData {
defineHoistedVar(env, *v->name, p);
}
else {
CompoundAttribute *a = Attribute::toCompoundAttribute(attr);
if (a->dynamic || a->prototype)
reportError(Exception::definitionError, "Illegal attribute", p->pos);
MemberModifier memberMod = a->memberMod;
if ((env->getTopFrame()->kind == Frame::Class)
&& (memberMod == Attribute::NoModifier))
memberMod == Attribute::Final;
switch (memberMod) {
case Attribute::NoModifier:
case Attribute::Static:
}
}
v = v->next;
@ -402,6 +413,26 @@ namespace MetaData {
{
}
CompoundAttribute *Attribute::toCompoundAttribute(Attribute *a)
{
if (a)
return a->toCompoundAttribute();
else
return new CompoundAttribute();
}
CompoundAttribute *Namespace::toCompoundAttribute()
{
CompoundAttribute *t = new CompoundAttribute();
t->addNamespace(this);
return t;
}
CompoundAttribute *TrueAttribute::toCompoundAttribute()
{
return new CompoundAttribute();
}
/************************************************************************************

Просмотреть файл

@ -53,7 +53,8 @@ class JS2Metadata;
class JS2Class;
class StaticBinding;
class Environment;
class Context;
class Context;
class CompoundAttribute;
typedef jsval js2val;
typedef void (Invokable)();
@ -82,10 +83,10 @@ public:
Attribute(AttributeKind kind) : kind(kind) { }
static Attribute *combineAttributes(Attribute *a, Attribute *b);
static CompoundAttribute *toCompoundAttribute(Attribute *a);
virtual CompoundAttribute *toCompoundAttribute() { ASSERT(false); return NULL; }
#ifdef DEBUG
virtual void uselessVirtual() { } // want the checked_cast stuff to work, so need a virtual function
#endif
};
// A Namespace (is also an attribute)
@ -93,6 +94,8 @@ class Namespace : public Attribute {
public:
Namespace(StringAtom &name) : Attribute(NamespaceKind), name(name) { }
virtual CompoundAttribute *toCompoundAttribute();
StringAtom &name; // The namespace's name used by toString
};
@ -482,6 +485,7 @@ public:
class TrueAttribute : public Attribute {
public:
TrueAttribute() : Attribute(TrueKind) { }
virtual CompoundAttribute *toCompoundAttribute();
};
// The 'false' attribute
@ -497,6 +501,8 @@ public:
CompoundAttribute();
void addNamespace(Namespace *n);
virtual CompoundAttribute *toCompoundAttribute() { return this; }
NamespaceList *namespaces; // The set of namespaces contained in this attribute
bool xplicit; // true if the explicit attribute has been given
bool dynamic; // true if the dynamic attribute has been given