sourceType: 'module'
},
rules: {
+ 'no-debugger': 'error',
'no-unused-vars': [
'error',
// we are only using this rule to check for unused arguments since TS
]
export const DOMDirectiveTransforms: Record<string, DirectiveTransform> = {
-cloak: noopDirectiveTransform,
+ cloak: noopDirectiveTransform,
html: transformVHtml,
text: transformVText,
model: transformModel, // override compiler-core
expect(instanceProxy.isDisplayed).toBe(true)
})
-
test('allow jest spying on proxy methods with Object.defineProperty', () => {
// #5417
let instanceProxy: any
expect(instanceProxy.fromProp).toBe(false)
})
-
// #864
test('should not warn declared but absent props', () => {
const Comp = {
expect(mapRefs()).toMatchObject(['2', '3', '4'])
})
-
-
test('named ref in v-for', async () => {
- const show = ref(true);
+ const show = ref(true)
const list = reactive([1, 2, 3])
const listRefs = ref([])
const mapRefs = () => listRefs.value.map(n => serializeInner(n))
await nextTick()
expect(mapRefs()).toMatchObject(['2', '3', '4'])
})
-
-
})
// extract props which defined with default from prop options
export type ExtractDefaultPropTypes<O> = O extends object
- // use `keyof Pick<O, DefaultKeys<O>>` instead of `DefaultKeys<O>` to support IDE features
- ? { [K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]> }
+ ? // use `keyof Pick<O, DefaultKeys<O>>` instead of `DefaultKeys<O>` to support IDE features
+ { [K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]> }
: {}
type NormalizedProp =
for (let i = 0; i < propsToUpdate.length; i++) {
let key = propsToUpdate[i]
// skip if the prop key is a declared emit event listener
- if (isEmitListener(instance.emitsOptions, key)){
+ if (isEmitListener(instance.emitsOptions, key)) {
continue
}
// PROPS flag guarantees rawProps to be non-null
nextNode = onMismatch()
} else {
if ((node as Text).data !== vnode.children) {
- hasMismatch = true; debugger
+ hasMismatch = true
__DEV__ &&
warn(
`Hydration text mismatch:` +
)
let hasWarned = false
while (next) {
- hasMismatch = true; debugger
+ hasMismatch = true
if (__DEV__ && !hasWarned) {
warn(
`Hydration children mismatch in <${vnode.type as string}>: ` +
}
} else if (shapeFlag & ShapeFlags.TEXT_CHILDREN) {
if (el.textContent !== vnode.children) {
- hasMismatch = true; debugger
+ hasMismatch = true
__DEV__ &&
warn(
`Hydration text content mismatch in <${
} else if (vnode.type === Text && !vnode.children) {
continue
} else {
- hasMismatch = true; debugger
+ hasMismatch = true
if (__DEV__ && !hasWarned) {
warn(
`Hydration children mismatch in <${container.tagName.toLowerCase()}>: ` +
} else {
// fragment didn't hydrate successfully, since we didn't get a end anchor
// back. This should have led to node/children mismatch warnings.
- hasMismatch = true; debugger
+ hasMismatch = true
// since the anchor is missing, we need to create one and insert it
insert((vnode.anchor = createComment(`]`)), container, next)
return next
slotScopeIds: string[] | null,
isFragment: boolean
): Node | null => {
- hasMismatch = true; debugger
+ hasMismatch = true
__DEV__ &&
warn(
`Hydration node mismatch:\n- Client vnode:`,
// #4398
test('should not mutate original root component options object', () => {
-
- const originalObj = {
+ const originalObj = {
data() {
return {
counter: 0
expect(msg).toMatch(`Component is missing template or render function`)
})
- const Root = { ...originalObj}
-
+ const Root = { ...originalObj }
+
const app = createApp(Root)
app.config.warnHandler = handler
- app.mount(document.createElement('div'))
-
- // ensure mount is based on a copy of Root object rather than Root object itself
+ app.mount(document.createElement('div'))
+
+ // ensure mount is based on a copy of Root object rather than Root object itself
expect(app._component).not.toBe(Root)
-
+
// ensure no mutation happened to Root object
expect(originalObj).toMatchObject(Root)
-
})
})
} from '@vue/shared'
// leading comma for empty string ""
-const shouldIgnoreProp = makeMap(`,key,ref,innerHTML,textContent,ref_key,ref_for`)
+const shouldIgnoreProp = makeMap(
+ `,key,ref,innerHTML,textContent,ref_key,ref_for`
+)
export function ssrRenderAttrs(
props: Record<string, unknown>,
// make keys required but keep undefined values
export type LooseRequired<T> = { [P in string & keyof T]: T[P] }
-
// If the the type T accepts type "any", output type Y, otherwise output type N.
// https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360
-export type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N
+export type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N