Skip to content

semicola to terminate function expressions #336

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

Merged
merged 2 commits into from
Dec 30, 2016
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
6 changes: 3 additions & 3 deletions doc/by/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
// this спасылаецца на глабальны аб'ект
}
test();
}
};

Памылковым меркаваннем будзе тое, што `this` унутры `test` будзе спасылацца на
`Foo`; Але на самрэч **гэта не так**.
Expand All @@ -76,7 +76,7 @@
// Тут выкарыстоўвайце self замест this
}
test();
}
};

`self` гэта звычайнае імя пераменнай, але яно часта выкарыстоўваецца для спасылкі
на знешні `this`. У камбінацыі з [замыканнямі](#function.closures), яно можа быць
Expand All @@ -90,7 +90,7 @@
// this цяпер спасылаецца на Foo
}.bind(this);
test();
}
};

### Прысвойванне метадаў

Expand Down
6 changes: 3 additions & 3 deletions doc/en/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ mis-design of the language because it **never** has any practical use.
// this is set to the global object
}
test();
}
};

A common misconception is that `this` inside of `test` refers to `Foo`; while in
fact, it **does not**.
Expand All @@ -77,7 +77,7 @@ local variable inside of `method` that refers to `Foo`.
// Use self instead of this here
}
test();
}
};

`self` is just a normal variable name, but it is commonly used for the reference to an
outer `this`. In combination with [closures](#function.closures), it can also
Expand All @@ -90,7 +90,7 @@ As of ECMAScript 5 you can use the `bind` method combined with an anonymous func
// this now refers to Foo
}.bind(this);
test();
}
};

### Assigning Methods

Expand Down
4 changes: 2 additions & 2 deletions doc/es/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ mal diseño del lenguaje, ya que **nunca** tiene un uso práctico.
// this es establecido como un objeto global
}
test();
}
};

Un error común es que `this` dentro de `test` haga referencia a `Foo`, mientras que en
realidad esto **no es así**.
Expand All @@ -77,7 +77,7 @@ dentro del `método` para referirse a `Foo`.
// Use that instead of this here
}
test();
}
};

`that` es justo un nombre normal, pero es comúnmente usado para referenciar a `this`
de forma externa. En combinación con [closures](#function.closures), esto puede ser
Expand Down
4 changes: 2 additions & 2 deletions doc/fi/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Useimmat näistä tapauksista ovat järkeviä. Ensimmäistä niistä tosin voida
// this asettuu globaaliin olioon
}
test();
}
};

Yleisesti luullaan, että test-funktion sisältämä `this` viittaa tässä tapauksessa `Foo`-olioon. Todellisuudessa se **ei** kuitenkaan tee näin.

Expand All @@ -63,7 +63,7 @@ Jotta `Foo`-olioon voidaan päästä käsiksi `test`-funktion sisällä, tulee m
// Käytä thatia thissin sijasta
}
test();
}
};

`that` on normaali nimi, jota käytetään yleisesti viittaamaan ulompaan `this`-muuttujaan. [Sulkeumia](#function.closures) käytettäessä `this`-arvoa voidaan myös välittää edelleen.

Expand Down
6 changes: 3 additions & 3 deletions doc/fr/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Bien que la plupart de ces cas ont du sens, le premier cas peut être considér
// this réfère à l'objet global
}
test();
}
};

Une autre erreur souvent commise est que `this` l'intérieur de `test` se réfère à `foo`; ce qui n'est **pas** du tout le cas.

Expand All @@ -64,7 +64,7 @@ Pour accéder à `foo` de l'intérieur de `test`, vous pouvez créer une variabl
// Utilisez self au lieu de this ici
}
test();
}
};

`self` est juste une variable normale, couramment utilisée pour référencer un `this` extérieur. Combiné avec des [fermetures](# function.closures) "closures", on peut l'utiliser pour passer les valeurs de `this`.

Expand All @@ -75,7 +75,7 @@ Pour accéder à `foo` de l'intérieur de `test`, vous pouvez créer une variabl
// maintenant, this réfère à Foo
}.bind(this);
test();
}
};

