( key: CompilerDeprecationTypes, context: MergedParserOptions | TransformContext, loc: SourceLocation | null, ...args: any[] )
| 128 | } |
| 129 | |
| 130 | export function warnDeprecation( |
| 131 | key: CompilerDeprecationTypes, |
| 132 | context: MergedParserOptions | TransformContext, |
| 133 | loc: SourceLocation | null, |
| 134 | ...args: any[] |
| 135 | ): void { |
| 136 | const val = getCompatValue(key, context) |
| 137 | if (val === 'suppress-warning') { |
| 138 | return |
| 139 | } |
| 140 | const { message, link } = deprecationData[key] |
| 141 | const msg = `(deprecation ${key}) ${ |
| 142 | typeof message === 'function' ? message(...args) : message |
| 143 | }${link ? `\n Details: ${link}` : ``}` |
| 144 | |
| 145 | const err = new SyntaxError(msg) as CompilerError |
| 146 | err.code = key |
| 147 | if (loc) err.loc = loc |
| 148 | context.onWarn(err) |
| 149 | } |
no test coverage detected