fix: snapshot

pull/10320/head
S. Elliott Johnson 2 years ago
parent 33a39bf85e
commit c1bb2397dd

@ -1757,7 +1757,8 @@ export const template_visitors = {
const args = [context.state.node]; const args = [context.state.node];
node.arguments.forEach((arg) => { node.arguments.forEach((arg) => {
if (arg.type === 'SpreadElement') { if (arg.type === 'SpreadElement') {
// this is a spread operation, meaning we need to thunkify all of its members // this is a spread operation, meaning we need to thunkify all of its members, which we can't
// do until runtime
args.push( args.push(
/** @type {import('estree').Expression} */ ( /** @type {import('estree').Expression} */ (
context.visit(b.spread(b.call('$.shallow_thunk', arg.argument))) context.visit(b.spread(b.call('$.shallow_thunk', arg.argument)))

@ -22,6 +22,16 @@
"type": "Identifier", "type": "Identifier",
"start": 39, "start": 39,
"end": 42, "end": 42,
"loc": {
"start": {
"line": 3,
"column": 10
},
"end": {
"line": 3,
"column": 13
}
},
"name": "foo" "name": "foo"
}, },
"context": { "context": {
@ -29,21 +39,46 @@
"elements": [ "elements": [
{ {
"type": "Identifier", "type": "Identifier",
"name": "msg",
"start": 43, "start": 43,
"end": 54, "end": 25,
"loc": {
"start": {
"line": 3,
"column": 14
},
"end": {
"line": 3,
"column": 25
}
},
"name": "msg",
"typeAnnotation": { "typeAnnotation": {
"type": "TSStringKeyword", "type": "TSTypeAnnotation",
"start": 48, "start": 46,
"end": 54, "end": 54,
"loc": { "loc": {
"start": { "start": {
"line": 1, "line": 3,
"column": 48 "column": 17
}, },
"end": { "end": {
"line": 1, "line": 3,
"column": 54 "column": 25
}
},
"typeAnnotation": {
"type": "TSStringKeyword",
"start": 48,
"end": 54,
"loc": {
"start": {
"line": 3,
"column": 19
},
"end": {
"line": 3,
"column": 25
}
} }
} }
} }

Loading…
Cancel
Save