Skip to content

Commit

Permalink
Merge pull request #653 from zloirock/string-replace-all-stage-3
Browse files Browse the repository at this point in the history
Move `String#replaceAll` to stage 3
  • Loading branch information
zloirock authored Oct 2, 2019
2 parents ce8d115 + 76969f3 commit 4d12e15
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
##### Unreleased
- **`String#{ matchAll, replaceAll }` throws an error on non-global regex argument per [this PR](https://github.com/tc39/proposal-string-replaceall/pull/24) and [the decision from TC39 meetings](https://github.com/tc39/ecma262/pull/1716). It's a breaking change, but because it's a breaking change in the ES spec, it's added at the minor release**
- `globalThis` moved to stable ES, [per October TC39 meeting](https://github.com/babel/proposals/issues/60#issuecomment-537217903)
- `String#replaceAll` moved to stage 3, [per October TC39 meeting](https://github.com/babel/proposals/issues/60#issuecomment-537530013)
- Added [iterator helpers stage 2 proposal](https://github.com/tc39/proposal-iterator-helpers):
- `Iterator`
- `Iterator.from`
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,21 @@ core-js/proposals/promise-all-settled
```js
core-js(-pure)/stage/3
```
* `String#replaceAll` [proposal](https://github.com/tc39/proposal-string-replace-all) - module [`esnext.string.replace-all`](https://github.com/zloirock/core-js/blob/v3.2.1/packages/core-js/modules/esnext.string.replace-all.js)
```js
class String {
replaceAll(searchValue: string | RegExp, replaceString: string): string;
}
```
[*CommonJS entry points:*](#commonjs-api)
```js
core-js/proposals/string-replace-all
core-js/features/string/replace-all
```
[*Examples*](https://goo.gl/wUXNXN):
```js
'Test abc test test abc test.'.replaceAll('abc', 'foo'); // -> 'Test foo test test foo test.'
```

#### Stage 2 proposals
[*CommonJS entry points:*](#commonjs-api)
Expand Down Expand Up @@ -1681,21 +1696,6 @@ new Set([1, 2, 3]).isDisjointFrom([4, 5, 6]); // => true
new Set([1, 2, 3]).isSubsetOf([5, 4, 3, 2, 1]); // => true
new Set([5, 4, 3, 2, 1]).isSupersetOf([1, 2, 3]); // => true
```
* `String#replaceAll` [proposal](https://github.com/tc39/proposal-string-replace-all) - module [`esnext.string.replace-all`](https://github.com/zloirock/core-js/blob/v3.2.1/packages/core-js/modules/esnext.string.replace-all.js)
```js
class String {
replaceAll(searchValue: string | RegExp, replaceString: string): string;
}
```
[*CommonJS entry points:*](#commonjs-api)
```js
core-js/proposals/string-replace-all
core-js/features/string/replace-all
```
[*Examples*](https://goo.gl/wUXNXN):
```js
'Test abc test test abc test.'.replaceAll('abc', 'foo'); // -> 'Test foo test test foo test.'
```
* `Promise.any` [proposal](https://github.com/tc39/proposal-promise-any) - modules [`esnext.promise.any`](https://github.com/zloirock/core-js/blob/v3.2.1/packages/core-js/modules/esnext.promise.any.js) and [`esnext.aggregate-error`](https://github.com/zloirock/core-js/blob/v3.2.1/packages/core-js/modules/esnext.aggregate-error.js)
```js
class AggregateError {
Expand Down
1 change: 0 additions & 1 deletion packages/core-js/stage/2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ require('../proposals/array-is-template-object');
require('../proposals/iterator-helpers');
require('../proposals/promise-any');
require('../proposals/set-methods');
require('../proposals/string-replace-all');
require('../proposals/using-statement');

module.exports = require('./3');
2 changes: 2 additions & 0 deletions packages/core-js/stage/3.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
require('../proposals/string-replace-all');

module.exports = require('./4');

0 comments on commit 4d12e15

Please sign in to comment.