ast = parse(source, {
plugins: [...context.expressionPlugins, ...babelParserDefaultPlugins]
}).program
- } catch (e) {
+ } catch (e: any) {
context.onError(
createCompilerError(
ErrorCodes.X_INVALID_EXPRESSION,
? ` ${exp} `
: `return ${asParams ? `(${exp}) => {}` : `(${exp})`}`
)
- } catch (e) {
+ } catch (e: any) {
let message = e.message
const keywordMatch = exp
.replace(stripStringRE, '')
sourceType: 'module',
plugins: [...babelParserDefaultPlugins, 'typescript']
})
- } catch (e) {
+ } catch (e: any) {
console.log(code)
throw e
}
bindings,
scriptAst: scriptAst.body
}
- } catch (e) {
+ } catch (e: any) {
// silently fallback if parse fails since user may be using custom
// babel syntax
return script
): Program {
try {
return _parse(input, options).program
- } catch (e) {
+ } catch (e: any) {
e.message = `[@vue/compiler-sfc] ${e.message}\n\n${
sfc.filename
}\n${generateCodeFrame(source, e.pos + offset, e.pos + offset + 1)}`
// force synchronous transform (we know we only have sync plugins)
code = result.css
outMap = result.map
- } catch (e) {
+ } catch (e: any) {
errors.push(e)
}
...options,
source: preprocess(options, preprocessor)
})
- } catch (e) {
+ } catch (e: any) {
return {
code: `export default function render() {}`,
source: options.source,
}
return { code: result.css.toString(), errors: [], dependencies }
- } catch (e) {
+ } catch (e: any) {
return { code: '', errors: [e], dependencies: [] }
}
}
}
return { code: result, errors: [], dependencies }
- } catch (e) {
+ } catch (e: any) {
return { code: '', errors: [e], dependencies: [] }
}
}
sourceType: 'module',
plugins: [...babelParserDefaultPlugins, 'typescript']
})
- } catch (e) {
+ } catch (e: any) {
console.log(code)
throw e
}
const bar = inject('bar')
try {
inject('__proto__')
- } catch (e) {}
+ } catch (e: any) {}
return () => `${foo},${bar}`
}
}
)
__temp = await __temp
__restore()
- } catch (e) {
+ } catch (e: any) {
// ignore
}
// register the lifecycle after an await statement
try {
await Promise.all(res)
- } catch (e) {
+ } catch (e: any) {
expect(e).toBe(err)
}
expect(fn).toHaveBeenCalledWith(err, 'component event handler')
})
try {
await nextTick()
- } catch (e) {
+ } catch (e: any) {
expect(e).toBe(err)
}
expect(
M extends MethodOptions = MethodOptions,
Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,
Extends extends ComponentOptionsMixin = ComponentOptionsMixin,
- E extends EmitsOptions = Record<string, any>,
+ E extends EmitsOptions = {},
EE extends string = string,
PP = PublicProps,
- Props = Readonly<ExtractPropTypes<PropsOrPropOptions>> & EmitsToProps<E>,
+ Props = Readonly<ExtractPropTypes<PropsOrPropOptions>> &
+ ({} extends E ? {} : EmitsToProps<E>),
Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>
> = ComponentPublicInstanceConstructor<
CreateComponentPublicInstance<
Object.keys(val).forEach(key => {
try {
defineReactiveSimple(val, key, val[key])
- } catch (e) {}
+ } catch (e: any) {}
})
}
}
return (id: string, arg: any) => {
try {
return fn(id, arg)
- } catch (e) {
+ } catch (e: any) {
console.error(e)
console.warn(
`[HMR] Something went wrong during Vue component hot-reload. ` +
expect(parent.innerHTML).toBe(content)
expect(first).toBe(parent.firstChild)
expect(last).toBe(parent.lastChild)
- expect(first.namespaceURI).toMatch('svg')
- expect(last.namespaceURI).toMatch('svg')
+ expect((first as Element).namespaceURI).toMatch('svg')
+ expect((last as Element).namespaceURI).toMatch('svg')
})
test('fresh insertion as svg, with anchor', () => {
expect(parent.innerHTML).toBe(content + existing)
expect(first).toBe(parent.firstChild)
expect(last).toBe(parent.childNodes[parent.childNodes.length - 2])
- expect(first.namespaceURI).toMatch('svg')
- expect(last.namespaceURI).toMatch('svg')
+ expect((first as Element).namespaceURI).toMatch('svg')
+ expect((last as Element).namespaceURI).toMatch('svg')
})
})
})
// some properties perform value validation and throw
try {
el[key] = value
- } catch (e) {
+ } catch (e: any) {
if (__DEV__) {
warn(
`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
try {
await render(app)
- } catch (e) {
+ } catch (e: any) {
renderError = e
}
expect(renderError).toBe(null)
let hasReady = false
try {
hasReady = isPromise(writer.ready)
- } catch (e) {}
+ } catch (e: any) {}
renderToSimpleStream(input, context, {
async push(content) {
]
}
createSandbox()
- } catch (e) {
+ } catch (e: any) {
store.errors = [e as Error]
return
}
let importMap: Record<string, any>
try {
importMap = JSON.parse(store.importMap || `{}`)
- } catch (e) {
+ } catch (e: any) {
store.errors = [`Syntax error in import-map.json: ${(e as Error).message}`]
return
}
app.config.errorHandler = e => console.error(e)
app.mount('#app')`.trim()
])
- } catch (e) {
+ } catch (e: any) {
runtimeError.value = (e as Error).message
}
}
}
window.__next__ = undefined
send_ok()
- } catch (e) {
+ } catch (e: any) {
send_error(e.message, e.stack);
}
}
}
try {
parent.postMessage({ action: 'error', value: error }, '*');
- } catch (e) {
+ } catch (e: any) {
parent.postMessage({ action: 'error', value: msg }, '*');
}
}
}
try {
parent.postMessage({ action: 'unhandledrejection', value: event.reason }, '*');
- } catch (e) {
+ } catch (e: any) {
parent.postMessage({ action: 'unhandledrejection', value: event.reason.message }, '*');
}
});
}
return [code, compiledScript.bindings]
- } catch (e) {
+ } catch (e: any) {
store.errors = [e.stack.split('\n').slice(0, 12).join('\n')]
return
}
lastSuccessfulCode = code + `\n\n// Check the console for the AST`
lastSuccessfulMap = new SourceMapConsumer(map!)
lastSuccessfulMap!.computeColumnSpans()
- } catch (e) {
+ } catch (e: any) {
lastSuccessfulCode = `/* ERROR: ${e.message} (see console for more info) */`
console.error(e)
}
}
)
console.log(chalk.green(`Successfully published ${pkgName}@${version}`))
- } catch (e) {
+ } catch (e: any) {
if (e.stderr.match(/previously published/)) {
console.log(chalk.red(`Skipping already published: ${pkgName}`))
} else {
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
-typescript@^4.2.2, typescript@~4.3.5:
+typescript@^4.2.2:
+ version "4.4.2"
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86"
+ integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==
+
+typescript@~4.3.5:
version "4.3.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4"
integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==