We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://nadesi.com/cgi/kaizen3/index.php?m=thread&threadid=92 より
v3.6.22でも似た感じのが発生しています ローカル変数がundefinedになる
//再現 (v3.6.22) !インデント構文 0.1秒後には Aとは変数 = 「A」 関数A Aを表示 //→undefined ●関数A Bとは変数 = 「B」 関数B Bを表示 //→undefined ●関数B もし0ならば (1/30)秒待つ //(待たない)
ちなみに関数Bで待った場合「B」は表示されます
The text was updated successfully, but these errors were encountered:
上記サンプルの「には」構文を、関数定義の末尾に持っていくと問題なく実行できます。 「には」構文(無名関数)を宣言する時点で、その関数が非同期かどうかが分かっていないのが問題となっています。
理由ですが、ある関数Cで参照した関数Aから呼び出している関数Bが非同期(asyncFn)だったとき、その関数を呼び出す関数Cを非同期で実行する必要があります。
根本的な解決案としては、なでしこのユーザー関数をすべて非同期関数(asyncFn)であると仮定するしかありません。 実行速度が遅くなるデメリットがありますが。
そこで下記の2つの解決作があります。
Sorry, something went wrong.
ちょっと悩むけど、ユーザーにとって、変換され実行される時の関数がasyncかどうかはあまり問題ではないと思うので、上記(2)を採用するのが濃厚かも…。
No branches or pull requests
https://nadesi.com/cgi/kaizen3/index.php?m=thread&threadid=92 より
v3.6.22でも似た感じのが発生しています
ローカル変数がundefinedになる
ちなみに関数Bで待った場合「B」は表示されます
The text was updated successfully, but these errors were encountered: