Skip to content

Conversation

@Friss
Copy link
Contributor

@Friss Friss commented Nov 1, 2014

pace.coffee Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Friss I'm a bit confused here. val in from compiles to from.indexOf(val) >= 0. But from is an object like window.WebSocket, which doesn't have an indexOf method... right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true. :/ It accidentally works since it always returns -1 thus never tries to access those keys.

The keys that are a issue are the ones that are undefined. (URL, etc)
screenshot 2014-11-03 15 22 57

So I guess this puts the fix back on the drawing board. Though safari still seems to work with pace with this fix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to try using Object.defineProperty (if the browser supports it). Other projects have used to avoid this error: apache/cordova-js@6c7a76f

@Friss
Copy link
Contributor Author

Friss commented Nov 5, 2014

Updated @TrevorBurnham seems to be working as expected now.

pace.coffee Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you still want to use to[key] = val in browsers where Object.defineProperty is not defined.

@Friss
Copy link
Contributor Author

Friss commented Nov 6, 2014

How does this look @TrevorBurnham

@TrevorBurnham
Copy link
Contributor

👍

TrevorBurnham added a commit that referenced this pull request Nov 6, 2014
Stop safari from blowing up
@TrevorBurnham TrevorBurnham merged commit c6846cb into CodeByZach:master Nov 6, 2014
@TrevorBurnham
Copy link
Contributor

Tagged as v1.0.2.

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

Successfully merging this pull request may close these issues.

Safari - Depreciated attempt to access property <prop> on a non-WebSocket object

2 participants