Only convert boolean true/false to !0/!1
authorOri Livneh <ori@wikimedia.org>
Sat, 15 Aug 2015 01:00:30 +0000 (18:00 -0700)
committerOri Livneh <ori@wikimedia.org>
Sat, 15 Aug 2015 21:13:59 +0000 (14:13 -0700)
commit3ecec5434edd01da865a7b66c9729a44fc861133
treedc73247108a13256fd309544a58e390c3b395d5c
parent5810fc651531fc587f2131f3160f50cc2defa070
Only convert boolean true/false to !0/!1

Fix-up for I5ab29b686b8. If we encounter stupid code like
`a.true = 1;` or `a = { true: 1 }`, we should not convert that to !0/!1.
Because JSMin barfs on such input, it is necessary to add another parameter to
the test method which specifies whether or not the minified JavaScript is
supposed to be valid JavaScript by the standards of JSMin.

Change-Id: Ib78c628147fdb95982d6e33e0ab298584fb63d0b
includes/libs/JavaScriptMinifier.php
tests/phpunit/includes/libs/JavaScriptMinifierTest.php