Skip to content

Commit

Permalink
Add Promise.try() to experimental features (#36166)
Browse files Browse the repository at this point in the history
* Add Promise.try() to experimental features

* Add to Experimental features section on Fx132 rel notes
  • Loading branch information
chrisdavidmills authored Oct 8, 2024
1 parent 39520e7 commit a96eef6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
40 changes: 40 additions & 0 deletions files/en-us/mozilla/firefox/experimental_features/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,46 @@ This includes: `SVGPathSegList`, [SVGPathElement.getPathSegAtLength()](/en-US/do

## JavaScript

### Promise.try()

{{jsxref("Promise.try()")}} is a convenience method that takes a callback of any kind (returns or throws, synchronously or asynchronously) and wraps its result in a {{jsxref("Promise")}} so that promise semantics (e.g. {{jsxref("Promise.then", ".then()")}}, {{jsxref("Promise.catch", ".catch()")}}) can be used to handle it ([Firefox bug 1905364](https://bugzil.la/1905364)).

<table>
<thead>
<tr>
<th>Release channel</th>
<th>Version added</th>
<th>Enabled by default?</th>
</tr>
</thead>
<tbody>
<tr>
<th>Nightly</th>
<td>132</td>
<td>No</td>
</tr>
<tr>
<th>Developer Edition</th>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th>Beta</th>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th>Release</th>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th>Preference name</th>
<td colspan="2"><code>javascript.options.experimental.promise_try</code></td>
</tr>
</tbody>
</table>

### Regular expression (?ims-ims:...) modifiers

The [(?ims-ims:...)](/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Modifier) regular expression modifiers allow you to make changes to only take effect in a specific part of a regex pattern.
Expand Down
2 changes: 2 additions & 0 deletions files/en-us/mozilla/firefox/releases/132/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ This article provides information about the changes in Firefox 132 that affect d

These features are newly shipped in Firefox 132 but are disabled by default. To experiment with them, search for the appropriate preference on the `about:config` page and set it to `true`. You can find more such features on the [Experimental features](/en-US/docs/Mozilla/Firefox/Experimental_features) page.

- **`Promise.try()`**: <code>javascript.options.experimental.promise_try</code>. {{jsxref("Promise.try()")}} is a convenience method that takes a callback of any kind (returns or throws, synchronously or asynchronously) and wraps its result in a {{jsxref("Promise")}} so that promise semantics (e.g. {{jsxref("Promise.then", ".then()")}}, {{jsxref("Promise.catch", ".catch()")}}) can be used to handle it ([Firefox bug 1905364](https://bugzil.la/1905364)).

## Older versions

{{Firefox_for_developers}}

0 comments on commit a96eef6

Please sign in to comment.