File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
compiler/src/macros/commands Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ export class Print extends MacroFunction {
7
7
constructor ( ) {
8
8
super ( ( c , cursor , loc , ...values ) => {
9
9
const first = c . getValue ( values [ 0 ] ) ;
10
-
11
10
if ( ! isTemplateObjectArray ( c , first ) ) {
12
11
for ( const value of values ) {
13
12
cursor . addInstruction ( new NativePrintInstruction ( value , loc ) ) ;
@@ -17,17 +16,16 @@ export class Print extends MacroFunction {
17
16
18
17
// `first` is likely a template strings array
19
18
// maybe this should be checked in another way?
20
- const { length } = first . data ;
19
+ const length = c . getValue ( first . data . length ) as LiteralValue < number > ;
21
20
22
21
for ( let i = 1 ; i < values . length ; i ++ ) {
23
22
const id = first . data [ i - 1 ] ;
24
23
const string = c . getValue ( id ) as LiteralValue < string > ;
25
-
24
+ console . log ( string ) ;
26
25
if ( string . data )
27
26
cursor . addInstruction ( new NativePrintInstruction ( id , loc ) ) ;
28
27
cursor . addInstruction ( new NativePrintInstruction ( values [ i ] , loc ) ) ;
29
28
}
30
-
31
29
const tailId = first . data [ length . data - 1 ] ;
32
30
33
31
const tail = c . getValue ( tailId ) as LiteralValue < string > ;
You can’t perform that action at this time.
0 commit comments