angular/packages/compiler/test/expression_parser/utils/span.ts
Kristiyan Kostadinov 5e9707dc84 refactor(compiler): consolidate error classes (#62160)
Currently we have a `ParserError` that is used for the expression parser and a `ParseError` that is used everywhere else. These changes consolidate them into the `ParseError` to avoid confusion and make it easier to add more context in the future.

PR Close #62160
2025-06-23 14:25:28 +02:00

16 lines
562 B
TypeScript

/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {ParseSourceFile, ParseLocation, ParseSourceSpan} from '../../../src/parse_util';
/** Gets a fake `ParseSourceSpan` for testing purposes. */
export function getFakeSpan(fileName = 'test.html') {
const file = new ParseSourceFile('', fileName);
const location = new ParseLocation(file, 0, 0, 0);
return new ParseSourceSpan(location, location);
}