use machine-generated PartialEq instance for hashing Constant (#817)

This commit is contained in:
Mark Thom
2021-02-11 18:40:07 -07:00
parent 2429971bcd
commit e7cf5d4f3d
5 changed files with 38 additions and 24 deletions

View File

@@ -174,7 +174,7 @@ pub(super) fn setup_module_export_list(
export_list = *t2;
}
if export_list.into_constant() != Some(Constant::EmptyList) {
if export_list.into_constant().map(|c| !constant_eq(&c, &Constant::EmptyList)).unwrap_or(true) {
Err(CompilationError::InvalidModuleDecl)
} else {
Ok(exports)
@@ -273,7 +273,7 @@ fn setup_qualified_import(
export_list = *t2;
}
if export_list.into_constant() != Some(Constant::EmptyList) {
if export_list.into_constant().map(|c| !constant_eq(&c, &Constant::EmptyList)).unwrap_or(true) {
Err(CompilationError::InvalidModuleDecl)
} else {
Ok((module_src, exports))