### Assignement de méthodes

Expand Down
4 changes: 2 additions & 2 deletions doc/hu/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ praktikus felhasználási módja.
// A this itt a globális ojjektum.
}
test();
}
};

Gyakori hiba, hogy úgy gondolják a fenti példában az emberek, hogy a `this` a `test` függvényen
belül az őt körülvevő `Foo`-ra fog mutatni, pedig **nem**.
Expand All @@ -77,7 +77,7 @@ lokálisan elhelyezni a `method`-on belül, ami már valóban a kívánt `this`-
// Használjuk a that-et a this helyett
}
test();
}
};

A `that` tuladjonképpen egy mezei változónév (nem kulcsszó), de sokszor használják arra,
hogy egy másik `this`-re hivatkozzanak vele. A [colsureökkel](#function.closures) kombinálva
Expand Down
6 changes: 3 additions & 3 deletions doc/it/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ uso pratico.
// this viene impostato all'oggetto globale
}
test();
}
};

Una comune credenza è che `this` all'interno di `test` faccia riferimento a
`Foo` mentre, invece, **non** è così.
Expand All @@ -80,7 +80,7 @@ una variabile locale all'interno di `method` che faccia riferimento a `Foo`.
// Qui viene usato self invece di this
}
test();
}
};

`self` è solo un normale nome di variabile, ma viene comunemente usato come
riferimento ad un `this` più esterno. Abbinato alle [closures](#function.closures)
Expand All @@ -94,7 +94,7 @@ con una funziona anonima
// this ora fa riferimento a Foo
}.bind(this);
test();
}
};

### Metodi di asseganzione

Expand Down
4 changes: 2 additions & 2 deletions doc/ja/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ JavaScriptの`this`と名付けられた特殊なキーワードは他のプロ
// このファンクションはグローバルオブジェクトに設定される
}
test();
}
};

良くある誤解として`test`の中の`this`が`Foo`を参照しているというものがありますが、そのような事実は**一切**ありません。

Expand All @@ -67,7 +67,7 @@ JavaScriptの`this`と名付けられた特殊なキーワードは他のプロ
// ここでthisの代わりに使用する
}
test();
}
};

`that`は通常の変数名ですが、外部の`this`の参照の為に良く使われます。[クロージャ](#function.closures)と組み合わせる事で`this`の値を渡す事ができるようになります。

Expand Down
6 changes: 3 additions & 3 deletions doc/ko/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Global Scope에서도 this가 사용될 수 있고 이때에는 *Global* 객체
// 여기에서 this는 Global 객체를 가리킨다.
}
test();
}
};

`test` 에서 `this`가 `Foo`를 가리킬 것으로 생각할 테지만 틀렸다. 실제로는 그렇지 않다.

Expand All @@ -63,7 +63,7 @@ Global Scope에서도 this가 사용될 수 있고 이때에는 *Global* 객체
// 여기에서 this 대신에 self를 사용하여 Foo에 접근한다
}
test();
}
};

`self`는 통상적인 변수 이름이지만, 바깥쪽의 `this`를 참조하기 위해 일반적으로 사용된다.
또한 [클로저](#function.closures)와 결합하여 `this`의 값을 주고 받는 용도로 사용할 수도 있다.
Expand All @@ -75,7 +75,7 @@ ECMAScript 5부터는 익명 함수와 결합된 `bind` 메소드를 사용하
// this는 이제 Foo를 참조한다
}.bind(this);
test();
}
};

### Method 할당하기

Expand Down
4 changes: 2 additions & 2 deletions doc/pl/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ w praktyce.
// wewnątrz tej funkcji this wskazuje na obiekt global
}
test();
}
};

Powszechnym błędem jest myślenie, że `this` wewnątrz `test` wskazuje na `Foo`,
podczas gdy w rzeczywistości tak **nie jest**.
Expand All @@ -77,7 +77,7 @@ metody lokalnej zmiennej, która będzie wskazywała na `Foo`.
// Należy używać that zamiast this wewnątrz tej funkcji
}
test();
}
};

