Skip to content

Commit

Permalink
Fix incorrect early exit in fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Mar 29, 2024
1 parent 67ae05d commit a0a0553
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Reflect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1750,8 +1750,8 @@ namespace Reflect {
const provider: MetadataProvider = {
isProviderFor(O, P) {
let metadataPropertySet = metadataOwner.get(O);
if (!IsUndefined(metadataPropertySet)) {
return metadataPropertySet.has(P);
if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {
return true;
}
if (getOwnMetadataKeys(O, P!).length) {
if (IsUndefined(metadataPropertySet)) {
Expand Down
4 changes: 2 additions & 2 deletions ReflectLite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1710,8 +1710,8 @@ namespace Reflect {
const provider: MetadataProvider = {
isProviderFor(O, P) {
let metadataPropertySet = metadataOwner.get(O);
if (!IsUndefined(metadataPropertySet)) {
return metadataPropertySet.has(P);
if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {
return true;
}
if (getOwnMetadataKeys(O, P!).length) {
if (IsUndefined(metadataPropertySet)) {
Expand Down
4 changes: 2 additions & 2 deletions ReflectNoConflict.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1587,8 +1587,8 @@ function CreateFallbackProvider(reflect: typeof Reflect): MetadataProvider {
const provider: MetadataProvider = {
isProviderFor(O, P) {
let metadataPropertySet = metadataOwner.get(O);
if (!IsUndefined(metadataPropertySet)) {
return metadataPropertySet.has(P);
if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {
return true;
}
if (getOwnMetadataKeys(O, P!).length) {
if (IsUndefined(metadataPropertySet)) {
Expand Down

0 comments on commit a0a0553

Please sign in to comment.