Accessing JS error object from MiniRacer::EvalError?
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, ruby
- 領域
- backend
調査の方向性
Start by reading the MiniRacer::EvalError and MiniRacer::Context#eval implementation, then inspect the tests for evaluation errors and backtraces. Determine whether the JavaScript error object and its custom attributes can be exposed while preserving source line numbers; done means the issue's use case works without wrapper-induced backtrace offsets. The discussion has had no recent activity, so check its thread before starting.
索引モデルが issue の本文から書いたものです。
説明
I'm wondering how I can access the JavaScript error object from MiniRacer::EvalError.
I want to run script snippets from users and I want to report errors to them. We have some extended attributes on custom errors which I would need to access.
The only way I found to solve this is by wrapping the script before sending it to MiniRacer::Context#eval like this:
wrapper = <<~JS
try {
#{script}
}
catch(err) {
var thrownError = err;
}
JS
context.eval(wrapper)
With this I can access thrownError. But my issue is, that line numbers in backtraces are off. My current solution is to have a map that contains offsets accounting for the wrapper script.
Is there any other way to achieve this?
- 主要言語
- JavaScript
- スター
- 628
- フォーク
- 100
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rubyjs/mini_racer のほかの issue
-
platform: darwin/x86
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rubyjs/mini_racer#388 · コメント 4 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
rubyjs/mini_racer#376 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
rubyjs/mini_racer#353 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
rubyjs/mini_racer#346 · コメント 6 件 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
rubyjs/mini_racer#324 · コメント 1 件 · リアクション 1 件 ·
rubyjs/mini_racer の issue をすべて見る
似ている issue
-
Clinic sharing: fast sync refusal message suggests Delete Data, which only developer builds haveオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
avniproject/avni-client#2228 ·
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
open-webui/open-webui#33196 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
fable-compiler/Fable#5157 ·
メンテナーはふだん 1 日以内に返信
-
New tool: PaperBanana対応中かも @github-actions が今日担当しました。 オープンsubmission triage
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
kausalflow/tools#243 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: apple-music area: build-release bug effort: small priority: high
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ChristianTabor/Argon#32 ·
メンテナーはふだん 1 日以内に返信