File tree Expand file tree Collapse file tree
packages/plugin-rsc/src/transforms Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ function getBindVars(fn: Node, scopeTree: ScopeTree): BindVar[] {
188188 const ancestorScopes = fnScope . getAncestorScopes ( )
189189 const references = scopeTree . scopeToReferences . get ( fnScope ) ?? [ ]
190190
191- // Same filtering as before: declared in an ancestor scope, not module scope
191+ // bind references that are declared in an ancestor scope, but not module scope nor global
192192 const bindReferences = references . filter ( ( id ) => {
193193 const scope = scopeTree . referenceToDeclaredScope . get ( id )
194194 return scope && scope !== scopeTree . moduleScope && ancestorScopes . has ( scope )
@@ -264,7 +264,9 @@ function antichainDedupe(paths: BindPath[]): BindPath[] {
264264 const covered = retained . some (
265265 ( r ) => path . key === r . key || path . key . startsWith ( r . key + '.' ) ,
266266 )
267- if ( ! covered ) retained . push ( path )
267+ if ( ! covered ) {
268+ retained . push ( path )
269+ }
268270 }
269271 return retained
270272}
@@ -300,9 +302,9 @@ function synthesizePartialObject(rootName: string, paths: BindPath[]): string {
300302 return `{ ${ entries } }`
301303 }
302304
303- return serialize ( trie )
304- }
305+ function synthesizeMemberAccess ( root : string , segments : string [ ] ) : string {
306+ return root + segments . map ( ( segment ) => `.${ segment } ` ) . join ( '' )
307+ }
305308
306- function synthesizeMemberAccess ( root : string , segments : string [ ] ) : string {
307- return root + segments . map ( ( segment ) => `.${ segment } ` ) . join ( '' )
309+ return serialize ( trie )
308310}
You can’t perform that action at this time.
0 commit comments