| 6324 | |
| 6325 | |
| 6326 | ResultType Script::DefineClassPropertyXet(LPTSTR aBuf, LPTSTR aEnd) |
| 6327 | { |
| 6328 | // For simplicity, pass the property definition to DefineFunc instead of the actual |
| 6329 | // line text, even though it makes some error messages a bit inaccurate. (That would |
| 6330 | // happen anyway when DefineFunc() finds a syntax error in the parameter list.) |
| 6331 | if (!DefineFunc(mClassPropertyDef, mClassPropertyStatic)) |
| 6332 | return FAIL; |
| 6333 | if (mClassProperty->MinParams == -1) |
| 6334 | { |
| 6335 | int hidden_params = ctoupper(*aBuf) == 'S' ? 2 : 1; |
| 6336 | mClassProperty->MinParams = g->CurrentFunc->mMinParams - hidden_params; |
| 6337 | mClassProperty->MaxParams = g->CurrentFunc->mIsVariadic ? INT_MAX : g->CurrentFunc->mParamCount - hidden_params; |
| 6338 | } |
| 6339 | if (*aEnd && !AddLine(ACT_BLOCK_BEGIN)) // *aEnd is '{' or '='. |
| 6340 | return FAIL; |
| 6341 | if (*aEnd == '=') // => expr |
| 6342 | { |
| 6343 | aEnd = omit_leading_whitespace(aEnd + 2); |
| 6344 | if (!ParseAndAddLine(aEnd, ACT_RETURN) |
| 6345 | || !AddLine(ACT_BLOCK_END)) |
| 6346 | return FAIL; |
| 6347 | } |
| 6348 | return OK; |
| 6349 | } |
| 6350 | |
| 6351 | |
| 6352 | ResultType Script::DefineClassVars(LPTSTR aBuf, bool aStatic) |
nothing calls this directly
no test coverage detected