<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>JScript Blog</title><link>http://blogs.msdn.com/jscript/default.aspx</link><description>Blogs from the JScript team in Microsoft</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Steps Toward Creating Compatible ECMAScript 5 Implementations</title><link>http://blogs.msdn.com/jscript/archive/2009/06/30/steps-toward-creating-compatible-ecmascript-5-implementations.aspx</link><pubDate>Mon, 29 Jun 2009 19:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9808847</guid><dc:creator>GauravS</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/jscript/comments/9808847.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=9808847</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=9808847</wfw:comment><description>&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;As we’ve discussed in the &lt;A href="http://blogs.msdn.com/jscript/archive/2009/04.aspx"&gt;past&lt;/A&gt;, Microsoft has been actively involved in the developing the specification for the next revision of the JavaScript standard, ECMAScript Fifth Edition. We expect that after ECMAScript 5’s completion and formal adoption later this year that it will be relatively quickly adopted by browser implementers as part of their ongoing release cycles.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;When a new browser standard like this is introduced, it is important that all implementers work hard to make sure that they correctly implement the standard and are compatible with each other. Language specifications are complex technical documents and even well written specification can be misinterpreted by implementers leading to incompatibles and interoperability issues.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;One way to avoid this is for implementers to use a common specification compliance test suite.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;At the ECMA TC39 meeting this May, Microsoft announced that it was working on such test suite and made a preliminary version available to the ECMA members. We have now turned development of this test suite into a community development &lt;A href="http://es5conform.codeplex.com/"&gt;project&lt;/A&gt; hosted on Codeplex. This project is released as using the new BSD open source license and will be coordinated by TC39 members including Microsoft. Currently the test suite includes about 900 tests that mostly focus features that are new to ECMAScript 5.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is a small fraction of the tests that will be needed to provide complete conformance coverage for the entire language.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Microsoft plans on continuing to contribute additional tests to the suite and we are working with other ECMA TC39 members to coordinate with any test suite development they may be doing.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;Anyone who has the interest and skills for developing individual ECMAScript conformance tests are invited to participate in the project. If you’re interested check out the &lt;A href="http://es5conform.codeplex.com/"&gt;Codeplex site&lt;/A&gt; and get involved.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;Allen Wirfs-Brock&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;Microsoft TC-39 Representative&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9808847" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Developers/default.aspx">Developers</category></item><item><title>Native JSON Support in IE8 and Tracking the ECMAScript Fifth Edition Draft Specification</title><link>http://blogs.msdn.com/jscript/archive/2009/06/23/native-json-support-in-ie8-and-tracking-the-ecmascript-fifth-edition-draft-specification.aspx</link><pubDate>Mon, 22 Jun 2009 19:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9798184</guid><dc:creator>GauravS</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jscript/comments/9798184.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=9798184</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=9798184</wfw:comment><description>&lt;P&gt;&lt;A href="http://www.microsoft.com/windows/internet-explorer/default.aspx" mce_href="http://www.microsoft.com/windows/internet-explorer/default.aspx"&gt;Internet Explorer 8&lt;/A&gt; was the first browser to introduce native support for encoding and decoding JSON. While we were finalizing the JSON support to be introduced in IE8, the &lt;A href="http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf" mce_href="http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf"&gt;ECMAScript Fifth Edition (ES5) Draft Specification&lt;/A&gt; was still under active development.&lt;/P&gt;
&lt;P&gt;At that time, there were clearly two options in front of us:&lt;/P&gt;
&lt;P&gt;First, to wait till the new specification is approved so that we can ship a fully compliant native JSON feature. This had a big disadvantage of not being able to provide web developers with both – performance and security benefits that native JSON offers over a script implementation of JSON in IE8 (as final approval of the standard was at least a year away).&lt;/P&gt;
&lt;P&gt;Second, providing JSON support in IE8 based upon early drafts of the standard and then, if necessary, bringing the IE JSON support into compliance with the ES5 specification once the standard is ratified (currently expected to happen in Dec’09). This option had the disadvantage that if the specification changed after IE8 shipped there would be a period time during which the IE8 JSON support would have variances from the ES5 specification.&lt;/P&gt;
&lt;P&gt;Weighing the two, we decided to choose the second option as it meant providing web developers the ability to start taking advantage of the native JSON constructs immediately. Moreover, the changes that were expected in the specification were not drastic and could easily be detected and worked around as needed by providing simple wrappers created in JScript itself. &lt;/P&gt;
&lt;P&gt;Both, the candidate draft of the ES5 Specification and IE8 are now available. The list of differences that currently exist between the implementation and the draft specification is provided below with possible workarounds. It is worth noting that additional changes may still be made to the candidate ES5 specification based upon reviewer feedback. What this means is that the final form factor of JSON might be a bit different than the draft or what is covered in this article by the time ES5 is standardized.&lt;/P&gt;
&lt;P&gt;Following is a list of differences between IE8’s behavior and the current ES5 Draft Specification of&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc836459(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc836459(VS.85).aspx"&gt;&lt;B&gt;&lt;FONT size=2 face="Courier New"&gt;JSON.stringify(value[,replacer[,space]])&lt;/FONT&gt;&lt;/B&gt;&lt;/A&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;value&lt;/FONT&gt;&lt;/B&gt; is undefined and is not replaced using a &lt;FONT face="Courier New"&gt;&lt;STRONG&gt;replacer&lt;/STRONG&gt;&lt;/FONT&gt; function, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should return &lt;FONT face="Courier New"&gt;undefined&lt;/FONT&gt; instead of the string &lt;FONT face="Courier New"&gt;"undefined"&lt;/FONT&gt;. &lt;/LI&gt;
&lt;LI&gt;If &lt;FONT face="Courier New"&gt;&lt;B&gt;value&lt;/B&gt; &lt;/FONT&gt;is a function and is not replaced using a &lt;B&gt;&lt;FONT face="Courier New"&gt;replacer&lt;/FONT&gt;&lt;/B&gt; function, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should return the value &lt;FONT face="Courier New"&gt;undefined&lt;/FONT&gt; rather than the string &lt;FONT face="Courier New"&gt;"undefined"&lt;/FONT&gt;. &lt;/LI&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;value&lt;/FONT&gt;&lt;/B&gt; is a Number or String object after the &lt;FONT face="Courier New"&gt;toJSON() &lt;/FONT&gt;method and &lt;FONT face="Courier New"&gt;replacer&lt;/FONT&gt; function have been executed on &lt;FONT face="Courier New"&gt;value&lt;/FONT&gt;, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should return the primitive number or string value stored in the Number or String object.&amp;nbsp; &lt;I&gt;Note: Per the latest ES5 &lt;/I&gt;&lt;A href="http://wiki.ecmascript.org/lib/exe/fetch.php?id=es3.1%3Aes3.1_proposal_working_draft&amp;amp;cache=cache&amp;amp;media=es3.1:es5_candidate_errata_may_27.doc" mce_href="http://wiki.ecmascript.org/lib/exe/fetch.php?id=es3.1%3Aes3.1_proposal_working_draft&amp;amp;cache=cache&amp;amp;media=es3.1:es5_candidate_errata_may_27.doc"&gt;&lt;I&gt;errata&lt;/I&gt;&lt;/A&gt;&lt;I&gt; (27 May’09) Boolean objects are also included in this.&lt;/I&gt; &lt;/LI&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;value&lt;/FONT&gt;&lt;/B&gt; is a cyclic object or array, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should throw a &lt;FONT face="Courier New"&gt;TypeError&lt;/FONT&gt; and not an &lt;FONT face="Courier New"&gt;Error&lt;/FONT&gt;. &lt;/LI&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;replacer&lt;/FONT&gt;&lt;/B&gt; is not a Function or an Array, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should ignore the &lt;FONT face="Courier New"&gt;replacer&lt;/FONT&gt; parameter and not throw an error. &lt;/LI&gt;
&lt;LI&gt;If the &lt;B&gt;&lt;FONT face="Courier New"&gt;replacer&lt;/FONT&gt;&lt;/B&gt; function calls a DOM method and passes the &lt;FONT face="Courier New"&gt;key&lt;/FONT&gt; parameter to the same, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should not throw an &lt;FONT face="Courier New"&gt;Error&lt;/FONT&gt;. &lt;I&gt;Note: To work around this issue, use &lt;/I&gt;&lt;I&gt;key.toString()&lt;/I&gt;&lt;I&gt; when passing key to DOM methods like &lt;/I&gt;&lt;I&gt;alert()&lt;/I&gt;&lt;I&gt; and &lt;/I&gt;&lt;I&gt;createElement()&lt;/I&gt;&lt;I&gt; inside the replacer function.&lt;/I&gt; &lt;/LI&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;space&lt;/FONT&gt;&lt;/B&gt; is an empty string, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should default &lt;FONT face="Courier New"&gt;space&lt;/FONT&gt; to an empty string instead of newline. &lt;/LI&gt;
&lt;LI&gt;If &lt;STRONG&gt;&lt;FONT face="Courier New"&gt;space&lt;/FONT&gt;&lt;/STRONG&gt; is a Number object or a String object, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should use the primitive value of the objects instead of ignoring the same. &lt;/LI&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;space&lt;/FONT&gt;&lt;/B&gt; is set to a value greater than 100, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should default &lt;FONT face="Courier New"&gt;space&lt;/FONT&gt; to be 100 instead of the current maximum limit of 65535 after which &lt;FONT face="Courier New"&gt;space&lt;/FONT&gt; is defaulted to 0. &lt;I&gt;Note: Per the latest ES5 &lt;/I&gt;&lt;A href="http://wiki.ecmascript.org/lib/exe/fetch.php?id=es3.1%3Aes3.1_proposal_working_draft&amp;amp;cache=cache&amp;amp;media=es3.1:es5_candidate_errata_may_27.doc" mce_href="http://wiki.ecmascript.org/lib/exe/fetch.php?id=es3.1%3Aes3.1_proposal_working_draft&amp;amp;cache=cache&amp;amp;media=es3.1:es5_candidate_errata_may_27.doc"&gt;&lt;I&gt;errata&lt;/I&gt;&lt;/A&gt;&lt;I&gt; (27 May’09) the max &lt;/I&gt;&lt;I&gt;space&lt;/I&gt;&lt;I&gt; should be defaulted to 10.&lt;/I&gt; &lt;/LI&gt;
&lt;LI&gt;If &lt;B&gt;&lt;FONT face="Courier New"&gt;space&lt;/FONT&gt;&lt;/B&gt; is a non integer numeric value, &lt;FONT face="Courier New"&gt;stringify&lt;/FONT&gt; should default &lt;FONT face="Courier New"&gt;space&lt;/FONT&gt; to be the integer part of the &lt;FONT face="Courier New"&gt;space&lt;/FONT&gt; value instead of defaulting it to the ceiling value of the &lt;FONT face="Courier New"&gt;space&lt;/FONT&gt; argument. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc836466(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc836466(VS.85).aspx"&gt;&lt;B&gt;&lt;FONT size=2 face="Courier New"&gt;JSON.parse (text[, reviver])&lt;/FONT&gt;&lt;/B&gt;&lt;/A&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If text contains control characters other than TAB, CR, or LF, throw a Syntax Error. In addition, throw a SyntaxError if TAB, CR, or LF appear in a JSON string literal. IE8 correctly rejects illegal characters outside of string literals. &lt;I&gt;Note: To work around this problem for string literals, user can define a reviver method that looks for string values containing control characters. Given the performance tradeoff to find these characters in all JSON text strings, a generic reviver is not provided in the sample below.&lt;/I&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc907896(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc907896(VS.85).aspx"&gt;&lt;B&gt;&lt;FONT size=2 face="Courier New"&gt;Date.prototype.toJSON (key)&lt;/FONT&gt;&lt;/B&gt;&lt;/A&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If the Date value is not a finite Number, &lt;FONT face="Courier New"&gt;toJSON&lt;/FONT&gt; should return &lt;FONT face="Courier New"&gt;null&lt;/FONT&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Note that the majority of these differences concerning the handling of invalid argument values or other unusual situations. Most of them have no impact on the encoding or decoding of normal data.&lt;/P&gt;
&lt;P&gt;A workaround for these differences is provided in the following patchJSON function which can be called to suitably modify the built-in JSON support methods, before using any of the JSON built-ins by a user. It places a wrapper around the built-in JSON functions.&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 5px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; PADDING-TOP: 5px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:59b176b7-810c-4471-8261-646d7aecd7ea class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BACKGROUND: #ddd; MAX-HEIGHT: 500px; OVERFLOW: scroll; PADDING-TOP: 0px"&gt;
&lt;OL style="MARGIN: 0px 0px 0px 45px; BACKGROUND: #ffffff"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt; patchJSON() {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Check if JSON exists, or if&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// JSON has already been patched or updated&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((!&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.JSON) || (JSON.stringify(undefined) !== &lt;SPAN style="COLOR: #a31515"&gt;'undefined'&lt;/SPAN&gt;))&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;false&lt;/SPAN&gt;;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;//JSON has already been patched or updated;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt; builtinStringify = JSON.stringify;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;JSON.stringify = newStringify;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Date.prototype.toJSON returns null for Dates with a non finite value&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt; origDateToJSON = Date.prototype.toJSON;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((origDateToJSON.toString()) ===&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #a31515"&gt;"\nfunction toJSON() {\n&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[native code]\n}\n"&lt;/SPAN&gt;) {&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Date.prototype.toJSON = &lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;(value) {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (isNaN(&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.valueOf())) &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; origDateToJSON.call(&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;, value);&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;true&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt; newStringify(value, replacer, space) {&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Return undefined when value parameter is undefined&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// or when toJSON exists and returns undefined&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((value === undefined) &amp;amp;&amp;amp; !(replacer)) &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; undefined;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (value &amp;amp;&amp;amp; &lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; value === &lt;SPAN style="COLOR: #a31515"&gt;'object'&lt;/SPAN&gt; &amp;amp;&amp;amp;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; value.toJSON === &lt;SPAN style="COLOR: #a31515"&gt;'function'&lt;/SPAN&gt; &amp;amp;&amp;amp;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;!replacer &amp;amp;&amp;amp; value.toJSON(&lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt;) === undefined)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; undefined;&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Return undefined when value paramenter is a function&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; value === &lt;SPAN style="COLOR: #a31515"&gt;"function"&lt;/SPAN&gt;) &amp;amp;&amp;amp; !(replacer)) &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; undefined;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Ignore the replacer and do not throw an error if the replacer &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// is not a function or array.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (replacer &amp;amp;&amp;amp; (&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; replacer !== &lt;SPAN style="COLOR: #a31515"&gt;"function"&lt;/SPAN&gt;)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp;&amp;amp; !(replacer &lt;SPAN style="COLOR: #0000ff"&gt;instanceof&lt;/SPAN&gt; Array))&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;replacer = &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (space !== undefined) {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Treat empty string as no space&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (space === &lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt;) space = 0;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; space === &lt;SPAN style="COLOR: #a31515"&gt;"object"&lt;/SPAN&gt;) {&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// If space is a Number object or String object &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// use it's primitive value&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((space &lt;SPAN style="COLOR: #0000ff"&gt;instanceof&lt;/SPAN&gt; Number) || (space &lt;SPAN style="COLOR: #0000ff"&gt;instanceof&lt;/SPAN&gt; String))&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;space = space.valueOf();&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Ignore objects other than Number and Strings&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; space = 0;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// If space is set to a value greater than 10, space should be &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// defaulted to 10. If space is not integral, use the floor value&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// If space string has a length greater than 10, &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// space should be defaulted to first 10 characters&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; space === &lt;SPAN style="COLOR: #a31515"&gt;"number"&lt;/SPAN&gt;) space = Math.min(10,&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Math.floor(Math.abs(space)));&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; space === &lt;SPAN style="COLOR: #a31515"&gt;"string"&lt;/SPAN&gt;) {&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (space.length &amp;gt; 10)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;space = space.slice(0, 10);&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; space = 0;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Return primitive number, string or boolean value stored&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// in the Number, String or Boolean object&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt; newReplacer(key, value) {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Execute the replacerand get it's return value&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt; tmpValue = replacer.call(&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;, key, value);&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// If value is a Number or String or Boolean object &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// use its primitive value&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; tmpValue === &lt;SPAN style="COLOR: #a31515"&gt;"object"&lt;/SPAN&gt;) {&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((tmpValue &lt;SPAN style="COLOR: #0000ff"&gt;instanceof&lt;/SPAN&gt; Number) || (tmpValue &lt;SPAN style="COLOR: #0000ff"&gt;instanceof&lt;/SPAN&gt; String) ||&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(tmpValue &lt;SPAN style="COLOR: #0000ff"&gt;instanceof&lt;/SPAN&gt; Boolean)) tmpValue = tmpValue.valueOf();&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; tmpValue;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt; {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Check if the replacer returns undefined or a function&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// If it does, return undefined&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt; tmpValue = value;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (replacer &amp;amp;&amp;amp; &lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; replacer === &lt;SPAN style="COLOR: #a31515"&gt;"function"&lt;/SPAN&gt;) {&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tmpValue = newReplacer.call({ &lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt;: tmpValue }, &lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt;, tmpValue);&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; ((tmpValue === undefined) ||&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt; tmpValue == &lt;SPAN style="COLOR: #a31515"&gt;'function'&lt;/SPAN&gt;)) &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; undefined;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; builtinStringify(value, newReplacer, space);&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; builtinStringify(value, replacer, space);&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #008000"&gt;// Throw a Type Error if value is a cyclic objects&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt; (e) {&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt; replacementException = e;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (e.number === -2146823254) {&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;replacementException = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; TypeError();&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;replacementException.description = e.description;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;replacementException.message = e.message;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;replacementException.number = e.number;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;throw&lt;/SPAN&gt; replacementException;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Because the above patch primarily deals with errors that arise from improperly calling the JSON functions it is most useful while you are debugging your code. When you code is ready for production you may not need to use.&lt;/P&gt;
&lt;P&gt;Note: Apart from the above differences due to the changes in the ES5 draft specifications for JSON, there is a known issue which currently exists for IE8. The details of the same along with the possible workarounds are covered in this blog &lt;A href="http://blogs.msdn.com/jscript/archive/2009/06/23/serializing-the-value-of-empty-dom-elements-using-native-json-in-ie8.aspx" mce_href="http://blogs.msdn.com/jscript/archive/2009/06/23/serializing-the-value-of-empty-dom-elements-using-native-json-in-ie8.aspx"&gt;post&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;In case you will like to follow the discussions by the TC39 members around how the standard is taking shape, and the discussion around the changes for JSON, you can refer the discussion archives &lt;A href="https://mail.mozilla.org/pipermail/es5-discuss/" mce_href="https://mail.mozilla.org/pipermail/es5-discuss/"&gt;here&lt;/A&gt;. The latest ES5 drafts are available at the &lt;A href="http://wiki.ecmascript.org/doku.php?id=es3.1:es3.1_proposal_working_draft" mce_href="http://wiki.ecmascript.org/doku.php?id=es3.1:es3.1_proposal_working_draft"&gt;ECMAScript wiki&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Gaurav Seth, Program Manager, JScript&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9798184" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx">JScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category></item><item><title>Serializing the value of empty DOM elements using native JSON in IE8</title><link>http://blogs.msdn.com/jscript/archive/2009/06/23/serializing-the-value-of-empty-dom-elements-using-native-json-in-ie8.aspx</link><pubDate>Mon, 22 Jun 2009 19:11:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9798164</guid><dc:creator>GauravS</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/jscript/comments/9798164.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=9798164</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=9798164</wfw:comment><description>&lt;p&gt;With native JSON support enabled in IE8, users can now take advantage of the built-in &lt;a href="http://msdn.microsoft.com/en-us/library/cc836459(VS.85).aspx"&gt;JSON.stringify&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/cc836466(VS.85).aspx"&gt;JSON.parse&lt;/a&gt; methods to serialize and deserialize JScript values to JSON text and vice versa. However, there is a known issue in IE8’s native JSON implementation, wherein if a user tries to read the value of an empty DOM element, and serialize the same using native JSON, the result is not the same as a user would expect while serializing &lt;font face="Courier New"&gt;&amp;quot;&amp;quot;&lt;/font&gt;.&lt;/p&gt;  &lt;p&gt;Here is a sample code which demonstrates the problem:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; foo = document.createElement(&lt;span style="color: #006080"&gt;&amp;quot;input&amp;quot;&lt;/span&gt;).value; &lt;span style="color: #008000"&gt;// foo === &amp;quot;&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; bar = &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt;; &lt;span style="color: #008000"&gt;// bar === &amp;quot;&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; JSON.stringify(foo); &lt;span style="color: #008000"&gt;// retuns '&amp;quot;null&amp;quot;' &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; JSON.stringify(bar); &lt;span style="color: #008000"&gt;// retuns '&amp;quot;&amp;quot;' &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Another similar example is when a user serializes the value from an empty input control, as below.&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; foo = document.getElementById(&lt;span style="color: #006080"&gt;'data'&lt;/span&gt;).value; &lt;span style="color: #008000"&gt;// no value provided in the 'data' input control&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; JSON.stringify(foo); &lt;span style="color: #008000"&gt;// retuns '&amp;quot;null&amp;quot;'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;In both the above cases, serialization of foo should have generated &lt;font face="Courier New"&gt;'&amp;quot;&amp;quot;'&lt;/font&gt; instead of &lt;font face="Courier New"&gt;'&amp;quot;null&amp;quot;'&lt;/font&gt;. This is a bug in the production version of IE8.&amp;#160; The problem here is that within the DOM a special encoding is used to represent a missing string value.&amp;#160; Even though this special value is different from the encoding of the JScript literal &amp;quot;&amp;quot;, throughout the JScript implementation the value is treated as being === to&lt;font face="Courier New"&gt; &amp;quot;&amp;quot;&lt;/font&gt;, except for a specific case in &lt;font face="Courier New"&gt;JSON.stringify&lt;/font&gt;.&lt;/p&gt;

&lt;p&gt;Since this special value only originates from accesses to DOM objects, a workaround would be to explicitly censor them on every DOM access that might return one.&amp;#160; For example,&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (foo === &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt;) foo = &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt;; &lt;span style="color: #008000"&gt;//ensure that possibly bogus &amp;quot;&amp;quot; is replaced with a real &amp;quot;&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; JSON.stringify(foo); &lt;span style="color: #008000"&gt;// retuns '&amp;quot;&amp;quot;'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Also, since the difference is only observable via JSON.stringify, another alternative is to use the replacer function to perform the substitution. For example:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; JSON.stringify(foo, &lt;span style="color: #0000ff"&gt;function&lt;/span&gt;(k, v) { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; v === &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt; ? &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt; : v });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #008000"&gt;//the above will return '&amp;quot;&amp;quot;', not '&amp;quot;null&amp;quot;'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Either of the above workarounds has the disadvantage that additional code must be written each time the value of an InputElement element is accessed or each time &lt;font face="Courier New"&gt;JSON.stringify &lt;/font&gt;is called. Another possible workaround that avoids this extra coding is to use the IE8 &lt;a href="http://msdn.microsoft.com/en-us/library/cc288472.aspx#javascript"&gt;Mutable DOM Prototype&lt;/a&gt; features to patch &lt;font face="Courier New"&gt;HTMLInputElement.prototype.value &lt;/font&gt;such that the undesired value is filtered out every time value is accessed. For example, consider this HMTL file: &lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &amp;lt;!DOCTYPE html PUBLIC &lt;span style="color: #006080"&gt;&amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;/span&gt; &lt;span style="color: #006080"&gt;&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &amp;lt;html xmlns=&lt;span style="color: #006080"&gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt; &amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &amp;lt;head&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &amp;lt;title&amp;gt;Test Page&amp;lt;/title&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &amp;lt;script&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (JSON.stringify(document.createElement(&lt;span style="color: #006080"&gt;&amp;quot;input&amp;quot;&lt;/span&gt;).value)===&lt;span style="color: #006080"&gt;'&amp;quot;null&amp;quot;'&lt;/span&gt;) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;        &lt;span style="color: #008000"&gt;//Wrapper HTMLInputElement.prototype.value with a new get accessor&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;        &lt;span style="color: #008000"&gt;//that filters special DOM empty string value &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;        (&lt;span style="color: #0000ff"&gt;function&lt;/span&gt;() {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;           &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; builtInInputValue = &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;             Object.getOwnPropertyDescriptor(&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;                   HTMLInputElement.prototype, &lt;span style="color: #006080"&gt;&amp;quot;value&amp;quot;&lt;/span&gt;).get;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;             Object.defineProperty(HTMLInputElement.prototype, &lt;span style="color: #006080"&gt;&amp;quot;value&amp;quot;&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;                   { get: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt;() {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;                      &lt;span style="color: #008000"&gt;//Call builtin value accessor &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;                      &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; possiblyBad = builtInInputValue.call(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;                      &lt;span style="color: #008000"&gt;//Replace DOM empty string with real &amp;quot;&amp;quot; &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;                      &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; possiblyBad === &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt; ? &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt; : possiblyBad;    &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;                      }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;              });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;            })(); &lt;span style="color: #008000"&gt;// call anonymous function to install the wrapper&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;         );&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;     &amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt; &amp;lt;/head&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt; &amp;lt;body&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;   &amp;lt;input type=&lt;span style="color: #006080"&gt;&amp;quot;button&amp;quot;&lt;/span&gt; value=&lt;span style="color: #006080"&gt;&amp;quot;click to test&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt;       onclick=&lt;span style="color: #006080"&gt;&amp;quot;alert(JSON.stringify(document.createElement('input').value));&amp;quot;&lt;/span&gt; /&amp;gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt; &amp;lt;/body&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt; &amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;In the &lt;font face="Courier New"&gt;&amp;lt;head&amp;gt;&lt;/font&gt; of this page a test is made to see if the anomalous &lt;font face="Courier New"&gt;stringify&lt;/font&gt; behavior is observed. If so, &lt;font face="Courier New"&gt;HTMLInputElement.prototype.value &lt;/font&gt;is modified to correct the problem. Any access to the &lt;font face="Courier New"&gt;value&lt;/font&gt; property of an Input element within the body of the page, such as the click handler that is shown, will now return the correct &lt;font face="Courier New"&gt;&amp;quot;&amp;quot;&lt;/font&gt; value.&lt;/p&gt;

&lt;p&gt;This explains the anomaly in the IE8 JSON behavior while serializing the value of certain DOM elements and show three different possible workarounds to the problem. &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Gaurav Seth, Program Manager, JScript&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9798164" width="1" height="1"&gt;</description></item><item><title>Versioning Language Features in JScript</title><link>http://blogs.msdn.com/jscript/archive/2009/04/17/versioning-language-features-in-jscript.aspx</link><pubDate>Thu, 16 Apr 2009 22:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9553580</guid><dc:creator>GauravS</dc:creator><slash:comments>14</slash:comments><comments>http://blogs.msdn.com/jscript/comments/9553580.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=9553580</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=9553580</wfw:comment><description>&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;With &lt;A href="http://blogs.msdn.com/ie/archive/2009/03/19/internet-explorer-8-final-available-now.aspx"&gt;&lt;FONT color=#0000ff&gt;Internet Explorer 8&lt;/FONT&gt;&lt;/A&gt; we introduced several new JScript language features including &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2008/09/10/native-json-in-ie8.aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;native JSON support&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; and &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd229916(VS.85).aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;accessor methods&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; for Mutable DOM prototypes. Of course, any new language feature introduces compatibility risk and one of the main pieces of feedback we received was that we needed to provide a smart way for developers to opt in or out of these new language features.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;So in the&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; JScript engine shipped as a part of Internet Explorer 8, we introduced a versioning switch which enables developers to choose the JScript language set they want to support. Web developers can opt-in/opt-out of &lt;SPAN style="COLOR: black"&gt;select JScript language&lt;/SPAN&gt; features by using IE8’s &lt;SPAN style="COLOR: #1f497d"&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx"&gt;Document Compatibility&lt;/A&gt;&lt;/SPAN&gt;, which depends upon the layout (or document) mode in which web content is loaded.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;B&gt;&lt;U&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;Potential Issue: Example&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;As an example, let’s look at IE8’s &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2008/09/10/native-json-in-ie8.aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;native JSON support&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;. We added this support to the engine by adding a global JSON object with built-in &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;parse()&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; and &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;stringify()&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; methods, as per the &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://wiki.ecmascript.org/doku.php?id=es3.1:es3.1_proposal_working_draft"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;draft ES3.1 specification&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;,&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;now called the &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-themecolor: dark2"&gt;&lt;A href="http://blogs.msdn.com/jscript/archive/2009/04/09/a-major-milestone-in-javascript-standardization.aspx"&gt;ECMAScript Fifth Edition&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;. Now, for the sake of example, let us pretend that the JScript engine did not allow language versioning and a site implemented a JSON call like this: &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Segoe UI','sans-serif'; COLOR: #1f497d; mso-themecolor: dark2"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: windowtext 1pt solid; BORDER-LEFT: windowtext 1pt solid; PADDING-BOTTOM: 1pt; PADDING-LEFT: 0in; PADDING-RIGHT: 4pt; BACKGROUND: white; BORDER-TOP: windowtext 1pt solid; BORDER-RIGHT: windowtext 1pt solid; PADDING-TOP: 1pt; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt"&gt;
&lt;P style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; LINE-HEIGHT: 12pt; MARGIN: 0in 0in 0pt; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BACKGROUND: white; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-alt: solid windowtext .5pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0in" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: #606060; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;1:&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: blue; FONT-SIZE: 8pt"&gt;if&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; FONT-SIZE: 8pt"&gt;(!&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.JSON) &lt;SPAN style="COLOR: green"&gt;// check for non-existence of JSON object/functions &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; LINE-HEIGHT: 12pt; MARGIN: 0in 0in 0pt; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BACKGROUND: #f4f4f4; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-alt: solid windowtext .5pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0in" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: #606060; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;2:&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text1" lang=EN&gt;{&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; LINE-HEIGHT: 12pt; MARGIN: 0in 0in 0pt; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BACKGROUND: white; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-alt: solid windowtext .5pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0in" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: #606060; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;3:&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: green; FONT-SIZE: 8pt"&gt;//&amp;lt;define a JSON object&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; LINE-HEIGHT: 12pt; MARGIN: 0in 0in 0pt; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BACKGROUND: #f4f4f4; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-alt: solid windowtext .5pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0in" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: #606060; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;4:&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: green; FONT-SIZE: 8pt; mso-bidi-font-size: 10.0pt"&gt;//&amp;lt;define a non-standard compliant encoder function – JSON.encode&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 6pt; mso-bidi-font-size: 8.0pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; LINE-HEIGHT: 115%; MARGIN: 0in 0in 0pt; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BACKGROUND: white; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0in; mso-shading: transparent" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Consolas; COLOR: #606060; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;5:&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Consolas; COLOR: green; FONT-SIZE: 8pt"&gt;//&amp;lt;define a non-standard compliant parser function – JSON.parse&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Consolas; COLOR: green; FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; LINE-HEIGHT: 12pt; MARGIN: 0in 0in 0pt; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BACKGROUND: #f4f4f4; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-alt: solid windowtext .5pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0in" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: #606060; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;6:&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; FONT-SIZE: 10pt"&gt;}&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; LINE-HEIGHT: 12pt; MARGIN: 0in 0in 0pt; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BACKGROUND: white; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-alt: solid windowtext .5pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0in" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: #606060; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;7:&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; LINE-HEIGHT: 12pt; MARGIN: 0in 0in 0pt; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BACKGROUND: #f4f4f4; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-alt: solid windowtext .5pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0in" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: #606060; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;8:&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: green; FONT-SIZE: 8pt"&gt;//somewhere in the code&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; LINE-HEIGHT: 12pt; MARGIN: 0in 0in 0pt; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BACKGROUND: white; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-alt: solid windowtext .5pt; tab-stops: 45.8pt 91.6pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 0in" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: #606060; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;9:&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'" lang=EN&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 8pt"&gt;JSON.enco&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; FONT-SIZE: 8pt"&gt;de(&lt;SPAN style="COLOR: black; mso-themecolor: text1"&gt;myObj&lt;/SPAN&gt;);&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-themecolor: dark2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;For IE7, since no JSON object existed by default, the &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;if&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; check would evaluate to &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; FONT-SIZE: 10pt"&gt;true&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; and the user defined JSON object and encoder/decoder methods would be defined. The call to &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 10pt"&gt;JSON.encode()&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; would work as wanted. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;However, for IE8, the existence of the native JSON object would cause the &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; FONT-SIZE: 10pt"&gt;if&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; check to evaluate to &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; FONT-SIZE: 10pt"&gt;false&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; and no user defined method would be available. The call to &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 10pt"&gt;JSON.e&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Consolas; FONT-SIZE: 10pt"&gt;ncode()&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; would now fail, which would produce unexpected&amp;nbsp;application behavior, since no such method was defined.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;B&gt;&lt;U&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;JScript Versioning in Internet Explorer 8 (for Web Developers)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;Web developers can now avoid such issues by choosing an appropriate layout (or document) mode for their content. Choosing the layout mode as “Internet Explorer 8 Standards Mode” opts in to the JScript language features supported by version 5.8 JScript engine. Choosing the layout mode to be any mode other than the “Internet Explorer 8 Standards” mode, would imply an opt-in to support JScript language feature set equivalent to the one shipped in version 5.7 of the JScript engine (equivalent to the one shipped in IE7). Going back to the example above, the site owner can either update the code to start taking advantage of native JSON support and use the “Internet Explorer 8 Standards” mode, or can choose any other layout mode to use the existing code as is, thus maintaining &amp;nbsp;compatibility with IE7.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;While a dependency on the document mode implies that developers will need to make a switch to both IE and JScript level features and can’t single out/opt-in only to the JScript changes, we did not want to introduce a new version vector specifically for the JScript engine. We wanted to support the same system used by IE8 overall for standards support. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;You could read more about IE8’s Compatibility View feature in Scott Dicken’s blog &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2009/02/16/just-the-facts-recap-of-compatibility-view.aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;Just The Facts: Recap of Compatibility View&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; and the MSDN documentation for &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;Defining Document Compatibility&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;B&gt;&lt;U&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;JScript Versioning in other JScript Hosts (for JScript Host Developers)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;Apart from Internet Explorer, there are various other hosts such as Windows Script Host, CScript etc. which host the JScript engine, To avoid similar compatibility issues and enable hosts to choose a particular JScript language feature set, the JScript engine now exposes an &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc512776(VS.85).aspx"&gt;IActiveScriptProperty&lt;/A&gt;::SCRIPTPROP_INVOKEVERSIONING&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; property. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;To opt in to a set of language features that should be supported by the JScript script engine, the host needs to invoke the &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc512774(VS.85).aspx"&gt;&lt;FONT color=#0000ff&gt;IActiveScriptProperty::SetProperty&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; and set &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;SCRIPTPROP_INVOKEVERSIONING&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; to one of the values below during the engine initialization:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;1 (or &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;SCRIPTLANGUAGEVERSION_5_7&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;):&amp;nbsp; To use the language features equivalent to those shipped in Version 5.7 (or IE7) of the JScript engine&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;2 (or &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;SCRIPTLANGUAGEVERSION_5_8&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;):&amp;nbsp; To use the language features available in Version 5.8 (or IE8) of the JScript script engine. This includes features available in version 5.7 and the language changes introduced in version 5.8.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;By default, the set of language features supported by the JScript script engine is set to 0 (or &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;SCRIPTLANGUAGEVERSION_DEFAULT&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;), equivalent to the language feature set shipped in version 5.7 of the JScript engine, unless the host chooses to support a different default behavior. &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #1f497d; mso-themecolor: dark2"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;B&gt;&lt;U&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;List of features versioned&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;Right now, only nine JScript features are versioned like this: &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo2" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc836458(VS.85).aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;Native JSON support&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt; – This would introduce a new built-in JSON object, and the following built-in methods – &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;JSON.parse(), JSON.stringify(), Date.toJSON(), Number.toJSON(), Boolean.toJSON()&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt; and &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;String.toJSON()&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo2" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;Support for &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd229916(VS.85).aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;accessor methods&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt; for enabling Document Object Model prototypes &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo2" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;Default the separator to “,” if the separator value is ‘&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;undefined’&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt; in &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;Array.prototype.join&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo2" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;Return the length of the resultant array instead of ‘undefined’ for &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;Array.prototype.unshift&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo2" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;Call &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;toString()&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt; if precision is ‘undefined’ instead of throwing a “&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;RangeError&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;” for &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;Number.prototype.toPrecision&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo2" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;Support for array &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;subclassing&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo2" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;Support for trailing commas in object literals&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo2" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;Implemented &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"&gt;Error.prototype.toString&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt; to provide better error messages &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo2" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'; mso-fareast-font-family: 'Times New Roman'"&gt;Support for index operator [] on string values&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;I hope JScript versioning will help ensure that the IE8 end user experience is compatible with IE7 and will give developers some time to update their code to take advantage of these new language enhancements. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;Gaurav Seth&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;Program Manager, JScript &lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9553580" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Intellisense/default.aspx">JScript Intellisense</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/IE/default.aspx">IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Developers/default.aspx">Developers</category></item><item><title>A Major Milestone in JavaScript Standardization</title><link>http://blogs.msdn.com/jscript/archive/2009/04/09/a-major-milestone-in-javascript-standardization.aspx</link><pubDate>Thu, 09 Apr 2009 17:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9540852</guid><dc:creator>GauravS</dc:creator><slash:comments>14</slash:comments><comments>http://blogs.msdn.com/jscript/comments/9540852.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=9540852</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=9540852</wfw:comment><description>&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;In the world of web standards, JavaScript is known as ECMAScript and maintenance of its definition is the responsibility of the Ecma International standards organization.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The ECMAScript standard was last updated in 1999, so it is quite significant that Ecma has &lt;A href="http://www.ecma-international.org/news/PressReleases/PR_Ecma_finalises_major_revision_of_ECMAScript.htm"&gt;announced&lt;/A&gt; that it has completed development of a &lt;A href="http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf"&gt;revised ECMAScript specification&lt;/A&gt; and is releasing it for public review and testing in anticipation of final standardization later this year. This version is named ECMAScript, Fifth Edition Candidate Specification.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;The goal of this revision was to update the ECMAScript specification to reflect the language as it is actually implemented in modern web browsers and to establish a foundation for the future evolutions of the language.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;New features include accessor properties, reflective creation and inspection of objects, program control of property attributes, additional array manipulation functions, support for the JSON object encoding format, and a strict mode that provides enhanced error checking and program security. Many of these features standardize enhanced functionality that has been provided by individual browsers but has not yet been universally adopted. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;So, what does it mean for this to be a “candidate specification”? All the contributors to this development wanted to make sure that revising the ECMAScript specification would improve the web for developers. To this end, we all committed to not finalizing a revision unless it had first been demonstrated that the revision can be interoperably implemented by web browsers and that such implementations can continue to compatibility handle existing web content.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The “candidate specification” is the specification revision that is going to be tested against those requirements.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Having reached the “candidate specification” milestone means that all features are frozen and that we are done with specification writing. Microsoft and others are already well along with prototype implementations that will be used for testing. We all hope and expect that the testing will be successful and completed by the end of this summer so that the ECMAScript Fifth Edition can be ratified as an official web standard by the end of this year.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;For the average web developer the release of a candidate specification has little immediate impact because you have to create content that works with the browser versions that are actually in use today.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;However, we expect that once it is finally approved, the revised ECMAScript standard to be widely and fairly rapidly adopted by browsers.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In the meantime, this new specification is already having an impact.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For example, in IE8 both the &lt;A href="http://blogs.msdn.com/ie/archive/2008/09/10/native-json-in-ie8.aspx"&gt;&lt;FONT color=#0000ff&gt;native JSON&lt;/FONT&gt;&lt;/A&gt; and the &lt;A href="http://blogs.msdn.com/ie/archive/2009/01/13/responding-to-change-updated-getter-setter-syntax-in-ie8-rc-1.aspx"&gt;&lt;FONT color=#0000ff&gt;DOM Prototypes&lt;/FONT&gt;&lt;/A&gt; features are based upon APIs defined in the ECMAScript Fifth Edition Specification.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;Microsoft was deeply involved with the development of the ECMAScript, Fifth Edition specification with Pratap Lakshman and Allen Wirfs-Brock serving as project editors.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Within the context of Ecma we worked closely with colleagues from many organizations including Google, Mozilla, Yahoo!, Opera, and Apple to jointly craft a specification that should benefit the entire web development community. The release of the ECMAScript Fifth Edition Candidate Specification is an important step towards better browser interoperability using a more powerful version of JavaScript.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We are very pleased to have helped make it happen.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;Allen Wirfs-Brock&lt;BR&gt;Pratap Lakshman&lt;BR&gt;Microsoft Representatives to ECMA TC-39&lt;BR&gt;Co-project Editors, ECMAScript Fifth Edition Specification&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9540852" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category></item><item><title>What’s new in JScript for IE8</title><link>http://blogs.msdn.com/jscript/archive/2009/03/25/what-s-new-in-jscript-for-ie8.aspx</link><pubDate>Wed, 25 Mar 2009 02:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9506187</guid><dc:creator>GauravS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jscript/comments/9506187.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=9506187</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=9506187</wfw:comment><description>&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;During &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://blogs.msdn.com/jscript/archive/2008/03/05/jscript-in-internet-explorer-8-beta-1-for-developers.aspx" mce_href="http://blogs.msdn.com/jscript/archive/2008/03/05/jscript-in-internet-explorer-8-beta-1-for-developers.aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;Beta1&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; and &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2008/09/09/what-s-new-for-jscript-for-ie8-beta-2.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/09/09/what-s-new-for-jscript-for-ie8-beta-2.aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;Beta2&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; pre-releases of IE8, we’ve blogged about the performance optimizations done in the Script engine and the addition of new language features such as &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2008/09/10/native-json-in-ie8.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/09/10/native-json-in-ie8.aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;native JSON support&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;. We also provided details about the &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://blogs.msdn.com/jscript/archive/2008/09/17/jscript-debugger-in-internet-explorer-8-beta-2.aspx" mce_href="http://blogs.msdn.com/jscript/archive/2008/09/17/jscript-debugger-in-internet-explorer-8-beta-2.aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;&lt;FONT color=#0000ff&gt;JScript Debugger&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; and the &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2008/09/11/introducing-the-ie8-developer-tools-jscript-profiler.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/09/11/introducing-the-ie8-developer-tools-jscript-profiler.aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;&lt;FONT color=#0000ff&gt;JScript Profiler&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt; –&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;that shipped as part &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2008/09/03/developer-tools-in-internet-explorer-8-beta-2.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/09/03/developer-tools-in-internet-explorer-8-beta-2.aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;&lt;FONT color=#0000ff&gt;IE8 Developer Tools&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;One of the big pieces of feedback during our beta cycles was for compatibility, which, for JScript, meant focusing on how we version some of the language features we’re adding. As a result, version 5.8 of the JScript engine (shipped as a part of IE8) introduced an opt-in versioning mechanism for all the new and breaking language features. The JScript engine now exposes new language features only when the layout (document) mode is set to “IE8 Standards Mode.” Versioned JScript language features available in this release include native JSON support and &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd229916(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd229916(VS.85).aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;&lt;FONT color=#0000ff&gt;accessor methods&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; for enabling &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2009/01/13/responding-to-change-updated-getter-setter-syntax-in-ie8-rc-1.aspx" mce_href="http://blogs.msdn.com/ie/archive/2009/01/13/responding-to-change-updated-getter-setter-syntax-in-ie8-rc-1.aspx"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;&lt;FONT color=#0000ff&gt;Document Object Model prototypes&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;In addition to addressing bugs that were reported during the betas and our internal testing, we have added some user requested changes in the developer tools.&amp;nbsp; A more seamless debugging experience, profiling multi-frame web pages and searching the profile reports using the search bar are some of the cool features we have added.&amp;nbsp; We think developer tools will make life a whole lot easier for you web developers out there –&amp;nbsp; we would love to hear your feedback!&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;As outlined in the &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"&gt;&lt;A href="http://www.code-magazine.com/Article.aspx?quickid=0811102" mce_href="http://www.code-magazine.com/Article.aspx?quickid=0811102"&gt;&lt;SPAN style="mso-bidi-font-family: 'Segoe UI'"&gt;article&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt; I wrote in the Code Focus Magazine during beta2, we have made more targeted performance improvements in the JScript engine and the overall AJAX browser stack to improve end-to-end performance of real world applications. On typical AJAX applications such as GMail, commonly used operations have improved over 40% over IE7.&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;I would like to thank all of you for your support and feedback through the IE8 product development cycle and hope that you like the JScript enhancements done in IE8.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;Shreesh Dubey&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Segoe UI'"&gt;Product Unit Manager, JScript&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN" lang=EN&gt;Note: The comments on this blog are blocked. Pl post your comments on the &lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN" lang=EN&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2009/03/24/what-s-new-in-jscript-for-ie8.aspx" mce_href="http://blogs.msdn.com/ie/archive/2009/03/24/what-s-new-in-jscript-for-ie8.aspx"&gt;&lt;I&gt;IE team blog&lt;/I&gt;&lt;/A&gt;&lt;I&gt;, so that they can be collated at one place.&lt;o:p&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9506187" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/IE/default.aspx">IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/AJAX/default.aspx">AJAX</category></item><item><title>Internet Explorer 8 Final Available Now</title><link>http://blogs.msdn.com/jscript/archive/2009/03/19/internet-explorer-8-final-available-now.aspx</link><pubDate>Thu, 19 Mar 2009 16:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9490465</guid><dc:creator>GauravS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jscript/comments/9490465.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=9490465</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=9490465</wfw:comment><description>&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;Internet Explorer 8 Final is now available in 25 languages. &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;IE8 makes what real people do on the web every day faster, easier, and safer. Anyone running Windows Vista, Windows XP, and Windows Server can get 32-bit and 64-bit versions now from &lt;A href="http://www.microsoft.com/ie8"&gt;&lt;FONT color=#0000ff&gt;http://www.microsoft.com/ie8&lt;/FONT&gt;&lt;/A&gt;. (Windows 7 users will receive an updated IE8 as part of the next Windows 7 milestone.)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;Read more about IE8 at the &lt;A href="http://blogs.msdn.com/ie/archive/2009/03/19/internet-explorer-8-final-available-now.aspx"&gt;IE Blog&lt;/A&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;Note: The comments on this blog are blocked. Pl post your comments on the &lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;&lt;A href="http://blogs.msdn.com/ie/"&gt;&lt;I&gt;IE team blog&lt;/I&gt;&lt;/A&gt;&lt;I&gt;, so that they can be collated at one place.&lt;o:p&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;Gaurav Seth, Program Manager&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;JScript Team&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9490465" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/IE/default.aspx">IE</category></item><item><title>Internet Explorer 8 Release Candidate Now Available</title><link>http://blogs.msdn.com/jscript/archive/2009/01/27/internet-explorer-8-release-candidate-now-available.aspx</link><pubDate>Mon, 26 Jan 2009 20:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9376222</guid><dc:creator>GauravS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jscript/comments/9376222.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=9376222</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=9376222</wfw:comment><description>&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2009/01/26/internet-explorer-8-release-candidate-now-available.aspx"&gt;&lt;FONT color=#0000ff&gt;Internet Explorer 8 Release Candidate Is Now Available&lt;/FONT&gt;&lt;/A&gt;.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;Here is post that would help you &lt;A href="http://blogs.msdn.com/ie/archive/2009/01/26/upgrading-to-internet-explorer-8-release-candidate-1.aspx"&gt;Upgrade to Internet Explorer 8 Release Candidate 1&lt;/A&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;Note: The comments on this blog are blocked. Pl post your comments on the &lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;&lt;A href="http://blogs.msdn.com/ie/"&gt;&lt;I&gt;IE team blog&lt;/I&gt;&lt;/A&gt;&lt;I&gt;, so that they can be collated at one place.&lt;/I&gt;&lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;Gaurav Seth&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;Program Manager&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-bidi-font-size: 11.0pt" lang=EN&gt;JScript Team&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9376222" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JavaScript+Performance+IE/default.aspx">JavaScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx">JScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/IE/default.aspx">IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+functions/default.aspx">JScript functions</category><category domain="http://blogs.msdn.com/jscript/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Developers/default.aspx">Developers</category></item><item><title>JScript Debugger in Internet Explorer 8 Beta 2</title><link>http://blogs.msdn.com/jscript/archive/2008/09/17/jscript-debugger-in-internet-explorer-8-beta-2.aspx</link><pubDate>Wed, 17 Sep 2008 09:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8955251</guid><dc:creator>deepak.jain</dc:creator><slash:comments>28</slash:comments><comments>http://blogs.msdn.com/jscript/comments/8955251.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=8955251</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=8955251</wfw:comment><description>&lt;P&gt;In Internet Explorer 8 Beta 2 JScript team has focused on improving developer productivity. You can read &lt;A href="http://blogs.msdn.com/ie/archive/2008/09/09/what-s-new-for-jscript-for-ie8-beta-2.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/09/09/what-s-new-for-jscript-for-ie8-beta-2.aspx"&gt;'What’s new in JScript for IE8 Beta 2'&lt;/A&gt; and check out the &lt;A href="http://channel9.msdn.com/posts/janakiram/Whats-New-for-JScript-in-IE8/" mce_href="http://channel9.msdn.com/posts/janakiram/Whats-New-for-JScript-in-IE8/"&gt;JScript PM Channel 9 video&lt;/A&gt; to learn more. As part of our focus on developer productivity we have continued to invest in the IE8 Developer Tools in IE8 and added a JScript Profiler to the developer tools. You can read &lt;A href="http://blogs.msdn.com/ie/archive/2008/09/11/introducing-the-ie8-developer-tools-jscript-profiler.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/09/11/introducing-the-ie8-developer-tools-jscript-profiler.aspx"&gt;'Introducing the IE8 Developer Tools JScript Profiler'&lt;/A&gt; for more details on the profiler. The JScript profiler along with the JScript debugger we introduced in Internet Explorer Beta 1 will help you get your site working correctly and optimally. &lt;/P&gt;
&lt;P&gt;In this blog I will give more details about the following key improvements we have made in debugger for beta 2, you can check my &lt;A href="http://blogs.msdn.com/jscript/archive/2008/03/13/jscript-debugger-in-internet-explorer-8.aspx" mce_href="http://blogs.msdn.com/jscript/archive/2008/03/13/jscript-debugger-in-internet-explorer-8.aspx"&gt;JScript Debugger in Internet Explorer 8 Beta 1&lt;/A&gt; blog for more details on the features we released in Beta 1:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Improved script viewer and script explorer &lt;/LI&gt;
&lt;LI&gt;More powerful script console &lt;/LI&gt;
&lt;LI&gt;New execution control features &lt;/LI&gt;
&lt;LI&gt;Better keyboard navigation and overall usability &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;One of the goals for the script debugger has been to make sure that debugger has minimal impact on your regular browsing. We made that possible by moving JScript engine to debug mode only when you press start debugging. With this, you no longer need to keep debugging enabled in the Internet Options and thus don’t suffer the performance hit. We also wanted to provide you lot of power even when you are not debugging and ensure that you don’t need to transition to debug mode unless you have to debug. Now with Beta 2 we have added some powerful features to make that possible.&lt;/P&gt;
&lt;H3&gt;Improvements in Script Viewer&lt;/H3&gt;
&lt;P&gt;The script viewer in Beta 1 showed all the sources when you are debugging but it only showed source for main page when not debugging. Now with Beta 2 you will be able to &lt;B&gt;browse all the&lt;/B&gt; &lt;B&gt;sources even when you are not debugging&lt;/B&gt;. You can also set breakpoints even before starting debugging. The breakpoints will persist till you close IE window. To make code easier to read, we have updated the source viewer to show &lt;B&gt;sources in syntax color&lt;/B&gt;. This is similar to what you might expect in code editors such as Visual Studio. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_22.png" mce_href="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_22.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=355 alt="Source viewer with syntax colored code" src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_thumb_9.png" width=625 border=0 mce_src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_thumb_9.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;We have also &lt;B&gt;updated the script explorer&lt;/B&gt; dropdown to make it easy to browse and select files. Now the script explorer will show the domain to which the script file belongs to. We have also separated the eval code, other dynamic scripts and scripts executed from Console into ‘Others’ submenu of the script explorer. With this change it will be easy for you to find the script file you are looking for.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_20.png" mce_href="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_20.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=373 alt="Source explorer dropdown" src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_thumb_8.png" width=625 border=0 mce_src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_thumb_8.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Updated Script Console&lt;/H3&gt;
&lt;P&gt;Console panel in the script tab makes it easy for you to try out new scripts. You can execute the scripts in the console irrespective of whether you are debugging or not. In Beta 2 we have improved the look and feel of the Console so that it is easy to read the output. &lt;/P&gt;
&lt;P&gt;To make it easy for you to fix errors on your page, &lt;B&gt;Console also logs all the script errors&lt;/B&gt;. These errors will be logged in the Console once Developer Tools has been opened for the tab. You can also navigate to the error location in script by clicking on the error hyperlink in the Console.&lt;/P&gt;
&lt;P&gt;To help you log message to Console from your script source we have added support for ‘console’ object. Developer Tools provides multiple level of logging with &lt;B&gt;console.log()&lt;/B&gt;, &lt;B&gt;console.info()&lt;/B&gt;, &lt;B&gt;console.warn()&lt;/B&gt;, &lt;B&gt;console.error()&lt;/B&gt; and &lt;B&gt;console.assert(). &lt;/B&gt;Instead of using &lt;B&gt;window.alert&lt;/B&gt; for debugging, you can use these console commands to log messages to the Console. You can call these console commands with a list of arguments that will be concatenated to generate the output string. The input parameters can also be formatted by using substitution patterns in the style of printf(). &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_18.png" mce_href="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_18.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=426 alt="Console with runtime error and console.log output" src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_thumb_7.png" width=489 border=0 mce_src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_thumb_7.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;You can also control what messages you want to see in the Console pane by using the context menu. Context menu also provide you option to clear the console of all messages. If you only want to clear console.log messages, you can use &lt;B&gt;console.clear()&lt;/B&gt;.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_16.png" mce_href="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_16.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=425 alt="Context menu for Console" src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_thumb_6.png" width=632 border=0 mce_src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_thumb_6.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The console.log is extensible and you can add your own console commands through custom scripts. For example you can add console.debug() command which takes string arguments by using following script – &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes?="yes?" mso-no-proof:="mso-no-proof:" new?;="new?;" courier="courier"&gt;&lt;FONT face="Courier New"&gt;console.debug = &lt;SPAN style="COLOR: blue"&gt;function&lt;/SPAN&gt;(){ &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes?="yes?" mso-no-proof:="mso-no-proof:" new?;="new?;" courier="courier"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;var&lt;/SPAN&gt; args = &lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt;; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes?="yes?" mso-no-proof:="mso-no-proof:" new?;="new?;" courier="courier"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes?="yes?" mso-no-proof:="mso-no-proof:" new?;="new?;" courier="courier"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;for&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;var&lt;/SPAN&gt; x=0; x&amp;lt;arguments.length; x++) &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes?="yes?" mso-no-proof:="mso-no-proof:" new?;="new?;" courier="courier"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes?="yes?" mso-no-proof:="mso-no-proof:" new?;="new?;" courier="courier"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;{ &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes?="yes?" mso-no-proof:="mso-no-proof:" new?;="new?;" courier="courier"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes?="yes?" mso-no-proof:="mso-no-proof:" new?;="new?;" courier="courier"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;args += arguments[x]; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes?="yes?" mso-no-proof:="mso-no-proof:" new?;="new?;" courier="courier"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes?="yes?" mso-no-proof:="mso-no-proof:" new?;="new?;" courier="courier"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;} &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes?="yes?" mso-no-proof:="mso-no-proof:" new?;="new?;" courier="courier"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes?="yes?" mso-no-proof:="mso-no-proof:" new?;="new?;" courier="courier"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;console.log(&lt;SPAN style="COLOR: #a31515"&gt;"DEBUG: "&lt;/SPAN&gt; + args); &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes?="yes?" mso-no-proof:="mso-no-proof:" new?;="new?;" courier="courier"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;This can be easily enhanced to take formatted strings.&lt;/P&gt;
&lt;H3&gt;More execution control features&lt;/H3&gt;
&lt;P&gt;The Developer Tools in Beta 1 offered execution control features like Break All, Step In, Step Out, Step Over. In Beta 2 we have added support for &lt;B&gt;Conditional Breakpoints&lt;/B&gt; and &lt;B&gt;Break on Error&lt;/B&gt;. In conditional breakpoint you can give any valid JScript expression to be evaluated and debugger will only halt if the expression evaluates to true. Break on Error provides a toggle switch to control whether debugger will break on JScript runtime error or continue while ignoring the error. Regardless of the toggle state the error will be logged to the console so that you can investigate them at your convenience.&lt;/P&gt;
&lt;P&gt;We have also extended the just-in-time debugging experience of Internet Explorer. Although with IE8 you don’t need to keep debugging enabled from Internet Options, still if you have debugging enabled in the IE and you hit a script error, you now get an option to use Developer Tools debugger. You can still use Visual Studio and other stand alone debuggers by unselecting the check-box in the message and clicking on Yes.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_14.png" mce_href="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_14.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=225 alt="Just in time debugging dialog" src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_thumb.png" width=401 border=0 mce_src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/JScriptDebuggerinInternetExplorer8Beta2_D7A4/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;H3&gt;Improved Usability&lt;/H3&gt;
&lt;P&gt;In Beta 2 we have added &lt;B&gt;extensive keyboard shortcuts&lt;/B&gt;. If you have been using Visual Studio for debugging script in IE, you already know the keyboard shortcuts! We have kept the keyboard shortcuts as close to Visual Studio as possible. List of&lt;B&gt; &lt;/B&gt;all the keyboard shortcuts supported by JScript Debugger is available &lt;A href="http://msdn.microsoft.com/en-us/library/cc848896(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc848896(VS.85).aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;We have added search functionality to Developer Tools. Searching in Script tab will show you the search term highlighted in the source viewer. When you browse to a new site or select another file from the source explorer dropdown the search term will continue to be highlighted. &lt;/P&gt;
&lt;P&gt;We have also made other improvements like increased tool tips to improve the usability and looks of the debugger.&lt;/P&gt;
&lt;H3&gt;More Information&lt;/H3&gt;
&lt;P&gt;For more information on the Developer Tools and JScript Debugger check out these articles:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc848892(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc848892(VS.85).aspx"&gt;Developer Tools: Script Debugging Overview&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc848896(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc848896(VS.85).aspx"&gt;Developer Tools: Keyboard Shortcuts&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/jscript/archive/2008/03/13/jscript-debugger-in-internet-explorer-8.aspx" mce_href="http://blogs.msdn.com/jscript/archive/2008/03/13/jscript-debugger-in-internet-explorer-8.aspx"&gt;JScript Debugger in Internet Explorer 8 Beta 1&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2008/09/03/developer-tools-in-internet-explorer-8-beta-2.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/09/03/developer-tools-in-internet-explorer-8-beta-2.aspx"&gt;Developer Tools in Internet Explorer 8 Beta 2&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc848894(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc848894(VS.85).aspx"&gt;Discovering the Internet Explorer 8 Developer Tools&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc848893(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc848893(VS.85).aspx"&gt;Internet Explorer 8 Developer Tools GUI Reference&lt;/A&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;We look forward to your feedback about the debugger so please leave us a comment in this post. Thanks, and enjoy IE8 Beta 2! &lt;/P&gt;
&lt;P&gt;Deepak Jain&lt;/P&gt;
&lt;P&gt;Program Manager&lt;/P&gt;
&lt;P&gt;JScript Team&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8955251" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/IE/default.aspx">IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Developers/default.aspx">Developers</category></item><item><title>Allen Wirfs-Brock and Pratap Lakshman on "Harmony", ECMAScript 3.1, IE 8, and more</title><link>http://blogs.msdn.com/jscript/archive/2008/09/11/allen-wirfs-brock-and-pratap-lakshman-on-harmony-ecmascript-3-1-ie-8-and-more.aspx</link><pubDate>Thu, 11 Sep 2008 05:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8943272</guid><dc:creator>don.raman</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jscript/comments/8943272.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=8943272</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=8943272</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT face=Calibri&gt;The 4&lt;SUP&gt;th&lt;/SUP&gt; episode of the Open Web Podcast featured Allen, Pratap , Dion, and John discussing the Open Web, ECMAScript, IE 8 and more. A &lt;/FONT&gt;&lt;A class="" href="http://openwebpodcast.com/episode-4-allen-wirfs-brock-and-pratap-lakshman-from-microsoft-on-ecmascript-ie-8-and-more" mce_href="http://openwebpodcast.com/episode-4-allen-wirfs-brock-and-pratap-lakshman-from-microsoft-on-ecmascript-ie-8-and-more"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Calibri&gt;recording of the discussion&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;FONT face=Calibri&gt; has been published. Enjoy!&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8943272" width="1" height="1"&gt;</description></item><item><title>ECMAScript 3 and beyond - the road to "Harmony"</title><link>http://blogs.msdn.com/jscript/archive/2008/08/20/ecmascript-3-and-beyond-the-road-to-harmony.aspx</link><pubDate>Wed, 20 Aug 2008 17:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8881713</guid><dc:creator>don.raman</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/jscript/comments/8881713.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=8881713</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=8881713</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT face=Calibri&gt;The current ECMAScript specification was completed in 1999 and certainly needed to be updated to reflect today’s web environment and practices. Some participants in the standards process wanted to use what they thought of as a once-in-a-decade opportunity to make some significant changes that they felt would make the language better. Other participants, including Microsoft, were concerned about the ability of the web to “digest” such large changes and favoured a smaller set of revisions. There were passionate and well thought opinions on both sides of these issues and everybody seemed truly motivated by what they thought would be “best for the web”.&amp;nbsp; However, the net effect of the disagreement was to block any real chance of actually achieving an approved revision to the ECMAScript specification any time soon.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT face=Calibri&gt;Most of these points of disagreement have now been resolved. Rather than re-telling this story, we’d like to point&amp;nbsp; to ECMA's&lt;SPAN style="COLOR: #00b050"&gt; &lt;A class="" href="http://www.ecma-international.org/news/PressReleases/PR_Ecma%20Technical%20Committee%2039%20coalesces%20on%20future%20direction%20of%20Web%20Programming%20Language.htm" target=_blank mce_href="http://www.ecma-international.org/news/PressReleases/PR_Ecma Technical Committee 39 coalesces on future direction of Web Programming Language.htm"&gt;&lt;SPAN style="COLOR: blue"&gt;press release&lt;/SPAN&gt;&lt;/A&gt; &lt;/SPAN&gt;and the accompanying &lt;SPAN style="COLOR: #00b050"&gt;&lt;A class="" href="http://www.ecma-international.org/news/PressReleases/White%20Paper%20on%20TC39%20PR%2019%20August%202008.pdf" target=_blank mce_href="http://www.ecma-international.org/news/PressReleases/White Paper on TC39 PR 19 August 2008.pdf"&gt;&lt;SPAN style="COLOR: blue"&gt;white paper&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt; that&amp;nbsp; lay out the agreements that have been reached in the ECMAScript technical committee. We think that these agreements set the stage for real progress in advancing standards-based web scripting and Microsoft is committed to being an active participant in making these advances. We want to thank and congratulate our colleagues at Adobe, Apple, Google, IBM, Mozilla, Opera, Yahoo!, and&amp;nbsp; other organizations for working hard to get past these differences in order to find a common path forward for ECMAScript.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT face=Calibri&gt;Pratap Lakshman&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT face=Calibri&gt;Allen Wirfs-Brock&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8881713" width="1" height="1"&gt;</description></item><item><title>GC Improvements in JScript for Internet Explorer 8 Beta 1</title><link>http://blogs.msdn.com/jscript/archive/2008/04/23/gc-improvements-in-jscript-for-internet-explorer-8-beta-1.aspx</link><pubDate>Wed, 23 Apr 2008 12:56:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8418992</guid><dc:creator>JSBlog</dc:creator><slash:comments>19</slash:comments><comments>http://blogs.msdn.com/jscript/comments/8418992.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=8418992</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=8418992</wfw:comment><description>&lt;p&gt;Hello Friends,&lt;/p&gt;  &lt;p&gt;Today I am going to talk about some of the Garbage Collector improvement we have done. Actually the original fix was done in Script 5.7 (shipped with IE7/Vista and &lt;a href="http://blogs.msdn.com/jscript/archive/2007/08/12/windows-script-5-7-released-for-windows-2000-windows-xp-and-windows-2003-server.aspx"&gt;also available on down level platforms&lt;/a&gt;), which we further enhanced in JScript shipped with IE8 Beta1.&lt;/p&gt;  &lt;p&gt;So if you have gone through the &lt;a href="http://blogs.msdn.com/ericlippert/archive/2003/09/17/53038.aspx"&gt;Eric&amp;#8217;s post on JScript Garbage Collector&lt;/a&gt;, you must have noticed following lines&amp;#8230;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;&amp;#8220;&lt;/i&gt;&lt;i&gt;Actually what we do is keep track of the number of strings, objects and array slots allocated.&amp;#160; We check the current tallies at the beginning of each statement, and when the numbers exceed certain thresholds we trigger a collection. &amp;#8220;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;&amp;#8230;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;&amp;#8220;However, there are some down sides as well.&amp;#160; Performance is potentially not good on large-working-set applications&amp;#8221;.&lt;b&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;The three thresholds he talked about were fixed in previous versions of JScript. After each GC cycle, counters were reset to zero. Next time when they hit the thresholds, again GC was triggered and so on.&lt;/p&gt;  &lt;p&gt;This was alright for small scripts as they never create lot of strings and objects and don&amp;#8217;t take much time to execute. But in modern AJAX applications, lots of objects /strings/array entries are created and they live for long enough time. Since rate of object/string/array entry creation is too high in these applications, thresholds are hit quite often, GC is triggered but not able to collect anything because things are still alive and there is no garbage. Counters are reset, but within few statements they again hit the thresholds. GC is triggered again but very less is collected and so on.&lt;/p&gt;  &lt;p&gt;So as you see, GC is not able to collect significantly, however it is triggered at fixed intervals (as thresholds are fixed). Each GC cycle proves to be costlier than previous one as more objects have been created since last GC cycle happened.&lt;/p&gt;  &lt;p&gt;So to fix this problem, we made the three thresholds adaptive. After each GC cycle, we check if GC was profitable or not, meaning significant collection happened or not. If it was not, then we double the thresholds. If it was, then the thresholds are not changed. Obviously there is an upper bound on value of thresholds, beyond which they are not doubled even if GC cycle was not profitable. Also if GC cycle collected everything, thresholds are set to their initial values. &lt;/p&gt;  &lt;p&gt;That&amp;#8217;s it for now. Hope you enjoyed reading it.&lt;/p&gt;  &lt;p&gt;-JP&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8418992" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JScript+Performance+IE/default.aspx">JScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Garbage+Collection/default.aspx">Garbage Collection</category></item><item><title>Performance Optimization of Arrays - Part II</title><link>http://blogs.msdn.com/jscript/archive/2008/04/08/performance-optimization-of-arrays-part-ii.aspx</link><pubDate>Wed, 09 Apr 2008 05:20:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8371165</guid><dc:creator>JSBlog</dc:creator><slash:comments>18</slash:comments><comments>http://blogs.msdn.com/jscript/comments/8371165.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=8371165</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=8371165</wfw:comment><description>&lt;p&gt;Hello Friends,&lt;/p&gt;  &lt;p&gt;Hope you have read &lt;a href="http://blogs.msdn.com/jscript/archive/2008/03/25/performance-optimization-of-arrays-part-i.aspx" target="_blank"&gt;part I of this topic&lt;/a&gt; which I posted few days ago. If not then I would suggest going through that first as this &lt;a href="http://blogs.msdn.com/jscript/archive/2008/03/25/performance-optimization-of-arrays-part-i.aspx" target="_blank"&gt;post&lt;/a&gt; is just a continuation of that one.&lt;/p&gt;  &lt;p&gt;So coming to the point, here is the second reason -&lt;/p&gt;  &lt;p&gt;&lt;b&gt;2. &amp;#8220;JavaScript arrays are sparse arrays&amp;#8221;&lt;/b&gt;&amp;#8211; JavaScript allows arrays to be sparse therefore, when you write arrayObj = new Array(100); unlike C runtime, JScript doesn&amp;#8217;t allocate any slot/memory for those 100 entries up front. It allocates slot for an index only when an index is to be populated with a value, for example&amp;#8230;&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;arrayObj = &lt;span class="kwrd"&gt;new&lt;/span&gt; Array(100);&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;arrayObj[10] = 10;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;In this example, the array size is 100, but in the actual physical memory there is only one slot allocated for this array. Remaining 99 slots don&amp;#8217;t exist at all. &lt;/p&gt;

&lt;p&gt;Wondering how this factor contributes to the bad performance? Not allocating memory for all the slots up front is good design. Isn&amp;#8217;t it? &lt;/p&gt;

&lt;p&gt;Well, JScript always assumed that all arrays are sparse. So even if you had a fully dense array in your code, JScript runtime would treat it like a sparse array only. So if you are going to do a pop() operation on a dense JScript array, JScript just won&amp;#8217;t go and delete the last indexed entry and update the length attribute. It does something which is extremely performant for sparse arrays, but equally under-performant for dense arrays. Let&amp;#8216;s see what it is all about.&lt;/p&gt;

&lt;p&gt;Internally, for each Array object, JScript runtime maintains a table (different from HashTable, let&amp;#8217;s call it TrackerTable) which is nothing but a list of pointers to actual entries in the hash table. So if you just create an Array Object of size 100, and add 10 entries (indexed or named), the TrackerTable will have 10 pointers pointing to actual entries in the hash table. Let&amp;#8217;s take one simple example&amp;#8230;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;arrayObj = &lt;span class="kwrd"&gt;new&lt;/span&gt; Array(100);&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;arrayObj[10] = 10;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;arrayObj.length = 90;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;In this example, I just create an Array of size 100, and populated index 10. Next I reduce length of array to 90. Since the length has been reduced, entries from 90 to 99 have to be deleted. The ideal thing to do would be to delete &amp;lt;key, value&amp;gt; pair from hash table for key = 90 to 99. That means 10 operations on Hash table. JScript is smart here and saves 9 out of 10 operations.&lt;/p&gt;

&lt;p&gt;What JScript actually does is that it goes to the TrackerTable, iterates through it, for every entry it checks if it falls between deletion range (90-99 in this case), if yes then delete it. In above example, TrackerTable had only one entry. So instead of 10 operations on hash table, JScript does only one iteration and performs better.&lt;/p&gt;

&lt;p&gt;However what if the array was a dense array and all the indexed entries from 0 to 100 were populated? Unfortunately in this case too, JScript would follow the same logic. Therefore it would do 100 iterations over TrackerTable and end up doing 90 more operations. &lt;/p&gt;

&lt;p&gt;&lt;b&gt;How it was fixed&amp;#8211; &lt;/b&gt;As I said in the &lt;a href="http://blogs.msdn.com/jscript/archive/2008/03/25/performance-optimization-of-arrays-part-i.aspx" target="_blank"&gt;last post&lt;/a&gt;, in IE8 JScript we have the mechanism in place to decide whether an array is a sparse or dense. So we have changed the implementation to take sparse path only when the array is actually sparse. That means for operations on dense arrays, we don&amp;#8217;t use TrackerTable anymore. We directly go to the right storage and get the things done in fast manner.&lt;/p&gt;

&lt;p&gt;So this is all I had to tell about array improvements. Hope you got an idea of what was/is happening under the hood? If not, do leave a note and I would try to address that. And yes, I have lot many interesting things to share with you all, so keep checking this blog.&lt;/p&gt;

&lt;p&gt;-JP&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8371165" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/JavaScript+Performance+IE/default.aspx">JavaScript Performance IE</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/IE/default.aspx">IE</category></item><item><title>Reading XML File With JScript</title><link>http://blogs.msdn.com/jscript/archive/2008/04/01/reading-xml-file-with-jscript.aspx</link><pubDate>Wed, 02 Apr 2008 05:39:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8349942</guid><dc:creator>JSBlog</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/jscript/comments/8349942.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=8349942</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=8349942</wfw:comment><description>&lt;p&gt;I am Titus working as a SDET in JScript team. Sometime back I came across a situation where the requirement was to pass a XML file and get a Tree Listing back. The Tree Listing should have all nodes in the file along with proper parent/child relationship as well as a good way to differentiate between nodes with/without values. Let&amp;#8217;s call nodes with value as properties. I achieved this by using JScript. In this blog you will learn how to read/parse XML file using &lt;a href="http://msdn2.microsoft.com/en-us/library/aa468547.aspx"&gt;Microsoft&amp;#8217;s XML DOM&lt;/a&gt; and use this to create the Tree Listing.&amp;#160; &lt;/p&gt;  &lt;p&gt;Let&amp;#8217;s take a sample XML file, say test.xml (can be a URL or a file on your system) to get a clear picture of the kind of Tree Listing required and later we will look at the actual code. &lt;/p&gt;  &lt;p&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" border="0" alt="" src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/ReadingXMLFileWithJScript_9CBC/clip_image001_3.png" width="220" height="204" /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The XML file can be looked as &lt;/p&gt;  &lt;p&gt;Root Node, name is BookList, has 2 child nodes &lt;/p&gt;  &lt;p&gt;childnode0, name is Book and has two properties, &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Prop0: Author has a value Paul &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;Prop1: Price has a value 10.3&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;childnode1, name is Book and has three properties &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Prop0: Author has a value Joe &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;Prop1: Price has a value 20.95 &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;Prop2: Title has a value Web 2.0&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The Required Tree Listing after parsing test.xml is &lt;/p&gt;  &lt;p&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" border="0" alt="" src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/ReadingXMLFileWithJScript_9CBC/clip_image001_3.jpg" width="419" height="235" /&gt;&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="229"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="65"&gt;         &lt;p&gt;nName &lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="162"&gt;         &lt;p align="justify"&gt;NodeName&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="68"&gt;         &lt;p&gt;nValue &lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="159"&gt;         &lt;p align="justify"&gt;NodeValue&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="71"&gt;         &lt;p&gt;cNodes &lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="157"&gt;         &lt;p align="justify"&gt;List of Child Nodes&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="73"&gt;         &lt;p&gt;cProps &lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="156"&gt;         &lt;p align="justify"&gt;List of Child Properties&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The ReadXMLFile function in the code listing below returns the Tree Listing as required. &lt;/p&gt;  &lt;p&gt;Many a times you know the XML file contents and are interested in the list of only a specific node. Making a call to ReadXMLFile with second argument as the node name gives just such a list. &lt;/p&gt;  &lt;p&gt;Referring test.xml, a call to ReadXMLFile(&amp;#8220;test.xml&amp;#8221;, &amp;#8220;Author&amp;#8221;) gives a list like &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/ReadingXMLFileWithJScript_9CBC/clip_image003_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" border="0" alt="" src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/ReadingXMLFileWithJScript_9CBC/clip_image003_thumb.jpg" width="252" height="109" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Whereas a call to ReadXMLFile(&amp;#8220;test.xml&amp;#8221;, &amp;#8220;Book&amp;#8221;), returns the list like the below one&lt;a href="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/ReadingXMLFileWithJScript_9CBC/clip_image004_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" border="0" alt="" src="http://blogs.msdn.com/blogfiles/jscript/WindowsLiveWriter/ReadingXMLFileWithJScript_9CBC/clip_image004_thumb.jpg" width="467" height="231" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you have carefully noticed the Tree listing, cNodes as well as cProps is an Array. so by using the proper index value, one can reach the desired node. &lt;/p&gt;  &lt;p&gt;Here goes the actual code:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; NODE_ELEMENT = 1;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; NODE_ATTRIBUTE = 2;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; NODE_TEXT = 3;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;/**** INTERNALLY USED FUNCTIONS ****/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;/*&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="rem"&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;* Builds up xmlNode list on parentXMLNode&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="rem"&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;* by iterating over each node in childNodesLst&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="rem"&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;*/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; getXMLNodeList_1(childNodesLst,&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;parentXMLNode)&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;{&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; i;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; curNode;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; arrLen&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="rem"&gt;//traverse nodelist to get nodevalues and all child nodes&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; childNodesLst.length; i++) {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="rem"&gt;//we will ignore all other node types like&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="rem"&gt;//NODE_ATTRIBUTE, NODE_CDATA_SECTION, &amp;#8230;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (childNodesLst[i].nodeType == NODE_ELEMENT&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        || childNodesLst[i].nodeType == NODE_TEXT) {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (childNodesLst[i].nodeType == NODE_TEXT) {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                &lt;span class="rem"&gt;//we got the value of the parent node, populate&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                &lt;span class="rem"&gt;//parent node and return back&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                parentXMLNode.nValue = childNodesLst[i].nodeValue;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;            }&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;            &lt;span class="rem"&gt;//we have a new NODE_ELEMENT node&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;            curNode = &lt;span class="kwrd"&gt;new&lt;/span&gt; XMLNode(childNodesLst[i].nodeName, childNodesLst[i].nodeValue);&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (childNodesLst[i].hasChildNodes) {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                getXMLNodeList_1(childNodesLst[i].childNodes, curNode);&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                &lt;span class="kwrd"&gt;if&lt;/span&gt; (curNode.nValue != &lt;span class="kwrd"&gt;null&lt;/span&gt;) {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    &lt;span class="rem"&gt;//we need to add this as a property to the parent node&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    &lt;span class="kwrd"&gt;if&lt;/span&gt; (parentXMLNode.cProps == &lt;span class="kwrd"&gt;null&lt;/span&gt;) {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                        parentXMLNode.cProps = &lt;span class="kwrd"&gt;new&lt;/span&gt; Array();&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                        parentXMLNode.hasCProps = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    }&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    arrLen = parentXMLNode.cProps.length;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    parentXMLNode.cProps[arrLen] = curNode;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                } &lt;span class="kwrd"&gt;else&lt;/span&gt; {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    &lt;span class="rem"&gt;//we need to add this as child node to the parent node&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    &lt;span class="kwrd"&gt;if&lt;/span&gt; (parentXMLNode.cNodes == &lt;span class="kwrd"&gt;null&lt;/span&gt;) {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                        parentXMLNode.cNodes = &lt;span class="kwrd"&gt;new&lt;/span&gt; Array();&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                        parentXMLNode.hasCNodes = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    }&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    arrLen = parentXMLNode.cNodes.length;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    parentXMLNode.cNodes[arrLen] = curNode;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                }&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;            } &lt;span class="kwrd"&gt;else&lt;/span&gt; {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                &lt;span class="rem"&gt;//no use of such a node&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                &lt;span class="rem"&gt;//mark currNode as null for GC collection&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                curNode = &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;            }&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;/*&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="rem"&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;* Generates appropriate XMLNodeList from nodes&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="rem"&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;* in childNodes&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="rem"&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;*/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; getXMLNodeList(childNodes)&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;{&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; xmlNode = &lt;span class="kwrd"&gt;new&lt;/span&gt; XMLNode(&lt;span class="kwrd"&gt;null&lt;/span&gt;, &lt;span class="kwrd"&gt;null&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    getXMLNodeList_1(childNodes, xmlNode);&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; xmlNodeList = &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (xmlNode.hasCNodes) {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        xmlNodeList = xmlNode.cNodes;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    } &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (xmlNode.hasCProps) {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        xmlNodeList = xmlNode.cProps;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; xmlNodeList;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;/**** INTERNALLY USED FUNCTIONS ****/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;/* XMLNde DataStruct */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;functionXMLNode(ndName, ndVal)&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;{&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;this&lt;/span&gt;.nName = ndName; &lt;span class="rem"&gt;//XMLNode name&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;this&lt;/span&gt;.nValue = ndVal; &lt;span class="rem"&gt;//the value(if any) associated with XMLNode&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="rem"&gt;//As of now only property nodes have associated values&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;this&lt;/span&gt;.hasCNodes = &lt;span class="kwrd"&gt;false&lt;/span&gt;; &lt;span class="rem"&gt;//Bool to mark presense of Child Nodes&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;this&lt;/span&gt;.cNodes = &lt;span class="kwrd"&gt;null&lt;/span&gt;; &lt;span class="rem"&gt;//List of child nodes (of type XMLNode)&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;this&lt;/span&gt;.hasCProps = &lt;span class="kwrd"&gt;false&lt;/span&gt;; &lt;span class="rem"&gt;//Bool to mark presense of Property Nodes&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;this&lt;/span&gt;.cProps = &lt;span class="kwrd"&gt;null&lt;/span&gt;; &lt;span class="rem"&gt;//List of property nodes (of type XMLNode)&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;/* Exposed Functions */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; ReadXMLFile(fileName, tagName)&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;{&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (arguments.length &amp;lt; 1 || arguments.length &amp;gt; 2)&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; xmlDoc = &lt;span class="kwrd"&gt;new&lt;/span&gt; ActiveXObject(&lt;span class="str"&gt;&amp;quot;Microsoft.XMLDOM&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="rem"&gt;//load the file sync'ly&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    xmlDoc.async = &lt;span class="kwrd"&gt;false&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;try&lt;/span&gt; {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        xmlDoc.load(fileName);&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    } &lt;span class="kwrd"&gt;catch&lt;/span&gt;(e) {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="rem"&gt;//failed to load xml file&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="rem"&gt;//lets get the child nodes&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; childNodes = &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (arguments.length == 2) {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;try&lt;/span&gt; {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;            childNodes = xmlDoc.getElementsByTagName(tagName);&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        } &lt;span class="kwrd"&gt;catch&lt;/span&gt;(e) {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    } &lt;span class="kwrd"&gt;else&lt;/span&gt; {&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        childNodes = xmlDoc.childNodes;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; (getXMLNodeList(childNodes));&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; xmlNodes;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;xmlNodes = ReadXMLFile(&lt;span class="str"&gt;&amp;quot;http://www.noweb.com/test.xml&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;//For a file on you system&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;//xmlNodes = ReadXMLFile (&amp;quot;C:\\My Documents\\test.xml&amp;quot;);&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;//root node name is&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; RootNodeName = xmlNodes[0].nName;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;xmlNodes = ReadXMLFile(&lt;span class="str"&gt;&amp;quot;http://www.noweb.com/test.xml&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Book&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; cntBooks = xmlNodes.length;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;xmlNodes = ReadXMLFile(&lt;span class="str"&gt;&amp;quot;http://www.noweb.com/test.xml&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Author&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; authorName = xmlNodes[0].nValue;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Hope you enjoyed the blog!&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Titus&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8349942" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jscript/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/Jscript/default.aspx">Jscript</category><category domain="http://blogs.msdn.com/jscript/archive/tags/XML/default.aspx">XML</category></item><item><title>Performance Optimization of Arrays - Part I</title><link>http://blogs.msdn.com/jscript/archive/2008/03/25/performance-optimization-of-arrays-part-i.aspx</link><pubDate>Wed, 26 Mar 2008 05:18:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8337223</guid><dc:creator>JSBlog</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/jscript/comments/8337223.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jscript/commentrss.aspx?PostID=8337223</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jscript/rsscomments.aspx?PostID=8337223</wfw:comment><description>&lt;p&gt;Hello Friends,&lt;/p&gt;  &lt;p&gt;Have you observed better performance of Array operations in IE8 than IE7? If not, try the following code in both IE7 &amp;amp; IE8 and I can bet you would not leave this page without reading till the last word.&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; arrObj = &lt;span class="kwrd"&gt;new&lt;/span&gt; Array();
&lt;span class="kwrd"&gt;var&lt;/span&gt; count = 10000;
&lt;span class="kwrd"&gt;var&lt;/span&gt; before, after;
&lt;span class="kwrd"&gt;for&lt;/span&gt;(&lt;span class="kwrd"&gt;var&lt;/span&gt; i = 0; i &amp;lt; count; i ++)&lt;/pre&gt;

  &lt;pre class="csharpcode"&gt;{
   arrObj.push(i);&lt;/pre&gt;

  &lt;pre class="csharpcode"&gt;}
before = &lt;span class="kwrd"&gt;new&lt;/span&gt; Date();
&lt;span class="kwrd"&gt;for&lt;/span&gt;(&lt;span class="kwrd"&gt;var&lt;/span&gt; i = 0; i &amp;lt; count; i ++)&lt;/pre&gt;

  &lt;pre class="csharpcode"&gt;{
    arrObj.pop();&lt;/pre&gt;

  &lt;pre class="csharpcode"&gt;}
after = &lt;span class="kwrd"&gt;new&lt;/span&gt; Date();
alert(after- before);&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;On my machine, IE7 took &lt;b&gt;7640&lt;/b&gt; ms while IE8 took just &lt;b&gt;18&lt;/b&gt; ms. As you see the above example is doing nothing but populating an array with 10000 entries and then popping them one by one, and just the pop operation is taking so much time in IE7. &lt;/p&gt;

&lt;p&gt;This was just one example. Pick any array operation, and you would notice a huge difference between IE7 and IE8 performance. &lt;/p&gt;

&lt;p&gt;So, won&amp;#8217;t it be interesting to know why array operations in IE7 were taking so much time? Won&amp;#8217;t you like to know how we dealt with all those issues? I am sure the answer is &amp;#8216;yes&amp;#8217; and in the next few paragraphs that is what I have tried to explain. So keep reading.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Why Array operations were slow?&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;There were two main reasons which made Array operations so less performant. I will be explaining one of them in this post and leave other one for the next post, otherwise it would be so long to read that I would surely lose the bet.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;1. &lt;/b&gt;&lt;b&gt;JScript didn&amp;#8217;t treat Arrays as Arrays&lt;/b&gt; &amp;#8211; What does this mean? Arrays, in general sense, are considered a contiguous memory storage which enables fast random access to indexes. In JScript world, Arrays can be sparse, that means an Array can be of length 1 million but it may not have storage committed for all those 1 million indexes. But in real world scenarios, Arrays are hardly used as sparse arrays. They are mostly dense &lt;/p&gt;

&lt;p&gt;Unfortunately JScript runtime was not handling arrays for real word usage. It always handled them as sparse arrays. Therefore it never committed any contiguous space for them, resulting into slower access to indexes.&lt;/p&gt;

&lt;p&gt;Instead it used to insert indexed entries into a property bag which is nothing but a classic hash table whose keys are strings. &lt;/p&gt;

&lt;p&gt;So if you are doing something like the following in your code&amp;#8230;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; arrObj = &lt;span class="kwrd"&gt;new&lt;/span&gt; Array();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; 100; i ++)&lt;/pre&gt;

  &lt;pre class="alt"&gt;arrObj[i] = i;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#8230; and expecting that JScript runtime internally would allocate a C-Style contiguous array, then sorry to say, it doesn&amp;#8217;t meet your expectation at all. Instead what it does internally is&amp;#8230;&lt;/p&gt;

&lt;p&gt;a) Allocates a generic object, which is nothing but the HashTable.&lt;/p&gt;

&lt;p&gt;b) Since the generic object (HashTable) has to be treated like an array object, associate a special attribute &amp;#8220;length&amp;#8221; with it and set its value to 0.&lt;/p&gt;

&lt;p&gt;c) In the for loop, for each value of i&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;a. Convert &amp;#8216;i&amp;#8217; to string (e.g. for i = 10, it would be &amp;#8220;10&amp;#8221;)&lt;/p&gt;

  &lt;p&gt;b. Add &amp;lt;key value&amp;gt; pair of &amp;lt;string equivalent of i, i&amp;gt; (e.g. &amp;lt;&amp;#8221;10&amp;#8221; , 10&amp;gt;) to the hash table.&lt;/p&gt;

  &lt;p&gt;c. Set the &amp;#8220;length&amp;#8220;attribute&amp;#8217;s value properly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So every time you access an indexed entry of an array, it first converts the index to string, computes hash value for the string and then looks up the hash table. &lt;/p&gt;

&lt;p&gt;&lt;b&gt;How we fixed it &lt;/b&gt;&lt;/p&gt;

&lt;p&gt;No rewards if you already guessed it. &lt;/p&gt;

&lt;p&gt;Now JScript runtime treats an Array Object as an special object, different from other JScript objects. Basically it maintains two storage areas for arrays. One is the old HashTable, which is used for storing named entries. The other one is special one which is used exclusively for indexed entries and resembles a C-Style Array.&lt;/p&gt;

&lt;p&gt;So if you have some code like following&amp;#8230;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;arrObj = &lt;span class="kwrd"&gt;new&lt;/span&gt; Array(20);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;for&lt;/span&gt;(&lt;span class="kwrd"&gt;var&lt;/span&gt; i = 0; i &amp;lt; 20; i ++ )&lt;/pre&gt;

  &lt;pre class="alt"&gt;    arrObj[i] = i;&lt;/pre&gt;

  &lt;pre&gt;    arrObj.Name = &amp;#8220;IE8 Array&amp;#8221;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#8230; then for loop is adding entries to a different storage and &amp;#8220;Name&amp;#8221; is added to the different storage.&lt;/p&gt;

&lt;p&gt;Ok. So looks like all indexed entries always go to new storage. No. That is not the case. There is a condition which should be met before we put an indexed entry to the new storage. The condition is that new entry must not make the array sparse and to decide that whether a particular indexed entry would make the array sparse or not, we have certain heuristics, for example&amp;#8230;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;arrObj = &lt;span class="kwrd"&gt;new&lt;/span&gt; Array();&lt;/pre&gt;

  &lt;pre&gt;arrObj[10] = 20;&lt;/pre&gt;

  &lt;pre class="alt"&gt;arrObj[50000] = 500000;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;In above snippet, indexed entry 10 satisfies our heuristics and is added to new storage. But the indexed entry 50000 will not meet them and will be added to old HashTable as a normal named entry.&lt;/p&gt;

&lt;p&gt;Cool. looks fine if you always populate the array such that it meets the heuristics, e.g. in an incrementing for loop starting from 0. But what if you want to populate it in a decrementing for loop starting from max length&amp;#8230;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;arrObj = &lt;span class="kwrd"&gt;new&lt;/span&gt; Array();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;for&lt;/span&gt;(&lt;span class="kwrd"&gt;var&lt;/span&gt; i = 2000; i &amp;gt;=0 ; i -- )&lt;/pre&gt;

  &lt;pre class="alt"&gt;  arrObj[i] = i;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;or you want to populate the array from both ends &amp;#8230;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;arrObj = &lt;span class="kwrd"&gt;new&lt;/span&gt; Array();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; length = 2000;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;for&lt;/span&gt;(&lt;span class="kwrd"&gt;var&lt;/span&gt; i = 0; i &amp;lt; length/2 ; i ++ )&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;  arrObj[i] = i;&lt;/pre&gt;

  &lt;pre&gt;  arrObj[length &amp;#8211; i - 1] = length &amp;#8211; i;&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;In such scenarios, not all of your indexed entries will go to new storage and performance of further operations on this array would not be as great as it can be.&lt;/p&gt;

&lt;p&gt;For such scenarios, to get working in most performant way, what you have to do is to pass the actual array size to constructor when you create the object. If you pass the size, JScript runtime assumes that you are sure that your array would be dense and don&amp;#8217;t want our heuristics to ensure that. We will not exercise those heuristics for any indexed entry added within that size range, in whatsoever order they are added. So if you write something like following&amp;#8230;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;arrObj = &lt;span class="kwrd"&gt;new&lt;/span&gt; Array(50000);&lt;/pre&gt;

  &lt;pre&gt;arrObj[10] = 20;&lt;/pre&gt;

  &lt;pre class="alt"&gt;arrObj[50000] = 500000;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#8230; both will go to the new storage even though the last indexed entry doesn&amp;#8217;t satisfy heuristics. But do remember that anything beyond 50000, will have to meet the heuristics, else it would go to HashTable.&lt;/p&gt;

&lt;p&gt;Time out. Hope you enjoyed reading it and would like to read second part as well. See you soon.&lt;/p&gt;

&lt;p&gt;-JP&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8337223" width="1" height="1"&gt;</description></item></channel></rss>