MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxCheckUniquePropertyAux

Function fxCheckUniquePropertyAux

xs/sources/xsSyntaxical.c:4235–4257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4233}
4234
4235void fxCheckUniquePropertyAux(txParser* parser, txNode* baseNode, txNode* currentNode)
4236{
4237 if (currentNode->flags & mxGetterFlag) {
4238 if (baseNode->flags & mxGetterFlag)
4239 fxReportParserError(parser, parser->states[0].line, "getter already defined");
4240 else if (!(baseNode->flags & mxSetterFlag))
4241 fxReportParserError(parser, parser->states[0].line, "property already defined");
4242 }
4243 else if (currentNode->flags & mxSetterFlag) {
4244 if (baseNode->flags & mxSetterFlag)
4245 fxReportParserError(parser, parser->states[0].line, "setter already defined");
4246 else if (!(baseNode->flags & mxGetterFlag))
4247 fxReportParserError(parser, parser->states[0].line, "property already defined");
4248 }
4249 else {
4250 if (baseNode->flags & mxGetterFlag)
4251 fxReportParserError(parser, parser->states[0].line, "getter already defined");
4252 else if (baseNode->flags & mxSetterFlag)
4253 fxReportParserError(parser, parser->states[0].line, "setter already defined");
4254 else if (parser->flags & mxStrictFlag)
4255 fxReportParserError(parser, parser->states[0].line, "property already defined (strict mode)");
4256 }
4257}
4258
4259
4260void fxJSONValue(txParser* parser)

Callers 1

fxCheckUniquePropertyFunction · 0.85

Calls 1

fxReportParserErrorFunction · 0.85

Tested by

no test coverage detected