| 447 | }, |
| 448 | |
| 449 | provide(key, value) { |
| 450 | if (__DEV__ && (key as string | symbol) in context.provides) { |
| 451 | if (hasOwn(context.provides, key as string | symbol)) { |
| 452 | warn( |
| 453 | `App already provides property with key "${String(key)}". ` + |
| 454 | `It will be overwritten with the new value.`, |
| 455 | ) |
| 456 | } else { |
| 457 | // #13212, context.provides can inherit the provides object from parent on custom elements |
| 458 | warn( |
| 459 | `App already provides property with key "${String(key)}" inherited from its parent element. ` + |
| 460 | `It will be overwritten with the new value.`, |
| 461 | ) |
| 462 | } |
| 463 | } |
| 464 | |
| 465 | context.provides[key as string | symbol] = value |
| 466 | |
| 467 | return app |
| 468 | }, |
| 469 | |
| 470 | runWithContext(fn) { |
| 471 | const lastApp = currentApp |