Skip to content

PushSubscription.toJSON was the wrong return type #346

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

Closed
FabioPinheiro opened this issue Feb 14, 2019 · 1 comment
Closed

PushSubscription.toJSON was the wrong return type #346

FabioPinheiro opened this issue Feb 14, 2019 · 1 comment

Comments

@FabioPinheiro
Copy link
Contributor

The method toJSON on PushSubscription return a Object not a String

https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription/toJSON

https://github.com/scala-js/scala-js-dom/blob/master/src/main/scala/org/scalajs/dom/experimental/push/PushManager.scala#L101

The error:

scala.scalajs.runtime.UndefinedBehaviorError: An undefined behavior was detected: [object Object] is not an instance of java.lang.String
...
Caused by: java.lang.ClassCastException: [object Object] is not an instance of java.lang.String
@FabioPinheiro FabioPinheiro changed the title PushSubscription.toJSON was the return type wrong PushSubscription.toJSON was the wrong return type Feb 14, 2019
@FabioPinheiro
Copy link
Contributor Author

Can anyone converme this?
What is the ritgh return type? js.Any ?
How can I test this?

FabioPinheiro added a commit to FabioPinheiro/scala-js-dom that referenced this issue Feb 14, 2019
Update PushSubscription to better reflect w3 standards:
-Change the return type of method toJSON
-Add missing properties (expirationTime, options)
FabioPinheiro added a commit to FabioPinheiro/scala-js-dom that referenced this issue Mar 4, 2019
Update PushSubscription to better reflect w3 standards:
-Change the return type of method toJSON
-Add missing properties (expirationTime, options)
@sjrd sjrd closed this as completed in 52ebfcc Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant