wip(ssr): escape helpers
This commit is contained in:
@@ -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()
|
||||
})
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from '../src/ast'
|
||||
import { ErrorCodes, createCompilerError } from '../src/errors'
|
||||
import {
|
||||
TO_STRING,
|
||||
TO_DISPLAY_STRING,
|
||||
OPEN_BLOCK,
|
||||
CREATE_BLOCK,
|
||||
FRAGMENT,
|
||||
@@ -227,7 +227,7 @@ describe('compiler: transform', () => {
|
||||
test('should inject toString helper for interpolations', () => {
|
||||
const ast = baseParse(`{{ foo }}`)
|
||||
transform(ast, {})
|
||||
expect(ast.helpers).toContain(TO_STRING)
|
||||
expect(ast.helpers).toContain(TO_DISPLAY_STRING)
|
||||
})
|
||||
|
||||
test('should inject createVNode and Comment for comments', () => {
|
||||
|
||||
Reference in New Issue
Block a user