diff --git a/CHANGELOG.md b/CHANGELOG.md index 7987dca8eca0..002567aee072 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/packages/core-js/internals/make-built-in.js b/packages/core-js/internals/make-built-in.js index bebf9fe163be..574309851270 100644 --- a/packages/core-js/internals/make-built-in.js +++ b/packages/core-js/internals/make-built-in.js @@ -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;