зеркало из https://github.com/mozilla/gecko-dev.git
Adding more static defn.
This commit is contained in:
Родитель
178cd7c22b
Коммит
56f02f49f3
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/************************************************************************************
|
||||
|
|
|
@ -54,6 +54,7 @@ class JS2Class;
|
|||
class StaticBinding;
|
||||
class Environment;
|
||||
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче