fn has_compiled_source(
    &self,
    file_fetcher: &SourceFileFetcher,
    url: &Url,
  ) -> bool {
    let specifier = ModuleSpecifier::from(url.clone());
    if let Some(source_file) = file_fetcher
      .fetch_cached_source_file(&specifier, Permissions::allow_all())
    {
      if let Some(metadata) = self.get_metadata(&url) {
        // 2. compare version hashes
        // TODO: it would probably be good idea to make it method implemented on SourceFile
        let version_hash_to_validate = source_code_version_hash(
          &source_file.source_code,
          version::DENO,
          &self.config.hash,
        );

        if metadata.version_hash == version_hash_to_validate {
          return true;
        }
      }
    }

    false
  }
/// Check if there is compiled source in cache that is valid
/// and can be used again.
// TODO(bartlomieju): there should be check that cached file actually exists
Check if there is compiled source in cache that is valid
and can be used again.
TODO(bartlomieju): there should be check that cached file actually exists
Check if there is compiled source in cache that is valid and can be used again . TODO ( bartlomieju ) : there should be check that cached file actually exists
fn has_compiled_source(
    &self,
    file_fetcher: &SourceFileFetcher,
    url: &Url,
  ) -> bool {
    let specifier = ModuleSpecifier::from(url.clone());
    if let Some(source_file) = file_fetcher
      .fetch_cached_source_file(&specifier, Permissions::allow_all())
    {
      if let Some(metadata) = self.get_metadata(&url) {
        // 2. compare version hashes
        // TODO: it would probably be good idea to make it method implemented on SourceFile
        let version_hash_to_validate = source_code_version_hash(
          &source_file.source_code,
          version::DENO,
          &self.config.hash,
        );
        if metadata.version_hash == version_hash_to_validate {
          return true;
        }
      }
    }
    false
  }
fn has_compiled_source ( & self , file_fetcher : & SourceFileFetcher , url : & Url , ) -> bool { let specifier = ModuleSpecifier :: from ( url . clone ( ) ) ; if let Some ( source_file ) = file_fetcher . fetch_cached_source_file ( & specifier , Permissions :: allow_all ( ) ) { if let Some ( metadata ) = self . get_metadata ( & url ) { // 2. compare version hashes // TODO: it would probably be good idea to make it method implemented on SourceFile let version_hash_to_validate = source_code_version_hash ( & source_file . source_code , version :: DENO , & self . config . hash , ) ; if metadata . version_hash == version_hash_to_validate { return true ; } } } false }
Check if there is compiled source in cache that is valid
and can be used again.
Check if there is compiled source in cache that is valid and can be used again .
&self
file_fetcher
&SourceFileFetcher
url
&Url
&self
file_fetcher
&SourceFileFetcher
url
&Url