<?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>The JScript Type System, Part Two: Prototypes and constructors</title><link>http://blogs.msdn.com/b/ericlippert/archive/2003/11/06/53352.aspx</link><description>In today's installment, things get complicated.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Intercept instanceof | keyongtech</title><link>http://blogs.msdn.com/b/ericlippert/archive/2003/11/06/53352.aspx#9338455</link><pubDate>Sun, 18 Jan 2009 20:41:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9338455</guid><dc:creator>Intercept instanceof | keyongtech</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.keyongtech.com/4947719-intercept-instanceof"&gt;http://www.keyongtech.com/4947719-intercept-instanceof&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9338455" width="1" height="1"&gt;</description></item><item><title>Wherefore IDispatchEx?</title><link>http://blogs.msdn.com/b/ericlippert/archive/2003/11/06/53352.aspx#239293</link><pubDate>Thu, 07 Oct 2004 20:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:239293</guid><dc:creator>Fabulous Adventures In Coding</dc:creator><description>&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=239293" width="1" height="1"&gt;</description></item><item><title>re: The JScript Type System, Part Two: Prototypes and constructors</title><link>http://blogs.msdn.com/b/ericlippert/archive/2003/11/06/53352.aspx#124715</link><pubDate>Sun, 02 May 2004 15:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:124715</guid><dc:creator>Eric Lippert</dc:creator><description>A more likely reason is that Waldemar Horwat, who was the primary driving force behind the E4 spec, no longer works for AOL-Time-Warner-Netscape and hence is no longer being paid to drive the spec process forward.  (Rumour has it that he's at google now.)  &lt;br&gt;&lt;br&gt;Microsoft is still involved in the E4 process, but it is slow going.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=124715" width="1" height="1"&gt;</description></item><item><title>re: The JScript Type System, Part Two: Prototypes and constructors</title><link>http://blogs.msdn.com/b/ericlippert/archive/2003/11/06/53352.aspx#124705</link><pubDate>Sun, 02 May 2004 14:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:124705</guid><dc:creator>Erik Arvidsson</dc:creator><description>&amp;quot;That's news to me. Could you more precisely define &amp;quot;around the corner&amp;quot;?&amp;quot;&lt;br&gt;&lt;br&gt;I guess I was wrong :'( This has been in the works for way too long...&lt;br&gt;&lt;br&gt;Known implemantions of ECMAScript v4:&lt;br&gt;&lt;br&gt;ActionScript&lt;br&gt;QTScript&lt;br&gt;JScript 7&lt;br&gt;&lt;br&gt;One possible reason for JS2 taking so long might be that ECMA moved all their resources to C# instead?&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=124705" width="1" height="1"&gt;</description></item><item><title>RE: The JScript Type System, Part Two: Prototypes and constructors</title><link>http://blogs.msdn.com/b/ericlippert/archive/2003/11/06/53352.aspx#53366</link><pubDate>Sun, 09 Nov 2003 12:13:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:53366</guid><dc:creator>kurakuraninja</dc:creator><description>The link I posted was just something I found while searching on the error. My situation relates to using run time type info. Have you tested TypeName with run time type info? It is obsolete and I only use it for testing so this discussion is essentially accademic.

My guess is that something similar is happening, ITypeInfo must be returning bogus data. Assuming that you check all error results this could even be a bug in the implementation of ITypeInfo for CreateDispTypeInfo. As mentioned, this is obsolete and probably hasn't been looked at for a long time.

I think my object was based on the code found here, so if you want to copy and paste:
http://docs.rinet.ru:8083/VidimyyC/vcu28fi.htm#I25&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=53366" width="1" height="1"&gt;</description></item><item><title>RE: The JScript Type System, Part Two: Prototypes and constructors</title><link>http://blogs.msdn.com/b/ericlippert/archive/2003/11/06/53352.aspx#53365</link><pubDate>Sat, 08 Nov 2003 18:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:53365</guid><dc:creator>Eric Lippert</dc:creator><description>OK, then I have a guess as to what is happening.  This is a TERRIBLE way to wait for an out-of-proc object (OOPO) to shut down.  I'll bet that there is a race condition here where the stub is returning a pointer to memory that becomes bad when the OOPO shuts down.  So the TypeName method essentially gets passed a pointer to bad memory.

