Added support for 'debugger' as a statement. (Rob made me)
git-svn-id: svn://10.0.0.236/trunk@72996 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
5e5606e05e
commit
4587e4f98f
@ -1727,6 +1727,11 @@ void JS::ExprStmtNode::print(PrettyPrinter &f, bool noSemi) const
|
||||
}
|
||||
}
|
||||
|
||||
void JS::DebuggerStmtNode::print(PrettyPrinter &f, bool) const
|
||||
{
|
||||
f << "debugger;";
|
||||
}
|
||||
|
||||
void JS::BlockStmtNode::print(PrettyPrinter &f, bool) const
|
||||
{
|
||||
PrettyPrinter::Block b(f, 0);
|
||||
@ -3270,6 +3275,10 @@ JS::StmtNode *JS::Parser::parseStatement(bool topLevel, bool inSwitch, Semicolon
|
||||
s = parseTry(pos);
|
||||
break;
|
||||
|
||||
case Token::Debugger:
|
||||
s = new(arena) DebuggerStmtNode(pos, StmtNode::Debugger);
|
||||
break;
|
||||
|
||||
case Token::Final:
|
||||
case Token::Static:
|
||||
case Token::Volatile:
|
||||
|
||||
@ -719,7 +719,8 @@ namespace JavaScript {
|
||||
Interface, // ClassStmtNode <attributes> interface <name> extends <supers> <body>
|
||||
Namespace, // NamespaceStmtNode <attributes> namespace <name> extends <supers>
|
||||
Language, // LanguageStmtNode language <language> ;
|
||||
Package // PackageStmtNode package <packageName> <body>
|
||||
Package, // PackageStmtNode package <packageName> <body>
|
||||
Debugger // ExprStmtNode debugger ;
|
||||
};
|
||||
|
||||
private:
|
||||
@ -748,6 +749,12 @@ namespace JavaScript {
|
||||
void print(PrettyPrinter &f, bool noSemi) const;
|
||||
};
|
||||
|
||||
struct DebuggerStmtNode: StmtNode {
|
||||
DebuggerStmtNode(uint32 pos, Kind kind): StmtNode(pos, kind) {}
|
||||
|
||||
void print(PrettyPrinter &f, bool noSemi) const;
|
||||
};
|
||||
|
||||
struct IdentifierList: ArenaObject {
|
||||
IdentifierList *next; // Next identifier in linked list
|
||||
const StringAtom &name; // The identifier
|
||||
|
||||
@ -1727,6 +1727,11 @@ void JS::ExprStmtNode::print(PrettyPrinter &f, bool noSemi) const
|
||||
}
|
||||
}
|
||||
|
||||
void JS::DebuggerStmtNode::print(PrettyPrinter &f, bool) const
|
||||
{
|
||||
f << "debugger;";
|
||||
}
|
||||
|
||||
void JS::BlockStmtNode::print(PrettyPrinter &f, bool) const
|
||||
{
|
||||
PrettyPrinter::Block b(f, 0);
|
||||
@ -3270,6 +3275,10 @@ JS::StmtNode *JS::Parser::parseStatement(bool topLevel, bool inSwitch, Semicolon
|
||||
s = parseTry(pos);
|
||||
break;
|
||||
|
||||
case Token::Debugger:
|
||||
s = new(arena) DebuggerStmtNode(pos, StmtNode::Debugger);
|
||||
break;
|
||||
|
||||
case Token::Final:
|
||||
case Token::Static:
|
||||
case Token::Volatile:
|
||||
|
||||
@ -719,7 +719,8 @@ namespace JavaScript {
|
||||
Interface, // ClassStmtNode <attributes> interface <name> extends <supers> <body>
|
||||
Namespace, // NamespaceStmtNode <attributes> namespace <name> extends <supers>
|
||||
Language, // LanguageStmtNode language <language> ;
|
||||
Package // PackageStmtNode package <packageName> <body>
|
||||
Package, // PackageStmtNode package <packageName> <body>
|
||||
Debugger // ExprStmtNode debugger ;
|
||||
};
|
||||
|
||||
private:
|
||||
@ -748,6 +749,12 @@ namespace JavaScript {
|
||||
void print(PrettyPrinter &f, bool noSemi) const;
|
||||
};
|
||||
|
||||
struct DebuggerStmtNode: StmtNode {
|
||||
DebuggerStmtNode(uint32 pos, Kind kind): StmtNode(pos, kind) {}
|
||||
|
||||
void print(PrettyPrinter &f, bool noSemi) const;
|
||||
};
|
||||
|
||||
struct IdentifierList: ArenaObject {
|
||||
IdentifierList *next; // Next identifier in linked list
|
||||
const StringAtom &name; // The identifier
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user