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

Feature/1479 fix ecma url #1487

Merged
merged 4 commits into from
Oct 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .textlintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ module.exports = {
"https://github.com/asciidwango/js-primer/issues/new?*",
"https://goo.gl/**",
"https://forms.gle/**",
"http://localhost:3000/**",
// .es が正式なのか不明であるため
// https://github.com/tc39/ecma262/pull/1576
"https:/tc39.github.io/**"
"http://localhost:3000/**"
]
}
: false
Expand Down
2 changes: 1 addition & 1 deletion meetings/2017-07-21/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

- @azu: 例外的なケースが多すぎる気がする
- 仕様のNoteが6つもある
- <https://tc39.github.io/ecma262/#sec-json.stringify>
- <https://tc39.es/ecma262/#sec-json.stringify>
- これはTableなどで対応をまとめて書いたほうが楽なのでは?

| 種類 | シリアライズ結果 |
Expand Down
2 changes: 1 addition & 1 deletion meetings/2017-09-28/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
- throw = 例外を発生させる構文
- Error = エラーを表現するために標準化されているオブジェクト
- @azu: この章ではこういう定義ですという形でやらないとダメそう。
- @azu: あとはdebugger; https://tc39.github.io/ecma262/#sec-debugger-statement か
- @azu: あとはdebugger; https://tc39.es/ecma262/#sec-debugger-statement か
- これECMAScriptの仕様にあるんだな。
- Promiseと同じでイベントは飛ぶから後は実行環境で何かしてみたいな感じ
- 省いても良さそう。
Expand Down
14 changes: 7 additions & 7 deletions source/OUTLINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ console.log(array.slice(4, 1)); // => []
- 分類: グローバルスコープ
- global
- [x] 確認: 仕様ではどのような言及
- https://tc39.github.io/ecma262/#sec-global-environment-records
- https://tc39.es/ecma262/#sec-global-environment-records
- 分類: ブロックスコープ
- 機能: スコープチェイン
- 名前解決: スコープ間で同じ変数の定義とshadowing
Expand Down Expand Up @@ -595,21 +595,21 @@ console.log(array.slice(4, 1)); // => []
- scopeによって定義されたenvironment
- EnvironmentはRecordから構成される
- inner env -> outer envによりスコープチェインという現象が起きる
- <https://tc39.github.io/ecma262/#sec-lexical-environments>
- <https://tc39.es/ecma262/#sec-lexical-environments>
- Scope chain
- https://tc39.github.io/ecma262/#sec-newdeclarativeenvironment
- https://tc39.es/ecma262/#sec-newdeclarativeenvironment
- スコープを作成するときにouter lexicale envへのリファレンスを
- A global environment is a Lexical Environment
- GlobalもLexicalの一種
- globalはouterがnull
- Envの種類
- <https://tc39.github.io/ecma262/#table-23>
- <https://tc39.es/ecma262/#table-23>
- LexicalEnv
- letやconst、classはこちらに登録する
- https://tc39.github.io/ecma262/#sec-let-and-const-declarations
- https://tc39.es/ecma262/#sec-let-and-const-declarations
- VariableEnv
- varはこちらに登録する
- https://tc39.github.io/ecma262/#sec-variable-statement
- https://tc39.es/ecma262/#sec-variable-statement
- この2つのenvは同じことがあり、実行Contextに紐づく
- module environment もあるよ
- module envはglobal envとなることがある
Expand Down Expand Up @@ -664,7 +664,7 @@ function getValue(variableName, currentScope) {
## Arrow Functionとthis

- Arrow Functionでは`this`が`[[ThisMode]]`が`lexical`になる
- https://tc39.github.io/ecma262/#sec-functioninitialize
- https://tc39.es/ecma262/#sec-functioninitialize
- lexicalではもっとも近いfunctionを参照するようになる =

## 削った章
Expand Down
8 changes: 4 additions & 4 deletions source/basic/async/OUTLINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
## 仕様

- PendingJob
- https://tc39.github.io/ecma262/#sec-enqueuejob
- https://tc39.es/ecma262/#sec-enqueuejob
- https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
- ECMAScript と DOM
- https://html.spec.whatwg.org/multipage/webappapis.html#integration-with-the-javascript-job-queue
Expand Down Expand Up @@ -333,9 +333,9 @@ try{
- return or awaitについて
- 仕様
- `async function`では`[[FunctionKind]]`が`async`の関数を作成する
- https://tc39.github.io/ecma262/#sec-createdynamicfunction
- https://tc39.es/ecma262/#sec-createdynamicfunction
- 必ずPromiseを返す
- <https://tc39.github.io/ecma262/#sec-async-function-definitions-EvaluateBody>
- <https://tc39.es/ecma262/#sec-async-function-definitions-EvaluateBody>
- Generatorで再現できるけど、Async FunctionはGeneratorとは関係ない仕様
- 未使用
- TODO: AgentとJob Queueと実行コンテキスト解説
Expand Down Expand Up @@ -381,7 +381,7 @@ Promise本から抽出した内容
- Promiseは統一したインタフェースがあることについて
- [1.2. Promise Overview](http://azu.github.io/promises-book/#promises-overview)
- コンストラクタ、インスタンスメソッド、静的メソッド
- Promiseの3つの状態 [`[[PromiseState]]`](https://tc39.github.io/ecma262/#table-59)
- Promiseの3つの状態 [`[[PromiseState]]`](https://tc39.es/ecma262/#table-59)
- fulfilled => onFulfilled
- rejected => onRejectedの対応
- Pending
Expand Down
8 changes: 4 additions & 4 deletions source/basic/class/OUTLINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
- 未使用
- `instanceof`演算子は`__proto__`と`prototype`の比較
- https://www.slideshare.net/zhiyelee/protoandprototype
- https://tc39.github.io/ecma262/#sec-ordinaryhasinstance
- https://tc39.es/ecma262/#sec-ordinaryhasinstance
- new演算子は何をやっているのかについて
- メソッドはnewできない件について
- クラスとtypeofの結果
Expand Down Expand Up @@ -357,11 +357,11 @@ C(); // => TypeError

これって意外にも `[[Call]]` で クラスのコンストラクタ関数は呼び出すと例外を投げるって書いてあるんだ。てっきり定義するときに例外を投げる関数を登録みたいな感じだと思ってた。

- [Runtime Semantics: ClassDefinitionEvaluation](https://tc39.github.io/ecma262/#sec-runtime-semantics-classdefinitionevaluation "Runtime Semantics: ClassDefinitionEvaluation")
- [Runtime Semantics: ClassDefinitionEvaluation](https://tc39.es/ecma262/#sec-runtime-semantics-classdefinitionevaluation "Runtime Semantics: ClassDefinitionEvaluation")
- `class`で定義した場合
- [MakeClassConstructor ( F )](https://tc39.github.io/ecma262/#sec-makeclassconstructor "MakeClassConstructor ( F )")
- [MakeClassConstructor ( F )](https://tc39.es/ecma262/#sec-makeclassconstructor "MakeClassConstructor ( F )")
- このコンストラクタ関数の`[[FunctionKind]]`が`classConstructor`になる
- [`[[Call]] ( thisArgument, argumentsList )`](https://tc39.github.io/ecma262/#sec-ecmascript-function-objects-call-thisargument-argumentslist)
- [`[[Call]] ( thisArgument, argumentsList )`](https://tc39.es/ecma262/#sec-ecmascript-function-objects-call-thisargument-argumentslist)
- `[[FunctionKind]]`が`classConstructor`な関数は`TypeError`を投げる


Expand Down
6 changes: 3 additions & 3 deletions source/basic/class/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ Arrayの`length`プロパティは、`length`プロパティへ値を代入し
<!-- Note:

- 仕様的にもIf newLen ≥ oldLenでは`length`だけを変更している
- <https://tc39.github.io/ecma262/#sec-arraysetlength>
- <https://tc39.es/ecma262/#sec-arraysetlength>

-->

Expand Down Expand Up @@ -1577,9 +1577,9 @@ console.log(child instanceof Child); // => true
<!-- Note: instanceof演算子とは`[[Prototype]]`プロパティ

- `instanceof`演算子は`[[Prototype]]`プロパティを見ている
- <https://tc39.github.io/ecma262/#sec-ordinaryhasinstance>
- <https://tc39.es/ecma262/#sec-ordinaryhasinstance>
- `Symbol.hasInstance`によって詳細は変わるため絶対とは言い切れない
- <https://tc39.github.io/ecma262/#sec-symbol.hasinstance>
- <https://tc39.es/ecma262/#sec-symbol.hasinstance>

-->

Expand Down
2 changes: 1 addition & 1 deletion source/basic/ecmascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ES5.1からES2015がでるまで4年もの歳月がかかっているのに対
## Living StandardとなるECMAScript {#living-standard}

現在、ECMAScriptの仕様書のドラフトはGitHub上の[tc39/ecma262][]で管理されており、日々更新されています。
そのため、本当の意味での最新のECMAScript仕様は<https://tc39.github.io/ecma262/>となります。
そのため、本当の意味での最新のECMAScript仕様は<https://tc39.es/ecma262/>となります。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 本文的な変更箇所

このように更新ごとにバージョン番号をつけずに、常に最新版を公開する仕様のことを**Living Standard**と呼びます。

ECMAScriptはLiving Standardですが、これに加えてECMAScript 2017のようにバージョン番号をつけたものも公開されています。
Expand Down
18 changes: 9 additions & 9 deletions source/basic/function-scope/OUTLINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
- global
- ビルトインオブジェクトが参照できるのもスコープチェイン仕組みによる
- [x] 確認: 仕様ではどのような言及
- https://tc39.github.io/ecma262/#sec-global-environment-records
- https://tc39.es/ecma262/#sec-global-environment-records
- @名前解決 スコープ間で同じ変数の定義とshadowingの問題
- スコープチェインの仕組みを理解するとなぜ起きるのかが分かる
- @コラム スコープは小さく、変数の影響範囲は小さく
Expand Down Expand Up @@ -132,21 +132,21 @@ console.log(obj);// => {}
- scopeによって定義されたenvironment
- EnvironmentはRecordから構成される
- inner env -> outer envによりスコープチェインという現象が起きる
- <https://tc39.github.io/ecma262/#sec-lexical-environments>
- <https://tc39.es/ecma262/#sec-lexical-environments>
- Scope chain
- https://tc39.github.io/ecma262/#sec-newdeclarativeenvironment
- https://tc39.es/ecma262/#sec-newdeclarativeenvironment
- スコープを作成するときにouter lexicale envへのリファレンスを
- A global environment is a Lexical Environment
- GlobalもLexicalの一種
- globalはouterがnull
- Envの種類
- <https://tc39.github.io/ecma262/#table-23>
- <https://tc39.es/ecma262/#table-23>
- LexicalEnv
- letやconst、classはこちらに登録する
- https://tc39.github.io/ecma262/#sec-let-and-const-declarations
- https://tc39.es/ecma262/#sec-let-and-const-declarations
- VariableEnv
- varはこちらに登録する
- https://tc39.github.io/ecma262/#sec-variable-statement
- https://tc39.es/ecma262/#sec-variable-statement
- この2つのenvは同じことがあり、実行Contextに紐づく
- module environment もあるよ
- module envはglobal envとなることがある
Expand Down Expand Up @@ -175,7 +175,7 @@ const fnScope = {
outer: globalScope, // <= 現在の実装スコープ = globalScope
envRec: new Map() // <= envRecはスコープ毎に作られる
// Object.create(null) = arguments
// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject
// https://tc39.es/ecma262/#sec-createmappedargumentsobject
};
// function fnの中の変数処理
// `arg` 仮引数はfnScopeのenvRecに記録される
Expand Down Expand Up @@ -203,7 +203,7 @@ function getValue(variableName, currentScope) {
## Arrow Functionとthis

- Arrow Functionでは`this`が`[[ThisMode]]`が`lexical`になる
- https://tc39.github.io/ecma262/#sec-functioninitialize
- https://tc39.es/ecma262/#sec-functioninitialize
- lexicalではもっとも近いfunctionを参照するようになる =


Expand Down Expand Up @@ -401,7 +401,7 @@ function submit(data){
- https://twitter.com/azu_re/status/911872145252159488
- https://twitter.com/azu_re/status/911874213971034112
- varで宣言された変数はLetのLexicalEnviromentとは異なり、VariableEnvironmentに紐づく
- https://tc39.github.io/ecma262/#sec-execution-contexts``
- https://tc39.es/ecma262/#sec-execution-contexts``
- @具体例 巻き上げられた処理の擬似コード
- @事実 巻き上げはもっとも近くの関数スコープまたはグローバルスコープに変数が紐づく
- つまりブロックスコープを無視します
Expand Down
14 changes: 7 additions & 7 deletions source/basic/function-scope/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ console.log(x); // => ReferenceError: x is not defined

関数の宣言
- Set F.[[FormalParameters]] to ParameterList.
- https://tc39.github.io/ecma262/#sec-functioninitialize
- https://tc39.es/ecma262/#sec-functioninitialize
- function objectの[[Environment]]ではなく、[[FormalParameters]]に代入される
- 仮引数は関数のスコープではなくfunction objectに紐づく

関数の初期化処理
- https://tc39.github.io/ecma262/#sec-functiondeclarationinstantiation
- https://tc39.es/ecma262/#sec-functiondeclarationinstantiation
- [[FormalParameters]]は初期化時に`varEnv`に対して代入される
- つまり、仮引数はvarで宣言しているのと同じになる
- スコープという意味では内側のみから参照でき、外からは参照できないという点で同じ
Expand Down Expand Up @@ -121,11 +121,11 @@ console.log(x); // => ReferenceError: x is not defined

<!-- Notes: ブロックスコープと仕様

- ブロック`{}`は新しい[NewDeclarativeEnvironment](https://tc39.github.io/ecma262/#sec-newdeclarativeenvironment "NewDeclarativeEnvironment")を作成する
- ブロック`{}`は新しい[NewDeclarativeEnvironment](https://tc39.es/ecma262/#sec-newdeclarativeenvironment "NewDeclarativeEnvironment")を作成する
- つまり、新しいLexicalEnvironmentというスコープを作成している
- https://tc39.github.io/ecma262/#sec-block-runtime-semantics-evaluation
- https://tc39.es/ecma262/#sec-block-runtime-semantics-evaluation
- そして評価する際に、そのブロック内に宣言されている変数をスコープに対してひもづけている
- https://tc39.github.io/ecma262/#sec-blockdeclarationinstantiation
- https://tc39.es/ecma262/#sec-blockdeclarationinstantiation

-->

Expand Down Expand Up @@ -293,10 +293,10 @@ fn();

<!-- Notes: global objectとbuilt-in object

- global object: https://tc39.github.io/ecma262/#sec-global-object
- global object: https://tc39.es/ecma262/#sec-global-object
- `global`でアクセスできる予定 https://github.com/tc39/proposal-global
- Arrayなどもglobal objectのプロパティの一種
- builtin object: https://tc39.github.io/ecma262/#sec-built-in-object
- builtin object: https://tc39.es/ecma262/#sec-built-in-object
- ECMAScriptの定義したものと実装が加えたオブジェクトをまとめた用語
- 仕様どおりの定義で言えば、紹介してる`undefined`などはあくまでglobal objectのプロパティ
- `global`を使ってプロパティとしてアクセスする方法は言及していないので省略している
Expand Down
2 changes: 1 addition & 1 deletion source/basic/function-this/Notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ Notes: `const fn = () => this` はChrome64.0.3282.3では壊れている

## Reference

- https://tc39.github.io/ecma262/#sec-arrow-function-definitions-runtime-semantics-evaluation
- https://tc39.es/ecma262/#sec-arrow-function-definitions-runtime-semantics-evaluation
- https://esdiscuss.org/topic/clarification-regarding-top-level-arrow-functions-and-this-arguments
26 changes: 13 additions & 13 deletions source/basic/function-this/OUTLINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
- `argument`、`super`、`this`、`new.target`を束縛
- Arrow Function
- `argument`、`super`、`this`、`new.target`を束縛しない
- <https://tc39.github.io/ecma262/#prod-asi-rules-ArrowFunction>
- <https://tc39.es/ecma262/#prod-asi-rules-ArrowFunction>
- Strict Mode、Module Contextの細かい違い
- Top Levelの`this`が違う

Expand Down Expand Up @@ -319,30 +319,30 @@ class K {}

`this` bindingの設定は関数を呼ぶときに次のルートで決定される

- https://tc39.github.io/ecma262/#sec-evaluatecall
- https://tc39.github.io/ecma262/#sec-call
- https://tc39.github.io/ecma262/#sec-ecmascript-function-objects-call-thisargument-argumentslist
- https://tc39.github.io/ecma262/#sec-ordinarycallbindthis
- https://tc39.es/ecma262/#sec-evaluatecall
- https://tc39.es/ecma262/#sec-call
- https://tc39.es/ecma262/#sec-ecmascript-function-objects-call-thisargument-argumentslist
- https://tc39.es/ecma262/#sec-ordinarycallbindthis

Write: 関数呼び出するときに、事前に`[[ThisValue]]`を決める処理が実行される。
`[[ThisValue]]`には次のステップの結果が入る。(ただしArrow Functionはlexicalなので`[[ThisValue]]`を持たない。[Arrow Functionの詳細](https://tc39.github.io/ecma262/#sec-ordinarycallbindthis))
`[[ThisValue]]`には次のステップの結果が入る。(ただしArrow Functionはlexicalなので`[[ThisValue]]`を持たない。[Arrow Functionの詳細](https://tc39.es/ecma262/#sec-ordinarycallbindthis))

- [12.3.4.2Runtime Semantics: EvaluateCall(func, ref, arguments, tailPosition )](https://tc39.github.io/ecma262/#sec-evaluatecall "12.3.4.2Runtime Semantics: EvaluateCall(func, ref, arguments, tailPosition )")
- [12.3.4.2Runtime Semantics: EvaluateCall(func, ref, arguments, tailPosition )](https://tc39.es/ecma262/#sec-evaluatecall "12.3.4.2Runtime Semantics: EvaluateCall(func, ref, arguments, tailPosition )")
- プロパティならば
- `this`はGetThisValueの結果
- `super.prop`なら
- `super`となる
- それ以外なら
- [6.2.4.1GetBase ( V )](https://tc39.github.io/ecma262/#sec-getbase "6.2.4.1GetBase ( V )")の結果 - いわゆるレシーバが`this`となる
- それ以外(ただの関数呼び出し)なら[WithBaseObject](https://tc39.github.io/ecma262/#sec-object-environment-records-withbaseobject)の結果
- [6.2.4.1GetBase ( V )](https://tc39.es/ecma262/#sec-getbase "6.2.4.1GetBase ( V )")の結果 - いわゆるレシーバが`this`となる
- それ以外(ただの関数呼び出し)なら[WithBaseObject](https://tc39.es/ecma262/#sec-object-environment-records-withbaseobject)の結果
- withの場合
- with bingingの値
- それ以外
- undefined

Read: `this`を読み取るときは、次のステップで探索する。

- https://tc39.github.io/ecma262/#sec-getthisenvironment
- https://tc39.es/ecma262/#sec-getthisenvironment
- `this`の解決はスコープと同じく、一個つづ順に内側から外側へ探すのはスコープと同じ
- ただし、Arrow Functionは`[[ThisValue]]`を持たないので必ずスキップされる
- つまり、もっと近いコンテキストの`[[ThisValue]]`の値が`this`となる
Expand Down Expand Up @@ -378,7 +378,7 @@ Read: `this`を読み取るときは、次のステップで探索する。
仕様としても`[[Call]]`には`this`を引数として渡している。
これは`call`メソッドを使うことで明示的に渡すことができる。

- https://tc39.github.io/ecma262/#sec-call
- https://tc39.es/ecma262/#sec-call


### `this` in the future
Expand Down Expand Up @@ -414,7 +414,7 @@ console.log(m()); => undefined

1. `o.m` ではなく `m()`で実行されている
2. `m`は関数なので、実行するときに`m`のFunction Envの`[[ThisValue]]`には値が設定される
3. <https://tc39.github.io/ecma262/#sec-evaluatecall>
3. <https://tc39.es/ecma262/#sec-evaluatecall>
3. この時の`[[ThisValue]]`は`m`がプロパティではないので、`Let thisValue be refEnv.WithBaseObject().`となる
4. `WithBaseObject`は`with`じゃないなら`undefined`となる
5. つまり`thisValue`は`undefined`となる
Expand All @@ -435,7 +435,7 @@ console.log(m()); => undefined

YES

- <https://tc39.github.io/ecma262/#sec-call>
- <https://tc39.es/ecma262/#sec-call>
- `[[Call]]`において暗黙的渡された`V`が`This`です

## 開眼JavaScriptの`this`の章
Expand Down
2 changes: 1 addition & 1 deletion source/basic/string/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ console.log("¯\\_(ツ)_/¯");
// ¯\_(ツ)_/¯ と表示される
```

<!-- Note: https://tc39.github.io/ecma262/#prod-NonEscapeCharacter
<!-- Note: https://tc39.es/ecma262/#prod-NonEscapeCharacter

- 指定外の組み合わせもNonEscapeCharacterとして扱われ構文的には無害
- 単純に \ がないように使われる。
Expand Down