Recent ECMA grammar changes: deleted the x.class operator and prohibited super from being a direct operand of the delete operator.

This commit is contained in:
waldemar%netscape.com 2001-12-01 03:31:46 +00:00
parent 7a644b1692
commit 76bb17b62b
5 changed files with 6 additions and 31 deletions

View File

@ -355,7 +355,6 @@ ByteCodeData gByteCodeData[OpCodeCount] = {
{ 0, "PushScope", },
{ 0, "PopScope", },
{ 0, "NewClosure" },
{ 0, "Class" },
{ -1, "Juxtapose" },
{ -1, "NamedArgument" },
@ -2326,14 +2325,6 @@ BinaryOpEquals:
return currentClass;
}
break;
case ExprNode::dotClass:
{
UnaryExprNode *u = checked_cast<UnaryExprNode *>(p);
JSType *uType = genExpr(u->op);
addByte(ClassOp);
return uType;
}
break;
case ExprNode::juxtapose:
{
BinaryExprNode *j = checked_cast<BinaryExprNode *>(p);
@ -2408,7 +2399,6 @@ uint32 printInstruction(Formatter &f, uint32 i, const ByteCodeModule& bcm)
case VoidPopOp:
case LoadGlobalObjectOp:
case NewClosureOp:
case ClassOp:
case JuxtaposeOp:
case NamedArgOp:
break;

View File

@ -153,7 +153,6 @@ typedef enum {
PushScopeOp, // <pointer> XXX !!! XXX
PopScopeOp, // <pointer> XXX !!! XXX
NewClosureOp, // <function> --> <function>
ClassOp, // <object> --> <type>
JuxtaposeOp, // <attribute> <attribute> --> <attribute>
NamedArgOp, // <object> <string> --> <named arg object>

View File

@ -1582,13 +1582,6 @@ JSValue Context::interpret(uint8 *pc, uint8 *endPC)
throw Exception(Exception::userException, "");
}
break;
case ClassOp:
{
JSValue x = popValue();
ASSERT(x.isObject());
pushValue(JSValue(x.getType()));
}
break;
case JuxtaposeOp:
{
JSValue v2 = popValue();

View File

@ -444,10 +444,6 @@ JS::ExprNode *JS::Parser::parseMember(ExprNode *target, const Token &tOperator,
{
size_t pos = tOperator.getPos();
const Token &t2 = lexer.get(true);
if (t2.hasKind(Token::Class) && !target->hasKind(ExprNode::superExpr))
return new(arena) UnaryExprNode(pos, ExprNode::dotClass, target);
ExprNode *member;
ExprNode::Kind kind = ExprNode::dot;
if (t2.hasKind(Token::openParenthesis) && !target->hasKind(ExprNode::superExpr)) {
@ -604,17 +600,20 @@ JS::ExprNode *JS::Parser::parseUnaryExpression(SuperState superState)
switch (t.getKind()) {
case Token::Delete:
eKind = ExprNode::Delete;
superState = ssNone;
goto getPostfixExpression;
case Token::increment:
eKind = ExprNode::preIncrement;
goto getPostfixExpression;
goto getPostfixExpressionSuper;
case Token::decrement:
eKind = ExprNode::preDecrement;
getPostfixExpressionSuper:
superState = ssExpr;
getPostfixExpression:
lexer.skip();
e = parsePostfixExpression(ssExpr, false);
e = parsePostfixExpression(superState, false);
break;
case Token::Void:
@ -971,10 +970,6 @@ bool JS::Parser::expressionIsAttribute(const ExprNode *e)
e = checked_cast<const BinaryExprNode *>(e)->op1;
break;
case ExprNode::dotClass:
e = checked_cast<const UnaryExprNode *>(e)->op;
break;
default:
return false;
}
@ -2121,7 +2116,6 @@ const char *const JS::ExprNode::kindNames[kindsEnd] = {
0, // index
".", // dot
".class", // dotClass
".(", // dotParen
0, // superExpr
@ -2331,7 +2325,7 @@ void JS::UnaryExprNode::print(PrettyPrinter &f) const
if (debugExprNodePrint)
f << '(';
const char *name = kindName(getKind());
if (hasKind(postIncrement) || hasKind(postDecrement) || hasKind(dotClass))
if (hasKind(postIncrement) || hasKind(postDecrement))
f << op << name;
else {
f << name;

View File

@ -163,7 +163,6 @@ namespace JavaScript {
index, // InvokeExprNode <op>[<field>:<value>, <field>:<value>, ..., <field>:<value>]
dot, // BinaryExprNode <op1> . <op2> (<op2> must be identifier or qualify)
dotClass, // UnaryExprNode <op1> .class
dotParen, // BinaryExprNode <op1> .( <op2> )
// End of isPostfix()