| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6475,6 +6475,19 @@ def CheckItemIndentationInNamespace(filename, raw_lines_no_comments, linenum, | |||
| 6475 | 6475 | error(filename, linenum, 'runtime/indentation_namespace', 4, | |
| 6476 | 6476 | 'Do not indent within a namespace') | |
| 6477 | 6477 | ||
| 6478 | + def CheckLocalVectorUsage(filename, lines, error): | ||
| 6479 | + """Logs an error if std::vector<v8::Local<T>> is used. | ||
| 6480 | + Args: | ||
| 6481 | + filename: The name of the current file. | ||
| 6482 | + lines: An array of strings, each representing a line of the file. | ||
| 6483 | + error: The function to call with any errors found. | ||
| 6484 | + """ | ||
| 6485 | + for linenum, line in enumerate(lines): | ||
| 6486 | + if (Search(r'\bstd::vector<v8::Local<[^>]+>>', line) or | ||
| 6487 | + Search(r'\bstd::vector<Local<[^>]+>>', line)): | ||
| 6488 | + error(filename, linenum, 'runtime/local_vector', 5, | ||
| 6489 | + 'Do not use std::vector<v8::Local<T>>. ' | ||
| 6490 | + 'Use v8::LocalVector<T> instead.') | ||
| 6478 | 6491 | ||
| 6479 | 6492 | def ProcessLine(filename, file_extension, clean_lines, line, | |
| 6480 | 6493 | include_state, function_state, nesting_state, error, | |
@@ -6645,6 +6658,8 @@ def ProcessFileData(filename, file_extension, lines, error, | |||
| 6645 | 6658 | ||
| 6646 | 6659 | CheckInlineHeader(filename, include_state, error) | |
| 6647 | 6660 | ||
| 6661 | + CheckLocalVectorUsage(filename, lines, error) | ||
| 6662 | + | ||
| 6648 | 6663 | def ProcessConfigOverrides(filename): | |
| 6649 | 6664 | """ Loads the configuration files and processes the config overrides. | |
| 6650 | 6665 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments