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 @@ -148,7 +148,10 @@ function collectExplicitExportNames(ast: Program): Set<string> {
148148 if ( spec . exported . type === 'Identifier' ) {
149149 names . add ( spec . exported . name )
150150 } else {
151- throw new Error ( 'unsupported string literal export name' )
151+ throw Object . assign (
152+ new Error ( 'unsupported string literal export name' ) ,
153+ { pos : spec . exported . start } ,
154+ )
152155 }
153156 }
154157 }
Original file line number Diff line number Diff line change @@ -107,7 +107,10 @@ export function transformProxyExport(
107107 const names : string [ ] = [ ]
108108 for ( const spec of node . specifiers ) {
109109 if ( spec . exported . type !== 'Identifier' ) {
110- throw new Error ( 'unsupported string literal export name' )
110+ throw Object . assign (
111+ new Error ( 'unsupported string literal export name' ) ,
112+ { pos : spec . exported . start } ,
113+ )
111114 }
112115 names . push ( spec . exported . name )
113116 }
Original file line number Diff line number Diff line change @@ -147,7 +147,10 @@ export function transformWrapExport(
147147 for ( const spec of node . specifiers ) {
148148 tinyassert ( spec . local . type === 'Identifier' )
149149 if ( spec . exported . type !== 'Identifier' ) {
150- throw new Error ( 'unsupported string literal export name' )
150+ throw Object . assign (
151+ new Error ( 'unsupported string literal export name' ) ,
152+ { pos : spec . exported . start } ,
153+ )
151154 }
152155 const name = spec . local . name
153156 toAppend . push (
@@ -163,7 +166,10 @@ export function transformWrapExport(
163166 for ( const spec of node . specifiers ) {
164167 tinyassert ( spec . local . type === 'Identifier' )
165168 if ( spec . exported . type !== 'Identifier' ) {
166- throw new Error ( 'unsupported string literal export name' )
169+ throw Object . assign (
170+ new Error ( 'unsupported string literal export name' ) ,
171+ { pos : spec . exported . start } ,
172+ )
167173 }
168174 wrapExport ( spec . local . name , spec . exported . name )
169175 }
You can’t perform that action at this time.
0 commit comments