_id stringlengths 21 254 | text stringlengths 1 93.7k | metadata dict |
|---|---|---|
angular/packages/compiler-cli/src/ngtsc/sourcemaps/index.ts_0_432 | /**
* @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
*/
export {ContentOrigin} from './src/content_origin';
export {MapAndPath, RawSourceMap} from './src/raw_source_map';
ex... | {
"end_byte": 432,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/index.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_loader_spec.ts_0_925 | /**
* @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 mapHelpers from 'convert-source-map';
import {absoluteFrom, FileSystem, getFileSystem} from '../../file_syste... | {
"end_byte": 925,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_loader_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_loader_spec.ts_931_9632 | describe('loadSourceFile', () => {
it('should load a file with no source map and inline contents', () => {
const sourceFile = registry.loadSourceFile(_('/foo/src/index.js'), 'some inline content');
if (sourceFile === null) {
return fail('Expected source file to be defined');
}
... | {
"end_byte": 9632,
"start_byte": 931,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_loader_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_loader_spec.ts_9640_17114 | it('should handle a missing source file referenced from a source-map', () => {
fs.ensureDir(_('/foo/src'));
const indexSourceMap = createRawSourceMap({
file: 'index.js',
sources: ['x.js'],
'sourcesContent': [null],
});
fs.writeFile(_('/foo/src/index.js.map'... | {
"end_byte": 17114,
"start_byte": 9640,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_loader_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_loader_spec.ts_17120_19655 | for (const {scheme, mappedPath} of [
{scheme: 'WEBPACK://', mappedPath: '/foo/src/index.ts'},
{scheme: 'webpack://', mappedPath: '/foo/src/index.ts'},
{scheme: 'missing://', mappedPath: '/src/index.ts'},
]) {
it(`should handle source paths that are protocol mapped [scheme:"${scheme}"]`, () =... | {
"end_byte": 19655,
"start_byte": 17120,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_loader_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts_0_5175 | /**
* @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 {encode} from '@jridgewell/sourcemap-codec';
import {absoluteFrom, getFileSystem, PathManipulation} from '../... | {
"end_byte": 5175,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts_5181_10953 | describe('findLastMappingIndexBefore', () => {
it('should find the highest mapping index that has a segment marker below the given one if there is not an exact match', () => {
const marker5: SegmentMarker = {line: 0, column: 50, position: 50, next: undefined};
const marker4: SegmentMarker = {line:... | {
"end_byte": 10953,
"start_byte": 5181,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts_10961_17854 | describe('[exact match exclusive]', () => {
it('should find the preceding mapping index if there is a matching segment marker', () => {
const marker5: SegmentMarker = {line: 0, column: 50, position: 50, next: undefined};
const marker4: SegmentMarker = {line: 0, column: 40, position: 40, next... | {
"end_byte": 17854,
"start_byte": 10961,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts_17860_26028 | describe('ensureOriginalSegmentLinks', () => {
it('should add `next` properties to each segment that point to the next segment in the same source file', () => {
const sourceA = new SourceFile(_('/foo/src/a.js'), 'abcdefg', null, [], fs);
const sourceB = new SourceFile(_('/foo/src/b.js'), '1234567'... | {
"end_byte": 26028,
"start_byte": 17860,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts_26036_32128 | describe('renderFlattenedSourceMap()', () => {
it('should convert the flattenedMappings into a raw source-map object', () => {
const cSource = new SourceFile(_('/foo/src/c.js'), 'bcd123e', null, [], fs);
const bToCSourceMap: SourceMapInfo = {
mapPath: null,
map: {
... | {
"end_byte": 32128,
"start_byte": 26036,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts_32136_35874 | describe('getOriginalLocation()', () => {
it('should return null for source files with no flattened mappings', () => {
const sourceFile = new SourceFile(_('/foo/src/index.js'), 'index contents', null, [], fs);
expect(sourceFile.getOriginalLocation(1, 1)).toEqual(null);
});
i... | {
"end_byte": 35874,
"start_byte": 32136,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts_35884_40812 | it('should return offset locations across multiple lines', () => {
const originalSource = new SourceFile(
_('/foo/src/original.js'),
'abcdef\nghijk\nlmnop',
null,
[],
fs,
);
const generatedSourceMap: SourceMapInfo = {
... | {
"end_byte": 40812,
"start_byte": 35884,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/test/source_file_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/test/segment_marker_spec.ts_0_5819 | /**
* @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 {compareSegments, offsetSegment} from '../src/segment_marker';
import {computeStartOfLinePositions} from '../s... | {
"end_byte": 5819,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/test/segment_marker_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/test/BUILD.bazel_0_741 | load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
package(default_visibility = ["//visibility:public"])
ts_library(
name = "test_lib",
testonly = True,
srcs = glob([
"**/*.ts",
]),
deps = [
"//packages/compiler-cli/src/ngtsc/file_system",
"//packages/compiler-... | {
"end_byte": 741,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/test/BUILD.bazel"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/src/content_origin.ts_0_1104 | /**
* @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
*/
/**
* From where the content for a source file or source-map came.
*
* - Source files can be linked to source-map... | {
"end_byte": 1104,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/src/content_origin.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.ts_0_740 | /**
* @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 {decode, encode, SourceMapMappings, SourceMapSegment} from '@jridgewell/sourcemap-codec';
import mapHelpers fr... | {
"end_byte": 740,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.ts_742_8605 | export class SourceFile {
/**
* The parsed mappings that have been flattened so that any intermediate source mappings have been
* flattened.
*
* The result is that any source file mentioned in the flattened mappings have no source map (are
* pure original source files).
*/
readonly flattenedMappin... | {
"end_byte": 8605,
"start_byte": 742,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.ts_8607_16567 | /**
*
* @param mappings The collection of mappings whose segment-markers we are searching.
* @param marker The segment-marker to match against those of the given `mappings`.
* @param exclusive If exclusive then we must find a mapping with a segment-marker that is
* exclusively earlier than the given `marker`.
* I... | {
"end_byte": 16567,
"start_byte": 8607,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.ts_16569_19446 | function computeLineLengths(str: string): number[] {
return str.split(/\n/).map((s) => s.length);
}
/**
* A collection of mappings between `keys` and `values` stored in the order in which the keys are
* first seen.
*
* The difference between this and a standard `Map` is that when you add a key-value pair the ind... | {
"end_byte": 19446,
"start_byte": 16569,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/src/segment_marker.ts_0_1773 | /**
* @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
*/
/**
* A marker that indicates the start of a segment in a mapping.
*
* The end of a segment is indicated by the f... | {
"end_byte": 1773,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/src/segment_marker.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/src/raw_source_map.ts_0_1061 | /**
* @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 {AbsoluteFsPath} from '../../file_system';
import {ContentOrigin} from './content_origin';
/**
* This interf... | {
"end_byte": 1061,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/src/raw_source_map.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.ts_0_1027 | /**
* @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 mapHelpers from 'convert-source-map';
import {AbsoluteFsPath, ReadonlyFileSystem} from '../../file_system';
i... | {
"end_byte": 1027,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.ts_1028_9444 | export class SourceFileLoader {
private currentPaths: AbsoluteFsPath[] = [];
constructor(
private fs: ReadonlyFileSystem,
private logger: Logger,
/** A map of URL schemes to base paths. The scheme name should be lowercase. */
private schemeMap: Record<string, AbsoluteFsPath>,
) {}
/**
* Loa... | {
"end_byte": 9444,
"start_byte": 1028,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.ts"
} |
angular/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.ts_9448_11390 | /**
* Load the source map from the file at `mapPath`, parsing its JSON contents into a `RawSourceMap`
* object.
*
* @param mapPath The path to the source-map file.
*/
private readRawSourceMap(mapPath: AbsoluteFsPath): RawSourceMap {
this.trackPath(mapPath);
return JSON.parse(this.fs.readFile(ma... | {
"end_byte": 11390,
"start_byte": 9448,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.ts"
} |
angular/packages/compiler-cli/src/ngtsc/shims/api.ts_0_1511 | /**
* @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 ts from 'typescript';
import {AbsoluteFsPath} from '../file_system';
/**
* Generates a single shim file for... | {
"end_byte": 1511,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/shims/api.ts"
} |
angular/packages/compiler-cli/src/ngtsc/shims/README.md_0_6199 | # Shims
The shims package deals with the specification and generation of "shim files". These are files which are not part of the user's original program, but are added by the compiler by user request or in support of certain features. For example, users can request that the compiler produce `.ngfactory` files alongsid... | {
"end_byte": 6199,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/shims/README.md"
} |
angular/packages/compiler-cli/src/ngtsc/shims/BUILD.bazel_0_642 | load("//tools:defaults.bzl", "ts_library")
package(default_visibility = ["//visibility:public"])
ts_library(
name = "api",
srcs = ["api.ts"],
deps = [
"//packages/compiler-cli/src/ngtsc/file_system",
"@npm//typescript",
],
)
ts_library(
name = "shims",
srcs = ["index.ts"] + gl... | {
"end_byte": 642,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/shims/BUILD.bazel"
} |
angular/packages/compiler-cli/src/ngtsc/shims/index.ts_0_489 | /**
* @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
*/
/// <reference types="node" />
export {ShimAdapter} from './src/adapter';
export {
copyFileShimData,
isShim,
... | {
"end_byte": 489,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/shims/index.ts"
} |
angular/packages/compiler-cli/src/ngtsc/shims/test/reference_tagger_spec.ts_0_4762 | /**
* @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 ts from 'typescript';
import {absoluteFrom as _, AbsoluteFsPath, getSourceFileOrError} from '../../file_syst... | {
"end_byte": 4762,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/shims/test/reference_tagger_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/shims/test/adapter_spec.ts_0_3294 | /**
* @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 ts from 'typescript';
import {absoluteFrom as _} from '../../file_system';
import {runInEachFileSystem} from... | {
"end_byte": 3294,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/shims/test/adapter_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/shims/test/util.ts_0_885 | /**
* @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 ts from 'typescript';
import {absoluteFromSourceFile, AbsoluteFsPath} from '../../file_system';
import {PerF... | {
"end_byte": 885,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/shims/test/util.ts"
} |
angular/packages/compiler-cli/src/ngtsc/shims/test/BUILD.bazel_0_715 | load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
package(default_visibility = ["//visibility:public"])
ts_library(
name = "test_lib",
testonly = True,
srcs = glob([
"**/*.ts",
]),
deps = [
"//packages:types",
"//packages/compiler-cli/src/ngtsc/file_system",
... | {
"end_byte": 715,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/shims/test/BUILD.bazel"
} |
angular/packages/compiler-cli/src/ngtsc/shims/src/expando.ts_0_4870 | /**
* @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 ts from 'typescript';
import {AbsoluteFsPath} from '../../file_system';
/**
* A `Symbol` which is used to ... | {
"end_byte": 4870,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/shims/src/expando.ts"
} |
angular/packages/compiler-cli/src/ngtsc/shims/src/adapter.ts_0_1102 | /**
* @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 ts from 'typescript';
import {absoluteFrom, absoluteFromSourceFile, AbsoluteFsPath} from '../../file_system'... | {
"end_byte": 1102,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/shims/src/adapter.ts"
} |
angular/packages/compiler-cli/src/ngtsc/shims/src/adapter.ts_1103_8685 | export class ShimAdapter {
/**
* A map of shim file names to the `ts.SourceFile` generated for those shims.
*/
private shims = new Map<AbsoluteFsPath, ts.SourceFile>();
/**
* A map of shim file names to existing shims which were part of a previous iteration of this
* program.
*
* Not all of the... | {
"end_byte": 8685,
"start_byte": 1103,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/shims/src/adapter.ts"
} |
angular/packages/compiler-cli/src/ngtsc/shims/src/util.ts_0_900 | /**
* @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 {absoluteFrom, AbsoluteFsPath} from '../../file_system';
const TS_EXTENSIONS = /\.tsx?$/i;
/**
* Replace t... | {
"end_byte": 900,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/shims/src/util.ts"
} |
angular/packages/compiler-cli/src/ngtsc/shims/src/reference_tagger.ts_0_2388 | /**
* @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 ts from 'typescript';
import {absoluteFromSourceFile} from '../../file_system';
import {isNonDeclarationTsPa... | {
"end_byte": 2388,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/shims/src/reference_tagger.ts"
} |
angular/packages/compiler-cli/src/ngtsc/diagnostics/BUILD.bazel_0_282 | load("//tools:defaults.bzl", "ts_library")
package(default_visibility = ["//visibility:public"])
ts_library(
name = "diagnostics",
srcs = ["index.ts"] + glob([
"src/**/*.ts",
]),
deps = [
"//packages/compiler",
"@npm//typescript",
],
)
| {
"end_byte": 282,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/diagnostics/BUILD.bazel"
} |
angular/packages/compiler-cli/src/ngtsc/diagnostics/index.ts_0_734 | /**
* @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
*/
export {COMPILER_ERRORS_WITH_GUIDES} from './src/docs';
export {
addDiagnosticChain,
FatalDiagnosticError,
isF... | {
"end_byte": 734,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/diagnostics/index.ts"
} |
angular/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.ts_0_7815 | /**
* @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
*/
/**
* @publicApi
*/
export enum ErrorCode {
DECORATOR_ARG_NOT_LITERAL = 1001,
DECORATOR_ARITY_WRONG = 1002,
... | {
"end_byte": 7815,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.ts"
} |
angular/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.ts_7819_15044 | /**
* The left-hand side of an assignment expression was a template variable. Effectively, the
* template looked like:
*
* ```
* <ng-template let-something>
* <button (click)="something = ...">...</button>
* </ng-template>
* ```
*
* Template variables are read-only.
*/
WRITE_TO_READ... | {
"end_byte": 15044,
"start_byte": 7819,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.ts"
} |
angular/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.ts_15048_16117 | **
* Indicates that a particular structural directive provides advanced type narrowing
* functionality, but the current template type-checking configuration does not allow its usage in
* type inference.
*/
SUGGEST_SUBOPTIMAL_TYPE_INFERENCE = 10002,
/**
* In local compilation mode a const is required... | {
"end_byte": 16117,
"start_byte": 15048,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.ts"
} |
angular/packages/compiler-cli/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.ts_0_1381 | /**
* @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
*/
/**
* Enum holding the name of each extended template diagnostic. The name is used as a user-meaningful
* value fo... | {
"end_byte": 1381,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.ts"
} |
angular/packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts_0_496 | /**
* @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
*/
/**
* Base URL for the error details page.
*
* Keep the files below in full sync:
* - packages/compiler-cli/src... | {
"end_byte": 496,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts"
} |
angular/packages/compiler-cli/src/ngtsc/diagnostics/src/docs.ts_0_781 | /**
* @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 {ErrorCode} from './error_code';
/**
* Contains a set of error messages that have detailed guides at angula... | {
"end_byte": 781,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/diagnostics/src/docs.ts"
} |
angular/packages/compiler-cli/src/ngtsc/diagnostics/src/util.ts_0_994 | /**
* @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 {ErrorCode} from './error_code';
const ERROR_CODE_MATCHER = /(\u001b\[\d+m ?)TS-99(\d+: ?\u001b\[\d+m)/g;
/... | {
"end_byte": 994,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/diagnostics/src/util.ts"
} |
angular/packages/compiler-cli/src/ngtsc/diagnostics/src/error.ts_0_3573 | /**
* @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 ts from 'typescript';
import {ErrorCode} from './error_code';
import {ngErrorCode} from './util';
export cl... | {
"end_byte": 3573,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/diagnostics/src/error.ts"
} |
angular/packages/compiler-cli/src/ngtsc/xi18n/BUILD.bazel_0_277 | load("//tools:defaults.bzl", "ts_library")
package(default_visibility = ["//visibility:public"])
ts_library(
name = "xi18n",
srcs = glob([
"*.ts",
"src/**/*.ts",
]),
deps = [
"//packages/compiler",
"@npm//typescript",
],
)
| {
"end_byte": 277,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/xi18n/BUILD.bazel"
} |
angular/packages/compiler-cli/src/ngtsc/xi18n/index.ts_0_235 | /**
* @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
*/
export * from './src/context';
| {
"end_byte": 235,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/xi18n/index.ts"
} |
angular/packages/compiler-cli/src/ngtsc/xi18n/src/context.ts_0_1028 | /**
* @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 {InterpolationConfig} from '@angular/compiler';
/**
* Captures template information intended for extraction... | {
"end_byte": 1028,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/xi18n/src/context.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/README.md_0_8768 | # The Template Type Checking Engine
The `typecheck` package is concerned with template type-checking, the process by which the compiler determines and understands the TypeScript types of constructs within component templates. It's used to perform actual type checking of templates (similarly to how TypeScript checks co... | {
"end_byte": 8768,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/README.md"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/README.md_8768_14916 | #### Nested templates & structural directives
`NgFor` is a structural directive, meaning that it applies to a nested `<ng-template>`. That is, the template:
```html
<div *ngFor="let user of users">
{{user.name}}
</div>
```
is syntactic sugar for:
```html
<ng-template ngFor let-user="$implicit" [ngForOf]="users">
... | {
"end_byte": 14916,
"start_byte": 8768,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/README.md"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/README.md_14916_21910 | ### Generation process
Angular templates allow forward references. For example, the template:
```html
The value is: {{in.value}}
<input #in>
```
contains an expression which makes use of the `#in` local reference before the targeted `<input #in>` element is declared. Since such forward references are not legal in Ty... | {
"end_byte": 21910,
"start_byte": 14916,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/README.md"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/README.md_21910_29888 | ### Source mapping and diagnostic translation
Once TCB code is generated, TypeScript is able to process it. One use case is to have TypeScript produce diagnostics related to type issues within the TCB code, which indicate type issues within the template itself. These diagnostics are of course expressed in terms of the... | {
"end_byte": 29888,
"start_byte": 21910,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/README.md"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/README.md_29888_35457 | ## The `TemplateTypeChecker`
The main interface used by consumers to interact with the template type checking system is the `TemplateTypeChecker`. Methods on this interface allow for various operations related to TCBs, such as:
* Generation of diagnostics.
* Retrieving `Symbol`s (the template equivalent to TypeScript... | {
"end_byte": 35457,
"start_byte": 29888,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/README.md"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/BUILD.bazel_0_1185 | load("//tools:defaults.bzl", "ts_library")
package(default_visibility = ["//visibility:public"])
ts_library(
name = "typecheck",
srcs = glob(
["**/*.ts"],
),
deps = [
"//packages:types",
"//packages/compiler",
"//packages/compiler-cli/src/ngtsc/diagnostics",
"//... | {
"end_byte": 1185,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/BUILD.bazel"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/index.ts_0_465 | /**
* @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
*/
export {FileTypeCheckingData, TemplateTypeCheckerImpl} from './src/checker';
export {TypeCheckContextImpl, getTempla... | {
"end_byte": 465,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/index.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_parameter_emitter_spec.ts_0_936 | /**
* @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 ts from 'typescript';
import {absoluteFrom, LogicalFileSystem} from '../../file_system';
import {runInEachFil... | {
"end_byte": 936,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_parameter_emitter_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_parameter_emitter_spec.ts_938_9761 | runInEachFileSystem(() => {
describe('type parameter emitter', () => {
function createEmitter(source: string, additionalFiles: TestFile[] = []) {
const files: TestFile[] = [
...angularCoreDtsFiles(),
{name: absoluteFrom('/app/main.ts'), contents: source},
...additionalFiles,
];... | {
"end_byte": 9761,
"start_byte": 938,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_parameter_emitter_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_parameter_emitter_spec.ts_9767_14948 | it('can emit references into relative declaration files that are outside of rootDirs', () => {
const additionalFiles: TestFile[] = [
{
name: absoluteFrom('/internal.d.ts'),
contents: `export class Internal {}`,
},
];
const emitter = createEmitter(
`
... | {
"end_byte": 14948,
"start_byte": 9767,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_parameter_emitter_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts_0_5086 | /**
* @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 ts from 'typescript';
import {absoluteFrom, getSourceFileOrError} from '../../file_system';
import {initMock... | {
"end_byte": 5086,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts_5090_12645 | describe('type constructors', () => {
it('should handle missing property bindings', () => {
const TEMPLATE = `<div dir [inputA]="foo"></div>`;
const DIRECTIVES: TestDeclaration[] = [
{
type: 'directive',
name: 'Dir',
selector: '[dir]',
inputs: {
... | {
"end_byte": 12645,
"start_byte": 5090,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts_12649_19516 | it('should generate a forward directive reference correctly', () => {
const TEMPLATE = `
{{d.value}}
<div dir #d="dir"></div>
`;
const DIRECTIVES: TestDeclaration[] = [
{
type: 'directive',
name: 'Dir',
selector: '[dir]',
exportAs: ['dir'],
},
];
... | {
"end_byte": 19516,
"start_byte": 12649,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts_19520_27771 | it('should use coercion types if declared, even when backing field is not declared', () => {
const TEMPLATE = `<div dir [inputA]="foo"></div>`;
const DIRECTIVES: TestDeclaration[] = [
{
type: 'directive',
name: 'Dir',
selector: '[dir]',
inputs: {
fieldA: 'inputA',... | {
"end_byte": 27771,
"start_byte": 19520,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts_27775_29829 | be('outputs', () => {
it('should emit subscribe calls for directive outputs', () => {
const DIRECTIVES: TestDeclaration[] = [
{
type: 'directive',
name: 'Dir',
selector: '[dir]',
outputs: {'outputField': 'dirOutput'},
},
];
const TEMPLATE = `... | {
"end_byte": 29829,
"start_byte": 27775,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts_29833_38129 | be('config', () => {
const DIRECTIVES: TestDeclaration[] = [
{
type: 'directive',
name: 'Dir',
selector: '[dir]',
exportAs: ['dir'],
inputs: {'dirInput': 'dirInput'},
outputs: {'outputField': 'dirOutput'},
hasNgTemplateContextGuard: true,
},
];... | {
"end_byte": 38129,
"start_byte": 29833,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts_38135_45459 | be('config.checkTypeOfDomReferences', () => {
const TEMPLATE = `<input #ref>{{ref.value}}`;
it('should trace references when enabled', () => {
const block = tcb(TEMPLATE);
expect(block).toContain('(_t1).value');
});
it('should use any for reference types when disabled', () => {... | {
"end_byte": 45459,
"start_byte": 38135,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts_45465_49441 | be('config.checkAccessModifiersForInputBindings', () => {
const TEMPLATE = `<div dir [inputA]="foo"></div>`;
it('should assign restricted properties via element access for field names that are not JS identifiers', () => {
const DIRECTIVES: TestDeclaration[] = [
{
type: 'direct... | {
"end_byte": 49441,
"start_byte": 45465,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts_49445_58263 | ('host directives', () => {
it('should generate bindings to host directive inputs/outputs', () => {
const TEMPLATE = `<div dir-a [hostInput]="1" (hostOutput)="handle($event)"></div>`;
const DIRECTIVES: TestDeclaration[] = [
{
type: 'directive',
name: 'DirA',
selecto... | {
"end_byte": 58263,
"start_byte": 49445,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts_58267_63881 | ('conditional blocks', () => {
it('should generate an if block', () => {
const TEMPLATE = `
@if (expr === 0) {
{{main()}}
} @else if (expr1 === 1) {
{{one()}}
} @else if (expr2 === 2) {
{{two()}}
} @else {
{{other()}}
}
`;
... | {
"end_byte": 63881,
"start_byte": 58267,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts_63885_70912 | ('for loop blocks', () => {
it('should generate a for block', () => {
const TEMPLATE = `
@for (item of items; track item) {
{{main(item)}}
} @empty {
{{empty()}}
}
`;
const result = tcb(TEMPLATE);
expect(result).toContain('for (const _t1 of ((this... | {
"end_byte": 70912,
"start_byte": 63885,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts_0_471 | /**
* @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 {runInEachFileSystem} from '../../file_system/testing';
import {
resetParseTemplateAsSourceFileForTest,
s... | {
"end_byte": 471,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts_473_8873 | runInEachFileSystem(() => {
describe('template diagnostics', () => {
it('works for directive bindings', () => {
const messages = diagnose(
`<div dir [input]="person.name"></div>`,
`
class Dir {
input: number;
}
class TestComponent {
person: {
... | {
"end_byte": 8873,
"start_byte": 473,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts_8879_15096 | it('does not repeat diagnostics for errors used in template guard expressions', () => {
const messages = diagnose(
`<div *guard="personn.name"></div>`,
`
class GuardDir {
static ngTemplateGuard_guard: 'binding';
}
class TestComponent {
person:... | {
"end_byte": 15096,
"start_byte": 8879,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts_15102_24082 | describe('strict null checks', () => {
it('produces diagnostic for unchecked property access', () => {
const messages = diagnose(
`<div [class.has-street]="person.address.street.length > 0"></div>`,
`
export class TestComponent {
person: {
address?: {
... | {
"end_byte": 24082,
"start_byte": 15102,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts_24085_30079 | it('should not fail for components outside of rootDir', () => {
// This test configures a component that is located outside the configured `rootDir`. Such
// configuration requires that an inline type-check block is used as the reference emitter does
// not allow generating imports outside `rootDir`.
co... | {
"end_byte": 30079,
"start_byte": 24085,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts_30083_39640 | describe('required inputs', () => {
it('should produce a diagnostic when a single required input is missing', () => {
const messages = diagnose(
`<div dir></div>`,
`
class Dir {
input: any;
}
class TestComponent {}
`,
[
... | {
"end_byte": 39640,
"start_byte": 30083,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts_39643_41718 | describe('template parse failures', () => {
afterEach(resetParseTemplateAsSourceFileForTest);
it('baseline test without parse failure', () => {
const messages = diagnose(
`<div (click)="test(name)"></div>`,
`
export class TestComponent {
name: string | undefined;
tes... | {
"end_byte": 41718,
"start_byte": 39643,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/diagnostics_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker_spec.ts_0_7891 | /**
* @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 {ErrorCode, ngErrorCode} from '../../diagnostics';
import {absoluteFrom, absoluteFromSourceFile, getSourceFil... | {
"end_byte": 7891,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/test_case_helper.ts_0_4395 | /**
* @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 ts from 'typescript';
import {TypeCheckingConfig} from '../api';
import {diagnose} from '../testing';
expor... | {
"end_byte": 4395,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/test_case_helper.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts_0_1247 | /**
* @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 {
ASTWithSource,
Binary,
BindingPipe,
Conditional,
Interpolation,
PropertyRead,
TmplAstBoundAtt... | {
"end_byte": 1247,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts_1249_10050 | runInEachFileSystem(() => {
describe('TemplateTypeChecker.getSymbolOfNode', () => {
it('should get a symbol for regular attributes', () => {
const fileName = absoluteFrom('/main.ts');
const templateString = `<div id="helloWorld"></div>`;
const {templateTypeChecker, program} = setup([
{
... | {
"end_byte": 10050,
"start_byte": 1249,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts_10058_17983 | describe('structural directives', () => {
let templateTypeChecker: TemplateTypeChecker;
let cmp: ClassDeclaration<ts.ClassDeclaration>;
let templateNode: TmplAstTemplate;
let program: ts.Program;
beforeEach(() => {
const fileName = absoluteFrom('/main.ts');
c... | {
"end_byte": 17983,
"start_byte": 10058,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts_17991_23274 | describe('control flow @for block', () => {
let templateTypeChecker: TemplateTypeChecker;
let cmp: ClassDeclaration<ts.ClassDeclaration>;
let forLoopNode: TmplAstForLoopBlock;
let program: ts.Program;
beforeEach(() => {
const fileName = absoluteFrom('/main.ts');
... | {
"end_byte": 23274,
"start_byte": 17991,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts_23280_32270 | describe('for expressions', () => {
it('should get a symbol for a component property used in an input binding', () => {
const fileName = absoluteFrom('/main.ts');
const templateString = `<div [inputA]="helloWorld"></div>`;
const {templateTypeChecker, program} = setup([
{
... | {
"end_byte": 32270,
"start_byte": 23280,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts_32278_41503 | it('should get a symbol for binary expressions', () => {
const fileName = absoluteFrom('/main.ts');
const templateString = `<div [inputA]="a + b"></div>`;
const {templateTypeChecker, program} = setup([
{
fileName,
templates: {'Cmp': templateString},
... | {
"end_byte": 41503,
"start_byte": 32278,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts_41511_50082 | describe('pipes', () => {
let templateTypeChecker: TemplateTypeChecker;
let cmp: ClassDeclaration<ts.ClassDeclaration>;
let binding: BindingPipe;
let program: ts.Program;
function setupPipesTest(checkTypeOfPipes = true) {
const fileName = absoluteFrom('/main.ts');
... | {
"end_byte": 50082,
"start_byte": 41511,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts_50088_59061 | describe('input bindings', () => {
it('can get a symbol for empty binding', () => {
const fileName = absoluteFrom('/main.ts');
const dirFile = absoluteFrom('/dir.ts');
const {program, templateTypeChecker} = setup([
{
fileName,
templates: {'Cmp': `<div dir ... | {
"end_byte": 59061,
"start_byte": 50088,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts_59069_67303 | it('can retrieve a symbol for an input of structural directive', () => {
const fileName = absoluteFrom('/main.ts');
const templateString = `<div *ngFor="let user of users"></div>`;
const {program, templateTypeChecker} = setup([
{fileName, templates: {'Cmp': templateString}, declaration... | {
"end_byte": 67303,
"start_byte": 59069,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts_67309_75262 | describe('output bindings', () => {
it('should find symbol for output binding', () => {
const fileName = absoluteFrom('/main.ts');
const dirFile = absoluteFrom('/dir.ts');
const templateString = `<div dir (outputA)="handle($event)" (renamedOutputB)="handle($event)"></div>`;
const {... | {
"end_byte": 75262,
"start_byte": 67309,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts_75268_84400 | describe('for elements', () => {
it('for elements that are components with no inputs', () => {
const fileName = absoluteFrom('/main.ts');
const dirFile = absoluteFrom('/dir.ts');
const {program, templateTypeChecker} = setup([
{
fileName,
templates: {'Cmp':... | {
"end_byte": 84400,
"start_byte": 75268,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts_84406_87698 | it('has correct tcb location for components with TCBs in a type-checking shim file', () => {
const fileName = absoluteFrom('/main.ts');
const {program, templateTypeChecker} = setup([
{
fileName,
templates: {'Cmp': '<div></div>'},
},
]);
const sf = getSourceFil... | {
"end_byte": 87698,
"start_byte": 84406,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/type_checker__get_symbol_of_template_node_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/model_signal_diagnostics_spec.ts_0_421 | /**
* @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 {runInEachFileSystem} from '../../file_system/testing';
import {generateDiagnoseJasmineSpecs, TestCase} from... | {
"end_byte": 421,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/model_signal_diagnostics_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/model_signal_diagnostics_spec.ts_422_8670 | () => {
const bindingCases: TestCase[] = [
{
id: 'static binding',
inputs: {show: {type: 'ModelSignal<boolean>', isSignal: true}},
outputs: {showChange: {type: 'ModelSignal<boolean>'}},
template: `<div dir show="works">`,
expected: [`TestComponent.html(1, 10): Type 'str... | {
"end_byte": 8670,
"start_byte": 422,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/model_signal_diagnostics_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/model_signal_diagnostics_spec.ts_8677_16285 | {
id: 'generic inference and one-way binding to directive, mix of zone input and model',
inputs: {
gen: {
type: 'ModelSignal<T>',
isSignal: true,
},
other: {
type: 'T',
isSignal: false,
},
},
outputs:... | {
"end_byte": 16285,
"start_byte": 8677,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/model_signal_diagnostics_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/model_signal_diagnostics_spec.ts_16292_24184 | {
id: 'generic inference and two-way binding to directive (with `extends boolean`), mix of zone inputs and model',
inputs: {
gen: {
type: 'ModelSignal<T>',
isSignal: true,
},
other: {
type: 'T',
isSignal: false,
},
... | {
"end_byte": 24184,
"start_byte": 16292,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/model_signal_diagnostics_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/model_signal_diagnostics_spec.ts_24191_25957 | {
id: 'WritableSignal binding, invalid',
inputs: {value: {type: 'ModelSignal<boolean>', isSignal: true}},
outputs: {valueChange: {type: 'ModelSignal<boolean>'}},
template: `<div dir [(value)]="val">`,
component: `val!: WritableSignal<string>;`,
expected: [`TestComponent.h... | {
"end_byte": 25957,
"start_byte": 24191,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/model_signal_diagnostics_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/span_comments_spec.ts_0_314 | /**
* @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 {initMockFileSystem} from '../../file_system/testing';
import {tcb, TestDeclaration} from '../testing'; | {
"end_byte": 314,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/span_comments_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/span_comments_spec.ts_316_6513 | describe('type check blocks diagnostics', () => {
beforeEach(() => initMockFileSystem('Native'));
describe('parse spans', () => {
it('should annotate unary ops', () => {
expect(tcbWithSpans('{{ -a }}')).toContain('(-((this).a /*4,5*/) /*4,5*/) /*3,5*/');
});
it('should annotate binary ops', () =... | {
"end_byte": 6513,
"start_byte": 316,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/span_comments_spec.ts"
} |
angular/packages/compiler-cli/src/ngtsc/typecheck/test/span_comments_spec.ts_6519_10590 | it('should annotate chained expressions', () => {
const TEMPLATE = `<div (click)='a; b; c'></div>`;
expect(tcbWithSpans(TEMPLATE)).toContain(
'(((this).a /*14,15*/) /*14,15*/, ((this).b /*17,18*/) /*17,18*/, ((this).c /*20,21*/) /*20,21*/) /*14,21*/',
);
});
it('should annotate pipe u... | {
"end_byte": 10590,
"start_byte": 6519,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/typecheck/test/span_comments_spec.ts"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.