зеркало из https://github.com/mozilla/pjs.git
JSClass support.
This commit is contained in:
Родитель
d193ec4ea0
Коммит
0d1c72d6a6
|
@ -35,6 +35,7 @@
|
||||||
#include "world.h"
|
#include "world.h"
|
||||||
#include "vmtypes.h"
|
#include "vmtypes.h"
|
||||||
#include "jstypes.h"
|
#include "jstypes.h"
|
||||||
|
#include "jsclasses.h"
|
||||||
#include "icodegenerator.h"
|
#include "icodegenerator.h"
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
@ -1195,6 +1196,17 @@ void ICodeGenerator::preprocess(StmtNode *p)
|
||||||
genStmt(t->finally);
|
genStmt(t->finally);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case StmtNode::Class:
|
||||||
|
{
|
||||||
|
ClassStmtNode *classStmt = static_cast<ClassStmtNode *>(p);
|
||||||
|
ASSERT(classStmt->name->getKind() == ExprNode::identifier);
|
||||||
|
IdentifierExprNode* nameExpr = static_cast<IdentifierExprNode*>(classStmt->name);
|
||||||
|
using JSClasses::JSClass;
|
||||||
|
JSClass* jsclass = new JSClass(nameExpr->name);
|
||||||
|
// put this class into the current defining scope, and as a side-effect(?) make it
|
||||||
|
// the current defining scope, for later compilation into?
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include "world.h"
|
#include "world.h"
|
||||||
#include "vmtypes.h"
|
#include "vmtypes.h"
|
||||||
#include "jstypes.h"
|
#include "jstypes.h"
|
||||||
|
#include "jsclasses.h"
|
||||||
#include "icodegenerator.h"
|
#include "icodegenerator.h"
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
@ -1195,6 +1196,17 @@ void ICodeGenerator::preprocess(StmtNode *p)
|
||||||
genStmt(t->finally);
|
genStmt(t->finally);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case StmtNode::Class:
|
||||||
|
{
|
||||||
|
ClassStmtNode *classStmt = static_cast<ClassStmtNode *>(p);
|
||||||
|
ASSERT(classStmt->name->getKind() == ExprNode::identifier);
|
||||||
|
IdentifierExprNode* nameExpr = static_cast<IdentifierExprNode*>(classStmt->name);
|
||||||
|
using JSClasses::JSClass;
|
||||||
|
JSClass* jsclass = new JSClass(nameExpr->name);
|
||||||
|
// put this class into the current defining scope, and as a side-effect(?) make it
|
||||||
|
// the current defining scope, for later compilation into?
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче