Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): handle toJSON() in plugin objects #4823

Merged
merged 1 commit into from Jul 12, 2021
Merged

fix(core): handle toJSON() in plugin objects #4823

merged 1 commit into from Jul 12, 2021

Conversation

@jcesarmobile
Copy link
Member

@jcesarmobile jcesarmobile commented Jul 12, 2021

In Capacitor 2, calling JSON.stringify(Plugin) would return an empty object. In Capacitor 3 it tries to call a native toJSON method, which doesn't exist, and throws an error.

This PR handles the toJSON call in core to make it return an empty object as it used to.

closes #4814
closes #4820

@Ionitron Ionitron added this to Needs review 🤔 in Capacitor Engineering ⚡️ Jul 12, 2021
@jcesarmobile jcesarmobile requested review from elylucas and thomasvidas Jul 12, 2021
@jcesarmobile jcesarmobile merged commit 0479822 into main Jul 12, 2021
17 checks passed
17 checks passed
@github-actions
setup
Details
@github-actions
setup
Details
@github-actions
pull_request/opened
Details
@github-actions
lint lint
Details
@github-actions
lint lint
Details
@github-actions
test-cli
Details
@github-actions
test-cli
Details
@github-actions
test-core
Details
@github-actions
test-core
Details
@github-actions
test-ios (/Applications/Xcode_12.4.app)
Details
@github-actions
test-ios (/Applications/Xcode_12.4.app)
Details
@github-actions
test-android
Details
@github-actions
test-android
Details
@github-actions
deploy-next
Details
@github-actions
deploy-next
Details
@github-actions
deploy-latest
Details
@github-actions
deploy-latest
Details
Capacitor Engineering ⚡️ automation moved this from Needs review 🤔 to Done 🎉 Jul 12, 2021
@jcesarmobile jcesarmobile deleted the toJSON branch Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Linked issues

Successfully merging this pull request may close these issues.

2 participants