Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: tools/presubmit.py

Issue 43923002: Reland "Make Array.prototype.pop throw if the last element is not configurable." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/regress/regress-array-pop-nonconfigurable.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2012 the V8 project authors. All rights reserved. 3 # Copyright 2012 the V8 project authors. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 276
277 COPYRIGHT_HEADER_PATTERN = re.compile( 277 COPYRIGHT_HEADER_PATTERN = re.compile(
278 r'Copyright [\d-]*20[0-1][0-9] the V8 project authors. All rights reserved.' ) 278 r'Copyright [\d-]*20[0-1][0-9] the V8 project authors. All rights reserved.' )
279 279
280 class SourceProcessor(SourceFileProcessor): 280 class SourceProcessor(SourceFileProcessor):
281 """ 281 """
282 Check that all files include a copyright notice and no trailing whitespaces. 282 Check that all files include a copyright notice and no trailing whitespaces.
283 """ 283 """
284 284
285 RELEVANT_EXTENSIONS = ['.js', '.cc', '.h', '.py', '.c', 'SConscript', 285 RELEVANT_EXTENSIONS = ['.js', '.cc', '.h', '.py', '.c',
286 'SConstruct', '.status', '.gyp', '.gypi'] 286 '.status', '.gyp', '.gypi']
287 287
288 # Overwriting the one in the parent class. 288 # Overwriting the one in the parent class.
289 def FindFilesIn(self, path): 289 def FindFilesIn(self, path):
290 if os.path.exists(path+'/.git'): 290 if os.path.exists(path+'/.git'):
291 output = subprocess.Popen('git ls-files --full-name', 291 output = subprocess.Popen('git ls-files --full-name',
292 stdout=PIPE, cwd=path, shell=True) 292 stdout=PIPE, cwd=path, shell=True)
293 result = [] 293 result = []
294 for file in output.stdout.read().split(): 294 for file in output.stdout.read().split():
295 for dir_part in os.path.dirname(file).split(os.sep): 295 for dir_part in os.path.dirname(file).replace(os.sep, '/').split('/'):
296 if self.IgnoreDir(dir_part): 296 if self.IgnoreDir(dir_part):
297 break 297 break
298 else: 298 else:
299 if self.IsRelevant(file) and not self.IgnoreFile(file): 299 if self.IsRelevant(file) and not self.IgnoreFile(file):
300 result.append(join(path, file)) 300 result.append(join(path, file))
301 if output.wait() == 0: 301 if output.wait() == 0:
302 return result 302 return result
303 return super(SourceProcessor, self).FindFilesIn(path) 303 return super(SourceProcessor, self).FindFilesIn(path)
304 304
305 def IsRelevant(self, name): 305 def IsRelevant(self, name):
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 "two empty lines between declarations check..." 426 "two empty lines between declarations check..."
427 success = SourceProcessor().Run(workspace) and success 427 success = SourceProcessor().Run(workspace) and success
428 if success: 428 if success:
429 return 0 429 return 0
430 else: 430 else:
431 return 1 431 return 1
432 432
433 433
434 if __name__ == '__main__': 434 if __name__ == '__main__':
435 sys.exit(Main()) 435 sys.exit(Main())
OLDNEW
« no previous file with comments | « test/mjsunit/regress/regress-array-pop-nonconfigurable.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698