ES6 Style: Add presubmit prompt to avoid const/let in potential iOS9 code.
This is in preparation of moving const/let to the "allowed" features in the
ES6 styleguide.
Bug: 671426
Change-Id: I45285d49885470cfe29aaddfe9e9ff6c2ce953a2
Reviewed-on: https://chromium-review.googlesource.com/578731
Reviewed-by: Dirk Pranke <[email protected]>
Reviewed-by: Michael Giuffrida <[email protected]>
Commit-Queue: Demetrios Papadopoulos <[email protected]>
Cr-Commit-Position: refs/heads/master@{#488560}
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
index eac824b..0c4c102c 100755
--- a/PRESUBMIT_test.py
+++ b/PRESUBMIT_test.py
@@ -1084,6 +1084,18 @@
mock_input_api, MockOutputApi())
self.assertEqual(0, len(warnings))
+ def testConstLetWarningIos9Code(self):
+ mock_input_api = MockInputApi()
+ mock_output_api = MockOutputApi()
+
+ mock_input_api.files = [
+ MockAffectedFile('components/blah.js', [" const foo = 'bar';"]),
+ MockAffectedFile('ui/webui/resources/blah.js', [" let foo = 3;"]),
+ ]
+ warnings = PRESUBMIT._CheckForRiskyJsFeatures(
+ mock_input_api, mock_output_api)
+ self.assertEqual(2, len(warnings))
+
class RelativeIncludesTest(unittest.TestCase):
def testThirdPartyNotWebKitIgnored(self):
mock_input_api = MockInputApi()