parameters: (self, path)
docstring: Find the closest v8 root to `path`.
docstring_summary: Find the closest v8 root to `path`.
docstring_tokens: Find the closest v8 root to path .
function: def _find_work_dir(self, path):
      """Find the closest v8 root to `path`."""
      if os.path.exists(os.path.join(path, 'tools', 'dev', 'v8gen.py')):
        # Approximate the v8 root dir by a folder where this script exists
        # in the expected place.
        return path
      elif os.path.dirname(path) == path:
        raise Exception(
            'This appears to not be called from a recent v8 checkout')
      else:
        return self._find_work_dir(os.path.dirname(path))
function_tokens: def _find_work_dir ( self , path ) : if os . path . exists ( os . path . join ( path , 'tools' , 'dev' , 'v8gen.py' ) ) : # Approximate the v8 root dir by a folder where this script exists # in the expected place. return path elif os . path . dirname ( path ) == path : raise Exception ( 'This appears to not be called from a recent v8 checkout' ) else : return self . _find_work_dir ( os . path . dirname ( path ) )