-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jindy
committed
Jun 23, 2022
1 parent
f6caae3
commit 43d2774
Showing
8 changed files
with
115 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ export const enum NodeTypes { | |
SIMPLE_EXPRESSION, | ||
ELEMENT, | ||
TEXT, | ||
ROOT, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const TO_DISPLAY_STRING = Symbol("toDisplayString") | ||
|
||
export const helperMapName = { | ||
[TO_DISPLAY_STRING]: "toDisplayString", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { NodeTypes } from "../ast" | ||
|
||
export function transformExpression(node) { | ||
if (node.type === NodeTypes.INTERPOLATION) { | ||
node.content = processExpression(node.content) //node.content.content | ||
} | ||
} | ||
|
||
function processExpression(node) { | ||
node.content = `_ctx.${node.content}` | ||
return node | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`codegen string 1`] = `"return function render(_ctx,_cache){return 'hi'}"`; | ||
exports[`codegen interpolation 1`] = ` | ||
"const { toDisplayString: _toDisplayString } = Vue | ||
return function render(_ctx,_cache){return _toDisplayString(_ctx.message)}" | ||
`; | ||
|
||
exports[`codegen string 1`] = ` | ||
" | ||
return function render(_ctx,_cache){return 'hi'}" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters