wip: expression rewrite

This commit is contained in:
Evan You
2019-09-23 02:52:54 -04:00
parent 70656690e2
commit bb8524e199
10 changed files with 224 additions and 23 deletions

View File

@@ -0,0 +1,19 @@
import { SourceMapConsumer } from 'source-map'
import { compile } from '../../src'
test(`should work`, async () => {
const { code, map } = compile(
`<div v-if="hello">{{ ({ a }, b) => a + b + c }}</div>`,
{
useWith: false
}
)
console.log(code)
console.log(map)
const consumer = await new SourceMapConsumer(map!)
const pos = consumer.originalPositionFor({
line: 4,
column: 31
})
console.log(pos)
})