mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(compiler-cli): validate @content block placement
Adds validation to verify that `@content` blocks are only used as direct children of foreign components. Specifically: - Defines a new compile diagnostic code `INVALID_CONTENT_PLACEMENT = 8026`. - Updates `ForeignComponentFeatureAnalyzer` to traverse content blocks and report `INVALID_CONTENT_PLACEMENT` diagnostics if they are placed incorrectly. - Removes the raw error thrown during ingestion in `packages/compiler/src/template/pipeline/src/ingest.ts`. - Adds integration tests in `template_typecheck_spec.ts`.
This commit is contained in:
@@ -81,6 +81,7 @@ export enum ErrorCode {
|
||||
INLINE_TYPE_CTOR_REQUIRED = 8901,
|
||||
INTERPOLATED_SIGNAL_NOT_INVOKED = 8109,
|
||||
INVALID_BANANA_IN_BOX = 8101,
|
||||
INVALID_CONTENT_PLACEMENT = 8026,
|
||||
LET_USED_BEFORE_DEFINITION = 8016,
|
||||
LOCAL_COMPILATION_UNRESOLVED_CONST = 11001,
|
||||
LOCAL_COMPILATION_UNSUPPORTED_EXPRESSION = 11003,
|
||||
|
||||
Reference in New Issue
Block a user