mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
23 lines
304 B
JavaScript
23 lines
304 B
JavaScript
const calls = [];
|
|
|
|
`
|
|
${
|
|
(calls.push(1), {
|
|
[Symbol.toPrimitive](){
|
|
calls.push(2);
|
|
return 'foo';
|
|
}
|
|
})
|
|
}
|
|
${
|
|
(calls.push(3), {
|
|
[Symbol.toPrimitive](){
|
|
calls.push(4);
|
|
return 'bar';
|
|
}
|
|
})
|
|
}
|
|
`;
|
|
|
|
expect(calls).toEqual([1, 2, 3, 4]);
|