@HostBinding on a member that is not an identifier ('my-prop') compiles to `ctx.my - ctx.prop`; ngtsc uses `this["my-prop"]`
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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"].
- 主要言語
- Rust
- スター
- 245
- フォーク
- 26
- 平均マージ
- 1日 42分
- マージ済み PR(30日)
- 83
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
voidzero-dev/oxc-angular-compiler のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
voidzero-dev/oxc-angular-compiler#686 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
voidzero-dev/oxc-angular-compiler#694 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
voidzero-dev/oxc-angular-compiler#693 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
voidzero-dev/oxc-angular-compiler#692 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 43/100
voidzero-dev/oxc-angular-compiler#691 ·
メンテナーはふだん 1 日以内に返信
voidzero-dev/oxc-angular-compiler の issue をすべて見る
似ている issue
-
bug good first issue help wanted linux macos testing
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
area: app type: test
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
storytold/photocraft#12706 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
IngvarConsulting/unica#2822 ·
メンテナーはふだん 1 日以内に返信