From cd6130116ddbcddafe61c608c0ec2e4d95719256 Mon Sep 17 00:00:00 2001 From: Diogo Franco Date: Thu, 25 Aug 2016 11:32:51 +0900 Subject: [PATCH] Mention how arrow functions' `spec` uses `.bind` (#3679) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 318b9d2fa7..691ce41f1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,7 +51,7 @@ npm install babel-preset-latest --save-dev - [#3671](https://github.com/babel/babel/pull/3671) We also are including a `spec` option for the `es2015` preset since the [arrow function](http://babeljs.io/docs/plugins/transform-es2015-arrow-functions/)/[template string](http://babeljs.io/docs/plugins/transform-es2015-template-literals/) plugins support this option. -> `spec` for arrow functions adds a runtime check to make sure arrow functions are not instantiated (since they transform into normal functions). +> `spec` for arrow functions uses `.bind(this)`, instead of renaming, to make `this` available inside the transformed function. It also adds a runtime check to make sure they are not instantiated (since they transform into bound regular functions). > `spec` for template literals wraps all expressions in `String` rather than simple string concatenation. ```js