(Vue)
| 3985 | /* */ |
| 3986 | |
| 3987 | function initAssetRegisters (Vue) { |
| 3988 | /** |
| 3989 | * Create asset registration methods. |
| 3990 | */ |
| 3991 | config._assetTypes.forEach(function (type) { |
| 3992 | Vue[type] = function ( |
| 3993 | id, |
| 3994 | definition |
| 3995 | ) { |
| 3996 | if (!definition) { |
| 3997 | return this.options[type + 's'][id] |
| 3998 | } else { |
| 3999 | /* istanbul ignore if */ |
| 4000 | if (process.env.NODE_ENV !== 'production') { |
| 4001 | if (type === 'component' && config.isReservedTag(id)) { |
| 4002 | warn( |
| 4003 | 'Do not use built-in or reserved HTML elements as component ' + |
| 4004 | 'id: ' + id |
| 4005 | ); |
| 4006 | } |
| 4007 | } |
| 4008 | if (type === 'component' && isPlainObject(definition)) { |
| 4009 | definition.name = definition.name || id; |
| 4010 | definition = this.options._base.extend(definition); |
| 4011 | } |
| 4012 | if (type === 'directive' && typeof definition === 'function') { |
| 4013 | definition = { bind: definition, update: definition }; |
| 4014 | } |
| 4015 | this.options[type + 's'][id] = definition; |
| 4016 | return definition |
| 4017 | } |
| 4018 | }; |
| 4019 | }); |
| 4020 | } |
| 4021 | |
| 4022 | /* */ |
| 4023 |
no test coverage detected