-
Notifications
You must be signed in to change notification settings - Fork 6
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
isArray breaks #54
Comments
Ha! Yeah, I just ran into this bug too. It causes I'm not sure about a workaround yet. Maybe the direct proxy shim fixes the issue? I'll try hacking that into contracts.js and see if that fixes things. |
was reading this: http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/ |
Ugh, and that's a no on the direct proxy shim workaround.
|
Right so the normal way of checking for an array without using the new
So it would be straightforward to just patch Humm...although we could just patch |
yikes! We already don't care about performance of contracts, so re-implemenation in js is fine if it isn't buggy. Is it possible for the contracts proxy behavior be modified? So that it does less for arrays and the proxy is added/removed earlier? I don't know if that actually make sense... |
Yeah, I think that's probably the best option for now. Just do simple one-time checks when the contract get applied to a value (is the value actually an array, etc.) and don't wrap it. This means we don't get to check array accesses but things actually work. |
Ok, contracts are no longer wrapping arrays. New version pushed out to npm too. Hopefully direct proxies land soon. |
awesome! I had to turn my contracts off :( |
seems to be working. Thanks! |
The constructor of a proxied array does in fact === Array
However, everyone uses
toString.apply
to determine if an object is an array, and this changes once an object is proxied. I was just looking at the direct proxies ticket and it seems this issue is solved there. Is it possible for us to have a work around until then?The text was updated successfully, but these errors were encountered: