yahoo / yahoo/serialize-javascript
Bug when used an object with a function and a variable with a function and destructuring
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.9k
- Forks
- 215
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 2
Description
https://runkit.com/leobastiani/javascript-serialize-bug-variable-function-destructuring
Try the following code:
const serialize = require("javascript-serialize"); // version 1.6.1
const obj = {
someKey() {
const someVariable = ({ someParam }) => {};
},
};
serialize(obj);
and get: { "someKey": "someKey() { ...
Contributor guide
No contributing guide indexed for this repository
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
Start by running the linked RunKit reproduction with javascript-serialize 1.6.1 and inspect the serializer path that handles object methods, function-valued variables, and destructuring syntax. Add regression coverage for the shown object and verify serialization no longer produces the incorrect truncated function output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100