* Emits a build error for the provided range. * @param {ParserState} state parser state * @param {string} message error message * @param {LocConverter} locConverter location converter * @param {number} start start offset * @param {number} end end offset
(state, message, locConverter, start, end)
| 852 | * @param {number} end end offset |
| 853 | */ |
| 854 | _emitError(state, message, locConverter, start, end) { |
| 855 | const { line: sl, column: sc } = locConverter.get(start); |
| 856 | const { line: el, column: ec } = locConverter.get(end); |
| 857 | |
| 858 | const err = new WebpackError(message); |
| 859 | err.module = state.module; |
| 860 | err.loc = { |
| 861 | start: { line: sl, column: sc }, |
| 862 | end: { line: el, column: ec } |
| 863 | }; |
| 864 | state.module.addError(err); |
| 865 | } |
| 866 | |
| 867 | /** |
| 868 | * Parses the provided source and updates the parser state. |