mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(compiler): let declaration span not including end character
Fixes that the span for `@let` declarations didn't include the end token.
This commit is contained in:
committed by
Alon Mishne
parent
2a6b6fafb0
commit
6bd1721662
+2
-2
@@ -61,7 +61,7 @@ runInEachFileSystem(() => {
|
||||
expect(diags.length).toBe(1);
|
||||
expect(diags[0].category).toBe(ts.DiagnosticCategory.Warning);
|
||||
expect(diags[0].code).toBe(ngErrorCode(ErrorCode.UNUSED_LET_DECLARATION));
|
||||
expect(getSourceCodeForDiagnostic(diags[0])).toBe('@let unused = 2');
|
||||
expect(getSourceCodeForDiagnostic(diags[0])).toBe('@let unused = 2;');
|
||||
});
|
||||
|
||||
it('should report a solo @let declaration that is not used', () => {
|
||||
@@ -77,7 +77,7 @@ runInEachFileSystem(() => {
|
||||
expect(diags.length).toBe(1);
|
||||
expect(diags[0].category).toBe(ts.DiagnosticCategory.Warning);
|
||||
expect(diags[0].code).toBe(ngErrorCode(ErrorCode.UNUSED_LET_DECLARATION));
|
||||
expect(getSourceCodeForDiagnostic(diags[0])).toBe('@let foo = 1');
|
||||
expect(getSourceCodeForDiagnostic(diags[0])).toBe('@let foo = 1;');
|
||||
});
|
||||
|
||||
it('should not report a @let declaration that is only used in other @let declarations', () => {
|
||||
|
||||
Reference in New Issue
Block a user