diff --git a/docs/en/references/keywords.md b/docs/en/references/keywords.md index a320863..bdcea51 100644 --- a/docs/en/references/keywords.md +++ b/docs/en/references/keywords.md @@ -13,6 +13,14 @@ let match = null // Error print('hoge') } // Error ``` +```aiscript +let obj = { + default: true +} // Since 1.1.0: it works when used as a key in object literals + +obj.default = false // Error (property access notation not supported yet) +obj["default"] = false // This works +``` ## Words in Use and Words Planned for Use The keywords `match` and `for` are already used as keywords in the grammar. diff --git a/docs/en/references/std-math.md b/docs/en/references/std-math.md index dda4344..93579f8 100644 --- a/docs/en/references/std-math.md +++ b/docs/en/references/std-math.md @@ -133,6 +133,9 @@ The change in behavior by specifying `options.algorithm` is shown below: | `rc4_legacy` | RC4 | Range limitation by floating-point arithmetic (pre-0.19.0 algorithm) | | Not specified, or `chacha20` | ChaCha20 | Rejection Sampling | +**Note:** In JavaScript environments where [`crypto`](https://developer.mozilla.org/en-US/docs/Web/API/Window/crypto)[`.subtle`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle) is not available—such as in non-[secure contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts)—only `rc4_legacy` can be used, and the default will also be changed to `rc4_legacy`. + + ```aiscript playground let rng = Math:gen_rng('AICHAN') diff --git a/docs/ja/references/keywords.md b/docs/ja/references/keywords.md index abb926f..4b4e3cc 100644 --- a/docs/ja/references/keywords.md +++ b/docs/ja/references/keywords.md @@ -12,6 +12,14 @@ let match = null // エラー print('hoge') } // エラー ``` +```aiscript +let obj = { + default: true +} // 1.1.0より、オブジェクトリテラルのキーとしての利用は可能 + +obj.default = false // エラー(プロパティアクセス記法は未対応) +obj["default"] = false // こちらは可 +``` ## 使用中の語と使用予定の語 `match`や`for`は文法中で既にキーワードとして使用されています。 diff --git a/docs/ja/references/std-math.md b/docs/ja/references/std-math.md index 6aaaab9..1a38a5e 100644 --- a/docs/ja/references/std-math.md +++ b/docs/ja/references/std-math.md @@ -133,6 +133,8 @@ _options_ に渡したオブジェクトを通じて、内部の挙動を指定 | `rc4_legacy` | RC4 | 浮動小数点数演算による範囲制限​(0.19.0以前のアルゴリズム) | | 無指定 または 'chacha20' | ChaCha20 | Rejection Sampling | +なお、**非[セキュアコンテクスト](https://developer.mozilla.org/ja/docs/Web/Security/Secure_Contexts)などの[`crypto`](https://developer.mozilla.org/ja/docs/Web/API/Window/crypto)[`.subtle`](https://developer.mozilla.org/ja/docs/Web/API/Crypto/subtle)が利用できないJavascript環境下では`rc4_legacy`のみが利用可能**となり、デフォルトも`rc4_legacy`に変更されます。 + ```aiscript playground let rng = Math:gen_rng('AICHAN')