wip(compiler): adjust statement positions
This commit is contained in:
@@ -71,10 +71,10 @@ return function render() {
|
||||
`;
|
||||
|
||||
exports[`compiler: codegen function mode preamble 1`] = `
|
||||
"const { helperOne, helperTwo } = Vue
|
||||
|
||||
"const _Vue = Vue
|
||||
return function render() {
|
||||
with (this) {
|
||||
const { helperOne, helperTwo } = _Vue
|
||||
return null
|
||||
}
|
||||
}"
|
||||
@@ -147,10 +147,10 @@ return function render() {
|
||||
exports[`compiler: codegen statements 1`] = `
|
||||
"
|
||||
return function render() {
|
||||
const a = 1
|
||||
const b = 2
|
||||
|
||||
with (this) {
|
||||
const a = 1
|
||||
const b = 2
|
||||
|
||||
return null
|
||||
}
|
||||
}"
|
||||
|
||||
@@ -55,7 +55,8 @@ describe('compiler: codegen', () => {
|
||||
imports: [`helperOne`, `helperTwo`]
|
||||
})
|
||||
const { code } = generate(root, { mode: 'function' })
|
||||
expect(code).toMatch(`const { helperOne, helperTwo } = Vue`)
|
||||
expect(code).toMatch(`const _Vue = Vue`)
|
||||
expect(code).toMatch(`const { helperOne, helperTwo } = _Vue`)
|
||||
expect(code).toMatchSnapshot()
|
||||
})
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ test('basic source map support', async () => {
|
||||
filename: `foo.vue`
|
||||
})
|
||||
expect(code).toMatch(
|
||||
`const { toString } = Vue
|
||||
|
||||
`const _Vue = Vue
|
||||
return function render() {
|
||||
with (this) {
|
||||
const { toString } = _Vue
|
||||
return [
|
||||
"hello ",
|
||||
toString(world)
|
||||
|
||||
Reference in New Issue
Block a user