Skip to content

Commit

Permalink
fixed setting names of methods with symbol keys in some old engines
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Jan 8, 2024
1 parent 8e126e2 commit 299f9cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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
- Fixed internal `ToLength` operation with bigints, [#1318](https://github.com/zloirock/core-js/issues/1318)
- Removed significant redundant code from `String#split` polyfill
- Fixed setting names of methods with symbol keys in some old engines
- Compat data improvements:
- [`Iterator` helpers proposal](https://github.com/tc39/proposal-iterator-helpers) methods marked as supported from V8 ~ Chrome 122
- Added Electron 30 compat data mapping
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/make-built-in.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var TEMPLATE = String(String).split('String');

var makeBuiltIn = module.exports = function (value, name, options) {
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
}
if (options && options.getter) name = 'get ' + name;
if (options && options.setter) name = 'set ' + name;
Expand Down

0 comments on commit 299f9cd

Please sign in to comment.