Skip to content

Commit

Permalink
Use default export
Browse files Browse the repository at this point in the history
  • Loading branch information
arduano committed Mar 30, 2024
1 parent 382b84a commit 71e272e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/eval/emit_js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub fn emit_module(nix_expr: &str) -> Result<String, String> {
let root = rnix::Root::parse(nix_expr).tree();
let root_expr = root.expr().expect("Not implemented");
let mut out_src = String::new();
out_src += "export const __nixValue = (ctx) => ";
out_src += "export default (ctx) => ";
emit_expr(&root_expr, &mut out_src)?;
out_src += ";\n";
Ok(out_src)
Expand Down
2 changes: 1 addition & 1 deletion src/eval/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn eval_nix_fn_from_string<'s>(

let namespace_obj = module.get_module_namespace().to_object(scope).unwrap();

let nix_value_attr = v8::String::new(scope, "__nixValue").unwrap();
let nix_value_attr = v8::String::new(scope, "default").unwrap();
let Some(nix_value) = namespace_obj.get(scope, nix_value_attr.into()) else {
todo!(
"Could not find the nix value: {:?}",
Expand Down

0 comments on commit 71e272e

Please sign in to comment.