@@ -6489,6 +6489,23 @@ def CheckLocalVectorUsage(filename, lines, error):
64896489 'Do not use std::vector<v8::Local<T>>. '
64906490 'Use v8::LocalVector<T> instead.' )
64916491
6492+ def CheckStringValueUsage (filename , lines , error ):
6493+ """Logs an error if v8's String::Value/Utf8Value are used.
6494+ Args:
6495+ filename: The name of the current file.
6496+ lines: An array of strings, each representing a line of the file.
6497+ error: The function to call with any errors found.
6498+ """
6499+ for linenum , line in enumerate (lines ):
6500+ if Search (r'\bString::Utf8Value\b' , line ):
6501+ error (filename , linenum , 'runtime/v8_string_value' , 5 ,
6502+ 'Do not use v8::String::Utf8Value. '
6503+ 'Use node::Utf8Value instead.' )
6504+ if Search (r'\bString::Value\b' , line ):
6505+ error (filename , linenum , 'runtime/v8_string_value' , 5 ,
6506+ 'Do not use v8::String::Value. '
6507+ 'Use node::TwoByteValue instead.' )
6508+
64926509def ProcessLine (filename , file_extension , clean_lines , line ,
64936510 include_state , function_state , nesting_state , error ,
64946511 extra_check_functions = None ):
@@ -6660,6 +6677,8 @@ def ProcessFileData(filename, file_extension, lines, error,
66606677
66616678 CheckLocalVectorUsage (filename , lines , error )
66626679
6680+ CheckStringValueUsage (filename , lines , error )
6681+
66636682def ProcessConfigOverrides (filename ):
66646683 """ Loads the configuration files and processes the config overrides.
66656684
0 commit comments