wip(ssr): escape helpers

This commit is contained in:
Evan You
2020-01-26 17:35:21 -05:00
parent 4e40d0d7c8
commit 066ba82c7f
10 changed files with 81 additions and 23 deletions

View File

@@ -18,7 +18,7 @@ import {
} from '../src'
import {
CREATE_VNODE,
TO_STRING,
TO_DISPLAY_STRING,
RESOLVE_DIRECTIVE,
helperNameMap,
RESOLVE_COMPONENT,
@@ -164,7 +164,7 @@ describe('compiler: codegen', () => {
codegenNode: createInterpolation(`hello`, locStub)
})
)
expect(code).toMatch(`return _${helperNameMap[TO_STRING]}(hello)`)
expect(code).toMatch(`return _${helperNameMap[TO_DISPLAY_STRING]}(hello)`)
expect(code).toMatchSnapshot()
})
@@ -197,7 +197,9 @@ describe('compiler: codegen', () => {
])
})
)
expect(code).toMatch(`return _ctx.foo + _${helperNameMap[TO_STRING]}(bar)`)
expect(code).toMatch(
`return _ctx.foo + _${helperNameMap[TO_DISPLAY_STRING]}(bar)`
)
expect(code).toMatchSnapshot()
})