Open unional opened 9 years ago
Thanks for the report, it looks like this should be passed through as an Array, I agree. As far as I know this serialization is handled by socket.io, which should be using JSON.stringify/JSON.parse
, but maybe there is some point where things do are not passed as they should be.
Hi @Dignifiedquire ,
@nkzawa mentioned instanceof Array
does not work across iframe:
https://github.com/socketio/socket.io/issues/2234#issuecomment-172320250
My guess is it is not the case here, as those code are in karam-systemjs
and not access through any tests (does tests run in iframe?).
Can you confirm?
Yes the tests are run inside an iframe, so this might very well be the referenced stackoverflow issue. Did you test with Array.isArray
yet?
Just to confirm, while tests are run in iframe, do plugins also run in iframe?
The code is run before calling karma.start()
,
https://github.com/rolaveric/karma-systemjs/blob/master/lib/adapter.js#L80-L104
That part is run outside the iframe, but the tests are executed inside the iframe
Then it should not be iframe issue.
@Dignifiedquire , how does karma
beam the plugin config up to the client? Is it something similar to what @nkzawa describe?
https://github.com/socketio/socket.io/issues/2234#issuecomment-172320211
I'm not familiar with karma
code, can out point out where that code is located?
Thanks,
I'm using
karma-systemjs
and found a bug that most likely an issue onkarma
side, so want to bring it up to your attention.In
karma-systemjs
, it will configuresystemjs
using a config file. In the config, there is a section with an array:karma-systemjs
loads the config and pass it to the browser. Before karma,instanceof Array
is working fine:// code simplified
console.log(config.meta['*'].deps instanceof Array) => true
But inside karma, it fails:
produces:
Here is a link to the issue I created on
karma-systemjs
: https://github.com/rolaveric/karma-systemjs/issues/44