jscoverage and js data structures
jscoverage and js data structures
Hi,
First, congratulation for jscoverage, according to me it is a very well designed tool - the proxy server is a really smart solution.
Btw, I experienced some difficulities and I had to surrender.
I had difficultes because the fwk I'm using is quite ... different. I use something like that :
myObj.prototype = {
data : {
Type: "mydata.Data"
},
init : function(){
// my initialization
},
}
Then, the're is an extern initialization that "post-build" the object:
data is evaled again with : "data = new mydata.Data();". (Something like that.)
So I can't use jscoverage.... because the data declaration is wrapped (and then can't be find in the prototype).
I'm just wondering why jscoverage wrap the code :
data : {
Type: "mydata.Data"
},
... and not only functions declaration ?
Because, in this case, it would work really fine.
(And I understand this is not an usual way to work with JS - it's ok )
Guillaume
First, congratulation for jscoverage, according to me it is a very well designed tool - the proxy server is a really smart solution.
Btw, I experienced some difficulities and I had to surrender.
I had difficultes because the fwk I'm using is quite ... different. I use something like that :
myObj.prototype = {
data : {
Type: "mydata.Data"
},
init : function(){
// my initialization
},
}
Then, the're is an extern initialization that "post-build" the object:
data is evaled again with : "data = new mydata.Data();". (Something like that.)
So I can't use jscoverage.... because the data declaration is wrapped (and then can't be find in the prototype).
I'm just wondering why jscoverage wrap the code :
data : {
Type: "mydata.Data"
},
... and not only functions declaration ?
Because, in this case, it would work really fine.
(And I understand this is not an usual way to work with JS - it's ok )
Guillaume
-
- Posts: 120
- Joined: 2008-10-11 6:52 pm
Re: jscoverage and js data structures
Hello, Guillaume,
I'm having trouble understanding your code - could you attach a .js file (or files) containing a minimal working example that I can run using JSCoverage and see what's going on?
I'm having trouble understanding your code - could you attach a .js file (or files) containing a minimal working example that I can run using JSCoverage and see what's going on?
Re: jscoverage and js data structures
Ed,
I understand your trubble... Forgot my previous message, I spoke too fast (this message was only garbage...).
Actually, I have a JS code working but when I use thejscoverage proxy there is an error when calling the native eval function. I use a try cath and the error is the following :
"EvalError: function eval must be called directly, and not by way of a function of another name"
Do you have any idea ?
I understand your trubble... Forgot my previous message, I spoke too fast (this message was only garbage...).
Actually, I have a JS code working but when I use thejscoverage proxy there is an error when calling the native eval function. I use a try cath and the error is the following :
"EvalError: function eval must be called directly, and not by way of a function of another name"
Do you have any idea ?
Re: jscoverage and js data structures
I found the error.
In my source code I've got :;
After going throw the jscoverage proxy, it became :
... which doens not work (at lead on FF3).
Now, I use this, workaround and this is ok :
Btw, i've got an another issue, on some request throw the proxy, my server trigger a 400 error : "Could not parse request headers" ... maybe i'll start an other topic tomorrow.
In my source code I've got :
Code: Select all
new(eval(type))()
After going throw the jscoverage proxy, it became :
Code: Select all
new eval(type)();
Now, I use this, workaround and this is ok :
Code: Select all
var Class = eval(type);
this[item] = new (Class)();
Btw, i've got an another issue, on some request throw the proxy, my server trigger a 400 error : "Could not parse request headers" ... maybe i'll start an other topic tomorrow.
-
- Posts: 120
- Joined: 2008-10-11 6:52 pm
Re: jscoverage and js data structures
Thanks, I think I have this fixed now in the Subversion repository.Guillaume wrote:I found the error.
In my source code I've got :;Code: Select all
new(eval(type))()
After going throw the jscoverage proxy, it became :Code: Select all
new eval(type)();
What web browser are you using? Is this still FF 3?Guillaume wrote:Btw, i've got an another issue, on some request throw the proxy, my server trigger a 400 error : "Could not parse request headers" ... maybe i'll start an other topic tomorrow.
Re: jscoverage and js data structures
Great!Ed wrote: Thanks, I think I have this fixed now in the Subversion repository.
Yes.Ed wrote:What web browser are you using? Is this still FF 3?Guillaume wrote:Btw, i've got an another issue, on some request throw the proxy, my server trigger a 400 error : "Could not parse request headers" ... maybe i'll start an other topic tomorrow.
Actually, this the jscoverage proxy server which fails on this type of parameters :
Code: Select all
http://www.test.com/?foo=bar[0]
Code: Select all
http://www.test.com/?foo=bar
Do you confirm the issue ?
Re: jscoverage and js data structures
I don't know if it can help but
works fine.
I guess that the browser do not escape characters before sending it to the proxy ...
Code: Select all
http://www.test.com/?foo=bar%5D0%5B
I guess that the browser do not escape characters before sending it to the proxy ...
-
- Posts: 120
- Joined: 2008-10-11 6:52 pm
Re: jscoverage and js data structures
Thanks, I see the problem now. I have modified the URL parser in jscoverage-server to accept more characters; "[" and "]" should work now, even if not %-escaped.
-
- Posts: 4
- Joined: 2009-09-08 11:41 am
Re: jscoverage and js data structures
Great !
Do have an idea about the next release date ?
Do have an idea about the next release date ?
-
- Posts: 120
- Joined: 2008-10-11 6:52 pm
Re: jscoverage and js data structures
Probably the next release will be in a month or two.
-
- Posts: 4
- Joined: 2009-09-08 11:41 am
Re: jscoverage and js data structures
Ok. Thank you for your fix.
I tested it and it works fine.
I tested it and it works fine.