Skip to content

Commit d99ab0e

Browse files
crisbetomattrbeck
authored andcommitted
fix(compiler): stop generating unused field
Fixes that the compiler was generating an `attrs` field on the definition which isn't used anywhere.
1 parent 814eaba commit d99ab0e

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

packages/compiler/src/render3/view/compiler.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import {ConstantPool} from '../../constant_pool';
1010
import * as core from '../../core';
11-
import {CssSelector} from '../../directive_matching';
1211
import * as o from '../../output/output_ast';
1312
import {ParseError, ParseSourceSpan} from '../../parse_util';
1413
import {ShadowCss} from '../../shadow_css';
@@ -194,28 +193,6 @@ export function compileComponentFromMetadata(
194193
const definitionMap = baseDirectiveFields(meta, constantPool, bindingParser);
195194
addFeatures(definitionMap, meta);
196195

197-
const selector = meta.selector && CssSelector.parse(meta.selector);
198-
const firstSelector = selector && selector[0];
199-
200-
// e.g. `attr: ["class", ".my.app"]`
201-
// This is optional an only included if the first selector of a component specifies attributes.
202-
if (firstSelector) {
203-
const selectorAttributes = firstSelector.getAttrs();
204-
if (selectorAttributes.length) {
205-
definitionMap.set(
206-
'attrs',
207-
constantPool.getConstLiteral(
208-
o.literalArr(
209-
selectorAttributes.map((value) =>
210-
value != null ? o.literal(value) : o.literal(undefined),
211-
),
212-
),
213-
/* forceShared */ true,
214-
),
215-
);
216-
}
217-
}
218-
219196
// e.g. `template: function MyComponent_Template(_ctx, _cm) {...}`
220197
const templateTypeName = meta.name;
221198

0 commit comments

Comments
 (0)