|
View:
New views
10 Messages
—
Rating Filter:
Alert me
|
|
|
Eval Limitations in IE7DWR uses a lot of evals to de-serialize data into javascript data structures. After experiencing several odd errors in IE7 with DWR and large sets of data, I started to do some digging. It seems that IE7 limits the number of variables that can be assigned in a single eval to 327687 (the max value of a signed short). If you cross that threshold, it gives you a generic 'Syntax Error' message.
The following code demonstrates the problem: function StringBuffer() { this.buffer = []; } StringBuffer.prototype.append = function(string) { this.buffer.push(string); return this; } StringBuffer.prototype.toString = function() { return this.buffer.join(""); } var max = 32768; testEval(); function testEval() { var sb = new StringBuffer(); for (var i=0; i < max; i++) { sb.append("s" + i + " = 'foo';"); } eval(sb.toString()); } I've opened a support case with MS but I don't have high hopes of them changing the behavior (I'm assuming that it's intentional). The most I'm hoping for is a little better error message. With that said, is there any hope of seeing DWR less reliant on large evals in the future? |
|
|
Re: Eval Limitations in IE7Mike,
This is not common across IE 7. It depends on the scripting engine. You can check this via the following: <html> <body> <script> /*@cc_on @*/ function GetScriptEngineInfo(){ var s; s = ""; // Build string with necessary info. s += ScriptEngine() + " Version "; s += ScriptEngineMajorVersion() + "."; s += ScriptEngineMinorVersion() + "."; s += ScriptEngineBuildVersion(); return(s); } alert("Javascript version is "+@_jscript_version+" build "+@_jscript_build); alert(GetScriptEngineInfo()); </script> </body> </html> I don't see the problem you mention. I am on Version 5.7, build 5730. Quoting Mike Cantrell <m.j.cantrell@...>: > DWR uses a lot of evals to de-serialize data into javascript data > structures. After experiencing several odd errors in IE7 with DWR and large > sets of data, I started to do some digging. It seems that IE7 limits the > number of variables that can be assigned in a single eval to 327687 (the max > value of a signed short). If you cross that threshold, it gives you a > generic 'Syntax Error' message. > > The following code demonstrates the problem: > > function StringBuffer() { this.buffer = []; } > > StringBuffer.prototype.append = function(string) { > this.buffer.push(string); > return this; > } > > StringBuffer.prototype.toString = function() { > return this.buffer.join(""); > } > > > > var max = 32768; > testEval(); > > function testEval() { > var sb = new StringBuffer(); > > for (var i=0; i < max; i++) { > sb.append("s" + i + " = 'foo';"); > } > eval(sb.toString()); > } > > I've opened a support case with MS but I don't have high hopes of them > changing the behavior (I'm assuming that it's intentional). The most I'm > hoping for is a little better error message. > > With that said, is there any hope of seeing DWR less reliant on large evals > in the future? --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Eval Limitations in IE7I'm running the same version. I wonder if it's operating system related then?
On 2/28/07, David Marginian <david@...> wrote: Mike, |
|
|
Re: Eval Limitations in IE7Mike,
I made a mistake. The older version of the script engine does not have this problem. You are right, 5.7 does. Quoting Mike Cantrell <m.j.cantrell@...>: > I'm running the same version. I wonder if it's operating system related > then? > > On 2/28/07, David Marginian <david@...> wrote: >> >> Mike, >> This is not common across IE 7. It depends on the scripting >> engine. You can check this via the following: >> >> <html> >> <body> >> <script> >> /*@cc_on @*/ >> function GetScriptEngineInfo(){ >> var s; >> s = ""; // Build string with necessary info. >> s += ScriptEngine() + " Version "; >> s += ScriptEngineMajorVersion() + "."; >> s += ScriptEngineMinorVersion() + "."; >> s += ScriptEngineBuildVersion(); >> return(s); >> } >> >> alert("Javascript version is "+@_jscript_version+" build >> "+@_jscript_build); >> alert(GetScriptEngineInfo()); >> </script> >> </body> >> </html> >> >> I don't see the problem you mention. I am on Version 5.7, build 5730. >> >> Quoting Mike Cantrell <m.j.cantrell@...>: >> >>> DWR uses a lot of evals to de-serialize data into javascript data >>> structures. After experiencing several odd errors in IE7 with DWR and >> large >>> sets of data, I started to do some digging. It seems that IE7 limits the >>> number of variables that can be assigned in a single eval to 327687 (the >> max >>> value of a signed short). If you cross that threshold, it gives you a >>> generic 'Syntax Error' message. >>> >>> The following code demonstrates the problem: >>> >>> function StringBuffer() { this.buffer = []; } >>> >>> StringBuffer.prototype.append = function(string) { >>> this.buffer.push(string); >>> return this; >>> } >>> >>> StringBuffer.prototype.toString = function() { >>> return this.buffer.join(""); >>> } >>> >>> >>> >>> var max = 32768; >>> testEval(); >>> >>> function testEval() { >>> var sb = new StringBuffer(); >>> >>> for (var i=0; i < max; i++) { >>> sb.append("s" + i + " = 'foo';"); >>> } >>> eval(sb.toString()); >>> } >>> >>> I've opened a support case with MS but I don't have high hopes of them >>> changing the behavior (I'm assuming that it's intentional). The most I'm >>> hoping for is a little better error message. >>> >>> With that said, is there any hope of seeing DWR less reliant on large >> evals >>> in the future? >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@... >> For additional commands, e-mail: users-help@... >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Eval Limitations in IE7I'm assuming that you are using DWR 1.1? I think this is fixed in 2.0 Joe On 2/28/07, David Marginian <david@...> wrote: Mike, |
|
|
Re: Eval Limitations in IE7I remember testing this in 2.0M1 and it appeared to fix the problem. I didn't upgrade at that time because I was waiting for a production release. I tried 2.0RC2 the other day and the problem started happening again. That's when I started researching the issue and found out exactly what the eval limit was.
I also spoke with MS today. This is a known bug that they are working on. They plan on fixing this in the next version of IE . They would not give me any timeframe on when the release would occur.
On 2/28/07, Joe Walker <joe@...> wrote:
|
|
|
|
|
|
|
|
|
Re: Eval Limitations in IE7Please could you create an issue for this to help me track outstanding tasks. Thanks, Joe. On 3/7/07, Amad Fida <amadfida@...> wrote:
|
|
|
Re: Eval Limitations in IE7Has this issue been addressed? I'm encountering it now. Everything's fine in FF, but IE7 croaks. I've been using 2.0RC3 for a while, but I've downloaded 2.0.1 and tested with it. Still seeing the same problem.
James
|
| Free embeddable forum powered by Nabble | Forum Help |