@HostBinding on a member that is not an identifier ('my-prop') compiles to `ctx.my - ctx.prop`; ngtsc uses `this["my-prop"]`
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 72/100
Rechercherichtung
Start by reading MemberHostBindings::of in directive/metadata.rs and compare its stored member name with ngtsc's getSafePropertyAccessString behavior described in the issue. Trace how that metadata becomes partial and full output, including the non-identifier example. Done means both output forms access my-prop as a property and identifier members such as m still work.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Found while reviewing #682.
ngtsc's extractHostBindings stores a @HostBinding member as getSafePropertyAccessString("this", member.name) (compiler-cli chunk-G5LDCSK3.js:3435): "this.m", or this["my-prop"] for a name that is not an identifier. Oxc's MemberHostBindings::of (directive/metadata.rs:201) stores the bare member name ("m", "my-prop").
@Directive({ selector: '[d]' })
export class D {
@HostBinding('id') 'my-prop' = 1;
@HostBinding('title') m = 2;
}
| result | |
|---|---|
| ngtsc partial | properties: { "id": "this[\"my-prop\"]", "title": "this.m" } |
| Oxc partial | properties:{id:"my-prop",title:"m"} |
| Oxc full | ɵɵdomProperty("id", (ctx.my - ctx.prop))("title", ctx.m) — wrong: parsed as a subtraction |
For identifier names only the partial text differs (both link to ctx.m). For names that are not identifiers, both full and partial output read the wrong value. ngtsc emits ctx["my-prop"].
- Vorherrschende Sprache
- Rust
- Sterne
- 245
- Forks
- 26
- Ø Merge
- 1 T. 42 Min.
- Gemergte PRs (30 T.)
- 83
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus voidzero-dev/oxc-angular-compiler
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
voidzero-dev/oxc-angular-compiler#686 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
voidzero-dev/oxc-angular-compiler#694 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
voidzero-dev/oxc-angular-compiler#693 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
voidzero-dev/oxc-angular-compiler#692 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 43/100
voidzero-dev/oxc-angular-compiler#691 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in voidzero-dev/oxc-angular-compiler
Ähnliche Issues
-
Unit tests use deprecated constant (part 2)Evtl. vergeben @servo-highfive hat das heute übernommen. OffenE-less-complex
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
servo/servo#49766 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue help wanted linux macos testing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
area: app type: test
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug priority: medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
storytold/photocraft#12706 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug priority-low to-agent
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag