Skip to content

enhance: execメソッドのオーバーロードを追加#1029

Open
takejohn wants to merge 3 commits intoaiscript-dev:masterfrom
takejohn:enhance/1028_exec-return-value
Open

enhance: execメソッドのオーバーロードを追加#1029
takejohn wants to merge 3 commits intoaiscript-dev:masterfrom
takejohn:enhance/1028_exec-return-value

Conversation

@takejohn
Copy link
Copy Markdown
Member

What

InterpreterクラスのexecメソッドおよびexecSyncメソッドにオーバーロードを追加しました。
第2引数に以下のプロパティをもつオブジェクトを渡すことができるようになります。
第2引数が渡された場合、渡されたオブジェクトと同名のプロパティをもつオブジェクトを返すようになります。

  • value: trueの場合、返値に最後に評価された式の値を含みます。falseの場合は返値にこの値を含みません。
  • variablesプロパティ: trueの場合、返値にグローバルスコープの全ての変数の値を含みます。文字列の配列である場合、指定された名前をもつ変数の値を含みます。falseの場合は返値にこの値を含みません。

Why

#1028 Scopeに代わるグローバル変数の読み出し方法として

Additional info (optional)

valueプロパティを追加したため、#1028 に出した案とシグネチャが異なります。

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 96.42857% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/interpreter/index.ts 77.77% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Files with missing lines Coverage Δ
src/index.ts 100.00% <100.00%> (ø)
src/interpreter/exec-result.ts 100.00% <100.00%> (ø)
src/interpreter/scope.ts 94.11% <100.00%> (+3.57%) ⬆️
src/utils/iterator.ts 100.00% <100.00%> (ø)
src/interpreter/index.ts 72.10% <77.77%> (-13.70%) ⬇️

... and 27 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants