Skip to content

Commit

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

(found while working on #1332)
  • Loading branch information
rbri authored and gbrail committed Aug 18, 2023
1 parent d6ce38d commit 04a2e13
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 04a2e13

Please sign in to comment.