Super constructor call sequence and super statement.

git-svn-id: svn://10.0.0.236/trunk@142187 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rogerl%netscape.com
2003-05-07 22:59:25 +00:00
parent 52ecce675e
commit ba3c57bef0
6 changed files with 103 additions and 11 deletions

View File

@@ -177,6 +177,21 @@
}
break;
case eSuperCall:
{
uint16 argCount = BytecodeContainer::getShort(pc);
pc += sizeof(uint16);
ParameterFrame *pFrame = meta->env->getEnclosingParameterFrame();
ASSERT(pFrame && (pFrame->isConstructor));
if (pFrame->superConstructorCalled)
meta->reportError(Exception::referenceError, "The superconstructor cannot be called twice", errorPos());
JS2Class *c = meta->env->getEnclosingClass();
ASSERT(c);
ASSERT(!JS2VAL_IS_VOID(pFrame->thisObject));
meta->invokeInit(c->super, pFrame->thisObject, base(argCount), argCount);
}
break;
case ePopv:
{
retval = pop();