(app: App)
| 388 | } |
| 389 | |
| 390 | function applySingletonAppMutations(app: App) { |
| 391 | // copy over asset registries and deopt flag |
| 392 | app._context.mixins = [...singletonApp._context.mixins] |
| 393 | ;['components', 'directives', 'filters'].forEach(key => { |
| 394 | // @ts-expect-error |
| 395 | app._context[key] = Object.create(singletonApp._context[key]) |
| 396 | }) |
| 397 | |
| 398 | // copy over global config mutations |
| 399 | isCopyingConfig = true |
| 400 | for (const key in singletonApp.config) { |
| 401 | if (key === 'isNativeTag') continue |
| 402 | if ( |
| 403 | isRuntimeOnly() && |
| 404 | (key === 'isCustomElement' || key === 'compilerOptions') |
| 405 | ) { |
| 406 | continue |
| 407 | } |
| 408 | const val = singletonApp.config[key as keyof AppConfig] |
| 409 | // @ts-expect-error |
| 410 | app.config[key] = isObject(val) ? Object.create(val) : val |
| 411 | |
| 412 | // compat for runtime ignoredElements -> isCustomElement |
| 413 | if ( |
| 414 | key === 'ignoredElements' && |
| 415 | isCompatEnabled(DeprecationTypes.CONFIG_IGNORED_ELEMENTS, null) && |
| 416 | !isRuntimeOnly() && |
| 417 | isArray(val) |
| 418 | ) { |
| 419 | app.config.compilerOptions.isCustomElement = tag => { |
| 420 | return val.some(v => (isString(v) ? v === tag : v.test(tag))) |
| 421 | } |
| 422 | } |
| 423 | } |
| 424 | isCopyingConfig = false |
| 425 | applySingletonPrototype(app, singletonCtor) |
| 426 | } |
| 427 | |
| 428 | function applySingletonPrototype(app: App, Ctor: Function) { |
| 429 | // copy prototype augmentations as config.globalProperties |
no test coverage detected