Skip to content

Commit fa51801

Browse files
committed
fix console.log with string as first arg
1 parent b864c33 commit fa51801

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/worker.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ addEventListener('message', ({ data }) => {
7878
type: 'console',
7979
value: {
8080
method,
81-
values: args.map((a) => inspect(a)),
81+
values: args.map((a, i) => {
82+
if (i === 0 && Abstract.Type(a) === 'String') {
83+
return a.stringValue();
84+
}
85+
return inspect(a);
86+
}),
8287
},
8388
});
8489
return Value.undefined;

0 commit comments

Comments
 (0)