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

Function ondirmodifier

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

Source from the content-addressed store, hash-verified

263 },
264
265 ondirmodifier(start, end) {
266 const mod = getSlice(start, end)
267 if (inVPre && !isVPre(currentProp!)) {
268 ;(currentProp as AttributeNode).name += '.' + mod
269 setLocEnd((currentProp as AttributeNode).nameLoc, end)
270 } else if ((currentProp as DirectiveNode).name === 'slot') {
271 // slot has no modifiers, special case for edge cases like
272 // https://github.com/vuejs/language-tools/issues/2710
273 const arg = (currentProp as DirectiveNode).arg
274 if (arg) {
275 ;(arg as SimpleExpressionNode).content += '.' + mod
276 setLocEnd(arg.loc, end)
277 }
278 } else {
279 const exp = createSimpleExpression(mod, true, getLoc(start, end))
280 ;(currentProp as DirectiveNode).modifiers.push(exp)
281 }
282 },
283
284 onattribdata(start, end) {
285 currentAttrValue += getSlice(start, end)

Callers

nothing calls this directly

Calls 6

isVPreFunction · 0.90
createSimpleExpressionFunction · 0.90
getSliceFunction · 0.85
setLocEndFunction · 0.85
getLocFunction · 0.85
pushMethod · 0.65

Tested by

no test coverage detected