Skip to content

Commit

Permalink
Merge pull request #233 from stefanpenner/promise.finally
Browse files Browse the repository at this point in the history
Promise.prototype.finally [fixes #232]
  • Loading branch information
stefanpenner committed Dec 19, 2017
2 parents 18897d3 + 14ca840 commit d8f56ac
Show file tree
Hide file tree
Showing 12 changed files with 318 additions and 15 deletions.
12 changes: 7 additions & 5 deletions README.md
Expand Up @@ -51,20 +51,22 @@ bower install es6-promise --save

## Usage in IE<9

`catch` is a reserved word in IE<9, meaning `promise.catch(func)` throws a syntax error. To work around this, you can use a string to access the property as shown in the following example.
`catch` and `finally` are reserved keywords in IE<9, meaning
`promise.catch(func)` or `promise.finally(func)` throw a syntax error. To work
around this, you can use a string to access the property as shown in the
following example.

However, please remember that such technique is already provided by most common minifiers, making the resulting code safe for old browsers and production:
However most minifiers will automatically fix this for you, making the
resulting code safe for old browsers and production:

```js
promise['catch'](function(err) {
// ...
});
```

Or use `.then` instead:

```js
promise.then(undefined, function(err) {
promise['finally'](function() {
// ...
});
```
Expand Down
57 changes: 55 additions & 2 deletions dist/es6-promise.auto.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/es6-promise.auto.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/es6-promise.auto.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/es6-promise.auto.min.map

Large diffs are not rendered by default.

57 changes: 55 additions & 2 deletions dist/es6-promise.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/es6-promise.map

Large diffs are not rendered by default.

0 comments on commit d8f56ac

Please sign in to comment.