Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSプラグインで定義された関数の関数オブジェクトが「{関数}」で取得できるが、「JSオブジェクト取得」では取得できない #1972

Open
mikecat opened this issue Feb 23, 2025 · 1 comment

Comments

@mikecat
Copy link
Contributor

mikecat commented Feb 23, 2025

なでしこ3簡易エディタ (v3.7.1) で

!「https://n3s.nadesi.com/plain/nadesiko3-hello.js」を取り込む
「挨拶テスト」のJSオブジェクト取得。
それを実行。

を実行すると、何も起きませんでした。
「実行」のかわりに「表示」を行ったところ、「JSオブジェクト取得」の結果が null になっていました。

また、

!「https://n3s.nadesi.com/plain/nadesiko3-hello.js」を取り込む
{関数}挨拶テストを実行。

を実行すると期待通り「こんにちは!」というダイアログが出ました。

「JSオブジェクト取得」の説明は

なでしこで定義した関数や変数nameのJavaScriptオブジェクトを取得する

となっており、JSプラグインの関数はなでしこで定義していないので対象外なのかもしれませんが、「{関数}」の仕様と合わせるために取得できるようにすることを提案します。

@kujirahand
Copy link
Owner

なでしこ3で定義した関数には、ネームスペースが自動付与されます。
下記のように、グローバル関数一覧取得すると関数一覧を表示できます。

!「https://n3s.nadesi.com/plain/nako3hello.nako3」を取り込む
「nako3hello__挨拶テスト」のJSオブジェクト取得。
それを実行。
# ---
グローバル関数一覧取得して反復
  対象を表示
ここまで。

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

No branches or pull requests

2 participants