Microsoft KB Archive/321494

= BUG: JScript Err Object May Return Incorrect Results =

Article ID: 321494

Article Last Modified on 3/20/2004

-

APPLIES TO


 * Microsoft Windows Scripting Host 2.5

-



This article was previously published under Q321494



SYMPTOMS
When you use the Err object in Microsoft JScript, an incorrect result may return when the output from the Err object is used.



CAUSE
There is a bug in the constructor of the Jscript Err object that may cause the Err object to return an incorrect result. The problem occurs because memory is not initialized properly in the Jscript Err object.



RESOLUTION
Because of the nature of the bug, the only way to work around the problem is to make changes to the data that is submitted to the Err object.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
You can use the following code to reproduce the problem: //****************************************** var message = &quot;test1test1&quot;; message = message.replace(&quot;test1&quot;, &quot;test2&quot;); var e = new Error(0xFFFF, message); WScript.echo(e.number.toString(16)); //******************************************

You can use the following code to work around the problem:

//****************************************** var message = &quot;test1test1&quot;; message = message.replace(&quot;test1&quot;, &quot;test2&quot;); var e = new Error(0xFFFF, message.toString); WScript.echo(e.number.toString(16)); //******************************************

Keywords: kbbug kbpending kbdswmanage2003swept KB321494

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.