Now suppose that the bad memory happens to be in a readable committed page, but contains garbage.  We assume that the thing is a BSTR, so we look at the value stashed preceding the string body to determine the length.  That could be any old number; the odds that the number happens to be larger than the largest remaining heap block are actually very good.

So what we've got here is a memory corruption bug that is not crashing, but returning a bogus error instead.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=53365" width="1" height="1"&gt;</description></item><item><title>RE: The JScript Type System, Part Two: Prototypes and constructors</title><link>http://blogs.msdn.com/b/ericlippert/archive/2003/11/06/53352.aspx#53364</link><pubDate>Sat, 08 Nov 2003 14:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:53364</guid><dc:creator>kurakuraninja</dc:creator><description>[quote]Can I see a repro for that? If the type name is unavailable, it should return &amp;quot;Unknown&amp;quot; or, if it is an IDispatch, &amp;quot;Object&amp;quot;. [/quote]

I got this when trying it on a COM object that uses run-time generated type info (ie. CreateDispTypeInfo). This only provides a minimal implementation of ITypeInfo. This is not common(or recommended) so I wouldn't worry too much. If it helps the COM object is out of process.

Also see this:
http://groups.google.com/groups?q=typeName+%22Out+of+string+space%22&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=53364" width="1" height="1"&gt;</description></item><item><title>RE: The JScript Type System, Part Two: Prototypes and constructors</title><link>http://blogs.msdn.com/b/ericlippert/archive/2003/11/06/53352.aspx#53363</link><pubDate>Sat, 08 Nov 2003 01:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:53363</guid><dc:creator>Isaac</dc:creator><description>&amp;gt; conflated static typing with strong typing
&amp;quot;static typing&amp;quot; unhelpfully confuses when checks are made with the kind of checks that are made.

Simpler to understand that C++ is a statically-checked weakly-typed language (and also that some things are dynamically checked in C++).

Simpler to understand that JScript is a dynamically-checked untyped (safe?) language. 

I think you demonstrated that it's pretty hard to figure out what the type of a value is in JScript - so why insist on calling it a typed language?&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=53363" width="1" height="1"&gt;</description></item><item><title>RE: The JScript Type System, Part Two: Prototypes and constructors</title><link>http://blogs.msdn.com/b/ericlippert/archive/2003/11/06/53352.aspx#53362</link><pubDate>Sat, 08 Nov 2003 01:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:53362</guid><dc:creator>Eric Lippert</dc:creator><description>&amp;gt; Well, well... now that we have ECMAScript v4 around the corner there is no real need for this.

That's news to me.  Could you more precisely define &amp;quot;around the corner&amp;quot;? &lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=53362" width="1" height="1"&gt;</description></item><item><title>RE: The JScript Type System, Part Two: Prototypes and constructors</title><link>http://blogs.msdn.com/b/ericlippert/archive/2003/11/06/53352.aspx#53361</link><pubDate>Fri, 07 Nov 2003 23:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:53361</guid><dc:creator>Erik Arvidsson</dc:creator><description>Peter: I know both the Mozilla engines (C and Java) and the Macromedia engine has support for this. I was pretty sure that Opera supported this as well but I just verifed that they do not.

I can understand why it is considered dangerous but usage of __proto__ can be very useful. For example it allows you to skip creating an instance that is used as the prototype.

fucntion SubClass( args )
{
   SuperClass.call( args );
}
SubClass.prototype.__proto__ = SuperClass.prototype;

Well, well... now that we have ECMAScript v4 around the corner there is no real need for this.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=53361" width="1" height="1"&gt;</description></item></channel></rss>