Skip to content

Commit

Permalink
limit a fallback to RangeError
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Sep 18, 2023
1 parent 06b4703 commit e66e477
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/core-js/modules/es.symbol.constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var getInternalState = InternalStateModule.getterFor(SYMBOL);
var ObjectPrototype = Object[PROTOTYPE];
var $Symbol = global.Symbol;
var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
var RangeError = global.RangeError;
var TypeError = global.TypeError;
var QObject = global.QObject;
var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
Expand Down Expand Up @@ -173,6 +174,7 @@ if (!NATIVE_SYMBOL) {
try {
setSymbolDescriptor(this, tag, descriptor);
} catch (error) {
if (!(error instanceof RangeError)) throw error;
fallbackDefineProperty(this, tag, descriptor);
}
};
Expand Down

0 comments on commit e66e477

Please sign in to comment.