jquery / jquery/api.jquery.com
jQuery.isPlainObject( { ... } ) can be tricked by manipulating Symbol.toStringTag
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 325
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
The documentation for isPlainObject indicates the following evaluates to true, but in jQuery v3.5.1 it evaluates to false.
jQuery.isPlainObject( { [Symbol.toStringTag]: "Tag" } );
I suggest the documentation be changed to clarify the behaviour when an otherwise plain object has a [Symbol.toStringTag] property unequal to "Object".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the linked jQuery.isPlainObject API documentation and compare its plain-object example with the reported Symbol.toStringTag behavior in jQuery 3.5.1. Clarify the documentation for an otherwise plain object whose Symbol.toStringTag is not "Object", and verify that the example and explanation match the observed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jquery
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100