Skip to content

Commit 165380c

Browse files
authored
ドキュメントを1.1.0向けにアップデート (#22)
* Update std-math.md * Update std-math.md(en) * Update keywords.md * Update keywords.md(en)
1 parent 1c446a0 commit 165380c

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

docs/en/references/keywords.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ let match = null // Error
1313
print('hoge')
1414
} // Error
1515
```
16+
```aiscript
17+
let obj = {
18+
default: true
19+
} // Since 1.1.0: it works when used as a key in object literals
20+
21+
obj.default = false // Error (property access notation not supported yet)
22+
obj["default"] = false // This works
23+
```
1624

1725
## Words in Use and Words Planned for Use
1826
The keywords `match` and `for` are already used as keywords in the grammar.

docs/en/references/std-math.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ The change in behavior by specifying `options.algorithm` is shown below:
133133
| `rc4_legacy` | RC4 | Range limitation by floating-point arithmetic (pre-0.19.0 algorithm) |
134134
| Not specified, or `chacha20` | ChaCha20 | Rejection Sampling |
135135

136+
**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`.
137+
138+
136139
```aiscript playground
137140
let rng = Math:gen_rng('AICHAN')
138141

docs/ja/references/keywords.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ let match = null // エラー
1212
print('hoge')
1313
} // エラー
1414
```
15+
```aiscript
16+
let obj = {
17+
default: true
18+
} // 1.1.0より、オブジェクトリテラルのキーとしての利用は可能
19+
20+
obj.default = false // エラー(プロパティアクセス記法は未対応)
21+
obj["default"] = false // こちらは可
22+
```
1523

1624
## 使用中の語と使用予定の語
1725
`match``for`は文法中で既にキーワードとして使用されています。

docs/ja/references/std-math.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ _options_ に渡したオブジェクトを通じて、内部の挙動を指定
133133
| `rc4_legacy` | RC4 | 浮動小数点数演算による範囲制限​(0.19.0以前のアルゴリズム) |
134134
| 無指定 または 'chacha20' | ChaCha20 | Rejection Sampling |
135135

136+
なお、**[セキュアコンテクスト](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`に変更されます。
137+
136138
```aiscript playground
137139
let rng = Math:gen_rng('AICHAN')
138140

0 commit comments

Comments
 (0)