MCPcopy
hub / github.com/vuejs/core / oninterpolation

Function oninterpolation

packages/compiler-core/src/parser.ts:111–137  ·  view source on GitHub ↗
(start, end)

Source from the content-addressed store, hash-verified

109 },
110
111 oninterpolation(start, end) {
112 if (inVPre) {
113 return onText(getSlice(start, end), start, end)
114 }
115 let innerStart = start + tokenizer.delimiterOpen.length
116 let innerEnd = end - tokenizer.delimiterClose.length
117 while (isWhitespace(currentInput.charCodeAt(innerStart))) {
118 innerStart++
119 }
120 while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) {
121 innerEnd--
122 }
123 let exp = getSlice(innerStart, innerEnd)
124 // decode entities for backwards compat
125 if (exp.includes('&')) {
126 if (__BROWSER__) {
127 exp = currentOptions.decodeEntities!(exp, false)
128 } else {
129 exp = decodeHTML(exp)
130 }
131 }
132 addNode({
133 type: NodeTypes.INTERPOLATION,
134 content: createExp(exp, false, getLoc(innerStart, innerEnd)),
135 loc: getLoc(start, end),
136 })
137 },
138
139 onopentagname(start, end) {
140 const name = getSlice(start, end)

Callers

nothing calls this directly

Calls 6

isWhitespaceFunction · 0.90
onTextFunction · 0.85
getSliceFunction · 0.85
addNodeFunction · 0.85
createExpFunction · 0.85
getLocFunction · 0.85

Tested by

no test coverage detected