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

Function _AddConditionalProperty

tools/gyp/pylib/gyp/generator/msvs.py:3234–3251  ·  view source on GitHub ↗

Adds a property / conditional value pair to a dictionary. Arguments: properties: The dictionary to be modified. The key is the name of the property. The value is itself a dictionary; its key is the value and the value a list of condition for which this value is true.

(properties, condition, name, value)

Source from the content-addressed store, hash-verified

3232
3233
3234def _AddConditionalProperty(properties, condition, name, value):
3235 """Adds a property / conditional value pair to a dictionary.
3236
3237 Arguments:
3238 properties: The dictionary to be modified. The key is the name of the
3239 property. The value is itself a dictionary; its key is the value and
3240 the value a list of condition for which this value is true.
3241 condition: The condition under which the named property has the value.
3242 name: The name of the property.
3243 value: The value of the property.
3244 """
3245 if name not in properties:
3246 properties[name] = {}
3247 values = properties[name]
3248 if value not in values:
3249 values[value] = []
3250 conditions = values[value]
3251 conditions.append(condition)
3252
3253
3254# Regex for msvs variable references ( i.e. $(FOO) ).

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected