Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Bug fix: do not convert computed property #1

Merged
merged 2 commits into from
Jun 30, 2019

Conversation

uhyo
Copy link
Contributor

@uhyo uhyo commented Jun 30, 2019

Great work!

I found a bug which yields wrong result when converting an object with computed property.
It is very likely that a computed property name depends on runtime information, so this PR fixed this bug by not converting such object literals.

Thank you!

Bug reproduction:

// before
const obj = {
    hi: "hi",
    ["foo"]: "foo"
}

console.log(obj.foo); // => "foo"

// after
const obj = JSON.parse('{"hi":"hi","undefined":"foo"}');
console.log(obj.foo); // => undefined

@uhyo uhyo mentioned this pull request Jun 30, 2019
@nissy-dev
Copy link
Owner

I didn't consider such a computed property...
Thank you for finding & fixing this bug 🙇

@nissy-dev nissy-dev merged commit de6918e into nissy-dev:master Jun 30, 2019
@uhyo uhyo deleted the do-not-convert-computed-property branch June 30, 2019 14:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants