MCPcopy Create free account
hub / github.com/nodejs/node / _EvalExpression

Function _EvalExpression

deps/v8/tools/testrunner/local/statusfile.py:162–173  ·  view source on GitHub ↗

Evaluates expression and returns its result. In case of NameError caused by undefined "variant" identifier returns VARIANT_EXPRESSION marker.

(exp, variables)

Source from the content-addressed store, hash-verified

160VARIANT_EXPRESSION = object()
161
162def _EvalExpression(exp, variables):
163 """Evaluates expression and returns its result. In case of NameError caused by
164 undefined "variant" identifier returns VARIANT_EXPRESSION marker.
165 """
166
167 try:
168 return eval(exp, variables)
169 except NameError as e:
170 identifier = re.match("name '(.*)' is not defined", str(e)).group(1)
171 # If it's not a variant expression, it points to a missing build flag.
172 assert identifier == "variant", INITIALIZATION_ERROR % identifier
173 return VARIANT_EXPRESSION
174
175
176def _EvalVariantExpression(

Callers 3

_EvalVariantExpressionFunction · 0.85
_ParseOutcomeListFunction · 0.85
ReadStatusFileFunction · 0.85

Calls 3

strFunction · 0.85
matchMethod · 0.65
evalFunction · 0.50

Tested by

no test coverage detected