throwunreachable("attribute paths should have been desugared");
}else{
returntrue;
}
}else{
returnfalse;
}
}
module.exports={
name:"desugar-let-attribute-set",
visitors:{
NixLetAttributeSet:(node)=>{
// We save a bunch of complexity here by directly translating to a recursive attribute set instead of `let..in`; our JS representation of `let..in` is *functionally* identical to how a LetAttributeSet works. We just use a different attribute name to represent the returned evaluation.
// FIXME: It's possible to specify the `body` with a dynamic key; this means that we can't actually do a compile-time check here, at least not reliably, and we need to insert a runtime guard if the compile-time check fails and dynamic attributes are specified
thrownewError(`Missing required 'body' attribute in LetAttributeSet`);