{
isStatic = attrs.hasStatic;
hasUserNamespace = attrs.hasUserNamespace();
}
Slot s = vb.ref.getSlot(cx);
if (s != null)
{
isConst = s.isConst();
}
if (vb.initializer != null)
{
if (vb.initializer instanceof LiteralNumberNode)
{
defaultValue = ((LiteralNumberNode)(vb.initializer)).value;
}
else if (vb.initializer instanceof LiteralStringNode)
{
defaultValue = DocCommentNode.escapeXml(((LiteralStringNode)(vb.initializer)).value);
}
else if (vb.initializer instanceof LiteralNullNode)
{
defaultValue = "null";
}
else if (vb.initializer instanceof LiteralBooleanNode)
{
defaultValue = (((LiteralBooleanNode)(vb.initializer)).value) ? "true" : "false";
}
else if (vb.initializer instanceof MemberExpressionNode)
{
MemberExpressionNode mb = (MemberExpressionNode)(vb.initializer);
Slot vs = null;
if (mb.ref != null && mb.selector.isGetExpression())
{
vs = (mb.ref != null ? mb.ref.getSlot(cx, Tokens.GET_TOKEN) : null);
}
else
{
vs = vb.ref.getSlot(cx, Tokens.GET_TOKEN);
}
Value v = (vs != null ? vs.getValue() : null);
ObjectValue ov = ((v instanceof ObjectValue) ? (ObjectValue)(v) : null);
// if constant evaluator has determined this has a value, use it.
defaultValue = (ov != null) ? ov.getValue() : "unknown";
}
else
{
Slot vs = vb.ref.getSlot(cx, Tokens.GET_TOKEN);
Value v = (vs != null ? vs.getValue() : null);
ObjectValue ov = ((v instanceof ObjectValue) ? (ObjectValue)(v) : null);
// if constant evaluator has determined this has a value, use it.
defaultValue = (ov != null) ? ov.getValue() : "unknown";
}
}