`that` jest zwykłą zmienną, ale jest to powszechnie stosowana konwencja otrzymywania
wartości zewnętrznego `this`. W połączeniu z [domknięciami(closures)](#function.closures),
Expand Down
4 changes: 2 additions & 2 deletions doc/ptbr/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ como um engano de concepção da linguagem, já que **nunca** se mostrou útil.
// this referencia o objeto global
}
test();
}
};

Um erro comum é achar que `this` dentro de `test` referencia `Foo`; enquanto que, na realidade
**não é isto que acontece**.
Expand All @@ -75,7 +75,7 @@ uma variável global dentro do método para se referir à `Foo`.
// Utilize that no lugar de this aqui
}
test();
}
};

`that` trata-se de uma variável normal, porém é normalmente utilizada para referências externas de `this`.
Quando combinadas com [closures](#function.closures), também podem ser utilizadas para repassar `this` como valor.
Expand Down
4 changes: 2 additions & 2 deletions doc/ru/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
// this ссылается на глобальный объект
}
test();
}
};

Распространенным заблуждением будет то, что `this` внутри `test` ссылается на `Foo`, но это **не так**.

Expand All @@ -63,7 +63,7 @@
// Здесь используем that вместо this
}
test();
}
};

Подходящее имя для переменной - `that`, его часто используют для ссылки на внешний `this`. В комбинации с [замыканиями](#function.closures) `this` можно пробрасывать в глобальную область или в любой другой объект.

Expand Down
4 changes: 2 additions & 2 deletions doc/tr/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ kullanılımı yoktur.
// this genel nesneye işaret eder
}
test();
}
};

Bir başka yanılgı `test` fonksiyonunun içinde `this` 'in `Foo` 'ya işaret
edeceğinin sanılmasıdır, ama bu **doğru değildir**.
Expand All @@ -79,7 +79,7 @@ değişken oluşturmaktır.
// Burada this yerine that kullanın
}
test();
}
};

`that` kelimesinin dilde özel bir anlamı yoktur, ama sıklıkla dış kapsamdaki
`this` 'e işaret etmek için kullanılır. Bu yöntem [`closure`](#function.closures)
Expand Down
4 changes: 2 additions & 2 deletions doc/zh/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ JavaScript 有一套完全不同于其它语言的对 `this` 的处理机制。
// this 将会被设置为全局对象(译者注:浏览器环境中也就是 window 对象)
}
test();
}
};

一个常见的误解是 `test` 中的 `this` 将会指向 `Foo` 对象,实际上**不是**这样子的。

Expand All @@ -72,7 +72,7 @@ JavaScript 有一套完全不同于其它语言的对 `this` 的处理机制。
// 使用 that 来指向 Foo 对象
}
test();
}
};

`that` 只是我们随意起的名字,不过这个名字被广泛的用来指向外部的 `this` 对象。
在 [闭包](#function.closures) 一节,我们可以看到 `that` 可以作为参数传递。
Expand Down
13 changes: 11 additions & 2 deletions doc/zhtw/function/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ mis-design of the language because it **never** has any practical use.
// this is set to the global object
}
test();
}
};

A common misconception is that `this` inside of `test` refers to `Foo`; while in
fact, it **does not**.
Expand All @@ -73,12 +73,21 @@ local variable inside of `method` that refers to `Foo`.
// Use that instead of this here
}
test();
}
};

`that` is just a normal variable name, but it is commonly used for the reference to an
outer `this`. In combination with [closures](#function.closures), it can also
be used to pass `this` values around.

As of ECMAScript 5 you can use the `bind` method combined with an anonymous function to achieve the same result.

Foo.method = function() {
var test = function() {
// this now refers to Foo
}.bind(this);
test();
};

### Assigning Methods

Another thing that does **not** work in JavaScript is function aliasing, which is
Expand Down