bug 890900, multiple %1$S in printf are OK, r=stas
This corresponds to
bug 438688 and a GTEST like
// Double referencing existing argument works
out.Adopt(nsTextFormatter::smprintf(u"%1$S %1$S", u"1"));
EXPECT_STREQ("1 1", NS_ConvertUTF16toUTF8(out).get());
from
bug 1388789.
I'd test this if I had corresponding tests on the gecko impl,
but those are hard to get to.
MozReview-Commit-ID: 29VZFFJYkFj
--- a/compare_locales/checks.py
+++ b/compare_locales/checks.py
@@ -167,20 +167,16 @@ class PropertiesChecker(Checker):
pos = int(m.group('number')) - 1
ls = len(specs)
if pos >= ls:
# pad specs
nones = pos - ls
specs[ls:pos] = nones*[None]
specs.append(m.group('spec'))
else:
- if specs[pos] is not None:
- raise PrintfException('Double ordered argument %d' %
- (pos+1),
- m.start())
specs[pos] = m.group('spec')
else:
specs.append(m.group('spec'))
# check for missing args
if hasNumber and not all(specs):
raise PrintfException('Ordered argument missing', 0)
return specs