Skip to content

Commit

Permalink
Replace invalid variable characters for import name
Browse files Browse the repository at this point in the history
  • Loading branch information
JingLi1998 committed Jun 1, 2023
1 parent 123dd0a commit c4745f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/crates/relay-codegen/src/build_ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1860,12 +1860,14 @@ impl<'schema, 'builder, 'config> CodegenBuilder<'schema, 'builder, 'config> {
provider.module_path().to_str().unwrap().intern(),
)
};

let variable_name = ("__relay_internal__pv__".to_owned() + &provider.original_variable_name.to_string()).intern();

Some(ObjectEntry {
key: def.name.item.0,
value: Primitive::JSModuleDependency(JSModuleDependency {
path: provider_module,
import_name: ModuleImportName::Default(provider.module_name),
import_name: ModuleImportName::Default(variable_name),
}),
})
})
Expand Down

0 comments on commit c4745f5

Please sign in to comment.