`JSError.ThrowTypeError` / `ThrowRangeError` / `ThrowSyntaxError` throw a plain `Error`
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 58/100
調査の方向性
Start with the string overloads in src/NodeApi/JSError.cs and compare them with the typed throw methods available on JSRuntime. Change each overload to call the matching runtime method. The issue mentions a PR test checking name, instanceof, message and code; use those checks to confirm all four error types behave as expected.
索引モデルが issue の本文から書いたものです。
説明
The string overloads of the typed throw helpers in src/NodeApi/JSError.cs all call JSRuntime.ThrowError:
public static void ThrowTypeError(string message)
=> JSValue.GetCurrentRuntime(out napi_env env).ThrowError(env, code: null, message); // should be ThrowTypeError
The same applies to ThrowTypeError(code, message), ThrowRangeError(message), ThrowRangeError(code, message), ThrowSyntaxError(message) and ThrowSyntaxError(code, message). JS therefore receives an Error:
try { dotnetCallbackThatCallsThrowTypeError(); }
catch (e) {
e instanceof TypeError; // false
e.name; // 'Error'
}
JSRuntime already has ThrowTypeError, ThrowRangeError and ThrowSyntaxError (napi_throw_type_error, napi_throw_range_error, node_api_throw_syntax_error); they just are not called. Fix: call the matching runtime method. I have a PR with a test that checks name, instanceof, message and code for all four error types.
Version: main (54d2b74), 0.9.21 and 0.9.28.
- 主要言語
- C#
- スター
- 789
- フォーク
- 81
- 平均マージ
- 34分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/node-api-dotnet のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
microsoft/node-api-dotnet#484 · コメント 1 件 ·
-
Embedding args occasionally get trailing garbage on .NET (missing null terminator on a pooled buffer)対応中かも @tolmachev-pravo が 106 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/node-api-dotnet#481 ·
-
`PooledBuffer.FromStringUtf8`/`FromSpanUtf8` never write the NUL terminator → garbage in JS error messages and linked module names on .NET対応中かも @r-Larch が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 30/100
microsoft/node-api-dotnet#508 ·
-
JSError.ThrowError(Exception) aborts the process when a Worker terminates during a .NET call対応中かも @GalaxiasKyklos が 15 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
microsoft/node-api-dotnet#505 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
microsoft/node-api-dotnet#504 ·
microsoft/node-api-dotnet の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Live-Charts/LiveCharts2#2403 ·
-
Rework budget never counts Claude review rounds: review comments lack the claude-code-review markerオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
thomhurst/AsyncSemaphore#618 ·
メンテナーはふだん 1 日以内に返信
-
Importer: an empty or non-numeric Error cell is imported as 0 instead of missing対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Open-Systems-Pharmacology/OSPSuite.Core#3049 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
dotansimha/graphql-code-generator#11079 ·
メンテナーはふだん 1 日以内に返信