Description[js2c] Fix ordering issue of TextMacro expansion
If a key is a substring of an earlier value, then the earlier value
will unintentionally be clobbered. For example with:
macro SET_PRIVATE(obj, sym, val) = (obj[sym] = val);
SET_PRIVATE(iterator, arrayIteratorObjectSymbol, object);
if the mapping is:
{'val': 'object',
'obj': 'iterator',
'sym': 'arrayIteratorObjectSymbol'}
then 'obj' -> 'iterator' will clobber 'val' -> 'object', resulting in
'val' -> 'iteratorect'. To fix this, replace all substitutions
simultaneously.
Patch from Zoe Clifford <zoeclifford@google.com>
Committed: https://crrev.com/95db63ab6b87415e17eadc5b7caf7efbc3217e76
Cr-Commit-Position: refs/heads/master@{#38665}
Patch Set 1 #
Messages
Total messages: 8 (3 generated)
|