Skip to content

Commit

Permalink
again (see mozilla#1357) take care of ScriptRuntime.isSymbol() == tru…
Browse files Browse the repository at this point in the history
…e; the object might be a NativeSymbol or a SymbolKey

(found while working on mozilla#1332)
  • Loading branch information
rbri committed Aug 18, 2023
1 parent 4c95547 commit 76fec0a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/org/mozilla/javascript/IdScriptableObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -917,9 +917,15 @@ protected ScriptableObject getOwnPropertyDescriptor(Context cx, Object id) {
ScriptableObject desc = super.getOwnPropertyDescriptor(cx, id);
if (desc == null) {
if (id instanceof String) {
desc = getBuiltInDescriptor((String) id);
} else if (ScriptRuntime.isSymbol(id)) {
desc = getBuiltInDescriptor(((NativeSymbol) id).getKey());
return getBuiltInDescriptor((String) id);
}

if (ScriptRuntime.isSymbol(id)) {
if (id instanceof SymbolKey) {
return getBuiltInDescriptor((SymbolKey) id);
}

return getBuiltInDescriptor(((NativeSymbol) id).getKey());
}
}
return desc;
Expand Down

0 comments on commit 76fec0a

Please sign in to comment.