<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Connecting C++ To Javascript Via Google&#8217;s V8</title>
	<atom:link href="http://blogs.bungeeconnect.com/2008/10/09/connecting-c-to-javascript-via-googles-v8/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.bungeeconnect.com/2008/10/09/connecting-c-to-javascript-via-googles-v8/</link>
	<description>Feed for the Bungee Connect Developers Around the World</description>
	<lastBuildDate>Mon, 07 Sep 2009 05:15:16 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: olsenc</title>
		<link>http://blogs.bungeeconnect.com/2008/10/09/connecting-c-to-javascript-via-googles-v8/#comment-976</link>
		<dc:creator>olsenc</dc:creator>
		<pubDate>Tue, 27 Jan 2009 16:43:44 +0000</pubDate>
		<guid isPermaLink="false">http://bungeeconnect.wordpress.com/?p=567#comment-976</guid>
		<description>Whenever I get a value back from js into my c++ code I always check it&#039;s type by casting it to the type I think it should be.  I would try something along the lines of:
  v8::Handle result = function-&gt;Call(object, 0, NULL);
  v8::Handle resultAsAFunction = v8::Handle::Cast(result);

now you can check to see if the variable is null or undefined:
  if (resultAsAFunction.IsEmpty() &#124;&#124; resultAsAFunction-&gt;IsUndefined())
  { ... }

Try that and see if that gives you any clues as to whether or not you actually have a function or not.  My first inclination was that what you actually have is an object not a function and the method GetName is not defined on a v8 Object.

Corey</description>
		<content:encoded><![CDATA[<p>Whenever I get a value back from js into my c++ code I always check it&#8217;s type by casting it to the type I think it should be.  I would try something along the lines of:<br />
  v8::Handle result = function-&gt;Call(object, 0, NULL);<br />
  v8::Handle resultAsAFunction = v8::Handle::Cast(result);</p>
<p>now you can check to see if the variable is null or undefined:<br />
  if (resultAsAFunction.IsEmpty() || resultAsAFunction-&gt;IsUndefined())<br />
  { &#8230; }</p>
<p>Try that and see if that gives you any clues as to whether or not you actually have a function or not.  My first inclination was that what you actually have is an object not a function and the method GetName is not defined on a v8 Object.</p>
<p>Corey</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Hagman</title>
		<link>http://blogs.bungeeconnect.com/2008/10/09/connecting-c-to-javascript-via-googles-v8/#comment-974</link>
		<dc:creator>Tom Hagman</dc:creator>
		<pubDate>Thu, 22 Jan 2009 22:58:24 +0000</pubDate>
		<guid isPermaLink="false">http://bungeeconnect.wordpress.com/?p=567#comment-974</guid>
		<description>Corey,

I&#039;ve been playing with the V8 engine for a few days.

I&#039;m builting a COM+ ATL server to expose the javascript engine functionality.  I&#039;m having some trouble getting the name of a object being returned by a function.

Here&#039;s JS sample:
function CRV(pName1, pValue1)
{
    this.Name = pName1;
    this.Value = pValue1;
}

function doit()
{
	var crv = new CRValue(&#039;Col1&#039;, &#039;Val1&#039;);
	return crv;
}

doit();

When doit() returns a CRV, I need to know that the type is &#039;CRV&#039;.

This compiles, but kills the engine on the GetName();
Local jsfunc = result-&gt;ToFunction();
Handle hFunctionName = jsfunc-&gt;GetName();

where result is return from script-&gt;Run();

Any suggestions would be appreciated.

Thanks,
Tom</description>
		<content:encoded><![CDATA[<p>Corey,</p>
<p>I&#8217;ve been playing with the V8 engine for a few days.</p>
<p>I&#8217;m builting a COM+ ATL server to expose the javascript engine functionality.  I&#8217;m having some trouble getting the name of a object being returned by a function.</p>
<p>Here&#8217;s JS sample:<br />
function CRV(pName1, pValue1)<br />
{<br />
    this.Name = pName1;<br />
    this.Value = pValue1;<br />
}</p>
<p>function doit()<br />
{<br />
	var crv = new CRValue(&#8216;Col1&#8242;, &#8216;Val1&#8242;);<br />
	return crv;<br />
}</p>
<p>doit();</p>
<p>When doit() returns a CRV, I need to know that the type is &#8216;CRV&#8217;.</p>
<p>This compiles, but kills the engine on the GetName();<br />
Local jsfunc = result-&gt;ToFunction();<br />
Handle hFunctionName = jsfunc-&gt;GetName();</p>
<p>where result is return from script-&gt;Run();</p>
<p>Any suggestions would be appreciated.</p>
<p>Thanks,<br />
Tom</p>
]]></content:encoded>
	</item>
</channel>
</rss>
