PH7_VmThrowError() always breaks script execution on PH7_CTX_ERR.
All checks were successful
The build was successful.
All checks were successful
The build was successful.
Thus code placed below will never get executed and is completely useless.
This commit is contained in:
parent
deda6b4b15
commit
9b1ad67580
23
engine/oop.c
23
engine/oop.c
@ -255,10 +255,7 @@ PH7_PRIVATE sxi32 PH7_ClassInherit(ph7_vm *pVm, ph7_class *pSub, ph7_class *pBas
|
||||
if((pEntry = SyHashGet(&pSub->hAttr, (const void *)pName->zString, pName->nByte)) != 0) {
|
||||
if(pAttr->iProtection == PH7_CLASS_PROT_PRIVATE && ((ph7_class_attr *)pEntry->pUserData)->iProtection != PH7_CLASS_PROT_PUBLIC) {
|
||||
/* Cannot redeclare private attribute */
|
||||
rc = PH7_VmThrowError(pVm, PH7_CTX_ERR, "Private attribute '%z::%z' redeclared inside child class '%z'", &pBase->sName, pName, &pSub->sName);
|
||||
if(rc == SXERR_ABORT) {
|
||||
return SXERR_ABORT;
|
||||
}
|
||||
PH7_VmThrowError(pVm, PH7_CTX_ERR, "Private attribute '%z::%z' redeclared inside child class '%z'", &pBase->sName, pName, &pSub->sName);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@ -278,20 +275,13 @@ PH7_PRIVATE sxi32 PH7_ClassInherit(ph7_vm *pVm, ph7_class *pSub, ph7_class *pBas
|
||||
if((pEntry = SyHashGet(&pSub->hMethod, (const void *)pName->zString, pName->nByte)) != 0) {
|
||||
if(pMeth->iFlags & PH7_CLASS_ATTR_FINAL) {
|
||||
/* Cannot Overwrite final method */
|
||||
rc = PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Cannot overwrite final method '%z:%z()' inside child class '%z'", &pBase->sName, pName, &pSub->sName);
|
||||
if(rc == SXERR_ABORT) {
|
||||
return SXERR_ABORT;
|
||||
}
|
||||
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Cannot overwrite final method '%z:%z()' inside child class '%z'", &pBase->sName, pName, &pSub->sName);
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
if(pMeth->iFlags & PH7_CLASS_ATTR_VIRTUAL) {
|
||||
/* Virtual method must be defined in the child class */
|
||||
rc = PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Virtual method '%z:%z()' must be defined inside child class '%z'", &pBase->sName, pName, &pSub->sName);
|
||||
if(rc == SXERR_ABORT) {
|
||||
return SXERR_ABORT;
|
||||
}
|
||||
continue;
|
||||
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Virtual method '%z:%z()' must be defined inside child class '%z'", &pBase->sName, pName, &pSub->sName);
|
||||
}
|
||||
}
|
||||
/* Install the method */
|
||||
@ -404,11 +394,7 @@ PH7_PRIVATE sxi32 PH7_ClassImplement(ph7_vm *pVm, ph7_class *pMain, ph7_class *p
|
||||
if((pEntry = SyHashGet(&pMain->hMethod, (const void *)pName->zString, pName->nByte)) != 0) {
|
||||
continue;
|
||||
} else {
|
||||
rc = PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Method '%z:%z()' must be defined inside class '%z'", &pInterface->sName, pName, &pMain->sName);
|
||||
if(rc == SXERR_ABORT) {
|
||||
return SXERR_ABORT;
|
||||
}
|
||||
continue;
|
||||
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Method '%z:%z()' must be defined inside class '%z'", &pInterface->sName, pName, &pMain->sName);
|
||||
}
|
||||
}
|
||||
/* Install in the interface container */
|
||||
@ -813,7 +799,6 @@ PH7_PRIVATE sxi32 PH7_ClassInstanceCmp(ph7_class_instance *pLeft, ph7_class_inst
|
||||
if(iNest > 31) {
|
||||
/* Nesting limit reached */
|
||||
PH7_VmThrowError(pLeft->pVm, PH7_CTX_ERR, "Nesting limit reached, probably infinite recursion");
|
||||
return 1;
|
||||
}
|
||||
/* Comparison is performed only if the objects are instance of the same class */
|
||||
if(pLeft->pClass != pRight->pClass) {
|
||||
|
Loading…
Reference in New Issue
Block a user