<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Add the node &quot;global&quot; object to the environment. so that methods declared on it become global to all modules]]></title><description><![CDATA[<p>I ran a test getting c# transpiled to JS (via DuoCode) to run last night. Sadly. It expects presence of either nodes "global" or the browsers "document" object. </p>
<p>I faked it by manually editing its global object to a new JS object. and manually fixing calls to methods it register's "Globally" to instead call based upon that object. </p>
<p>Example:  <a href="https://gist.github.com/fusspawn/231beee4c6ddb90bfca3" rel="nofollow noreferrer">https://gist.github.com/fusspawn/231beee4c6ddb90bfca3</a></p>
<p>Changes made to DuoCode output to get it running are on lines 4-7 of the compiled js and a few commented lines at the end of the compiled js </p>
<p>15723 -&gt; 15736.</p>
<p>Please can we have a global object please &lt;3.    </p>]]></description><link>http://screeps.com/forum/topic/1741/add-the-node-global-object-to-the-environment-so-that-methods-declared-on-it-become-global-to-all-modules</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 08:13:39 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/1741.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 May 2015 22:55:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Add the node &quot;global&quot; object to the environment. so that methods declared on it become global to all modules on Invalid Date]]></title><description><![CDATA[<p>I ran a test getting c# transpiled to JS (via DuoCode) to run last night. Sadly. It expects presence of either nodes "global" or the browsers "document" object. </p>
<p>I faked it by manually editing its global object to a new JS object. and manually fixing calls to methods it register's "Globally" to instead call based upon that object. </p>
<p>Example:  <a href="https://gist.github.com/fusspawn/231beee4c6ddb90bfca3" rel="nofollow noreferrer">https://gist.github.com/fusspawn/231beee4c6ddb90bfca3</a></p>
<p>Changes made to DuoCode output to get it running are on lines 4-7 of the compiled js and a few commented lines at the end of the compiled js </p>
<p>15723 -&gt; 15736.</p>
<p>Please can we have a global object please &lt;3.    </p>]]></description><link>http://screeps.com/forum/post/7539</link><guid isPermaLink="true">http://screeps.com/forum/post/7539</guid><dc:creator><![CDATA[Fusspawn]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Add the node &quot;global&quot; object to the environment. so that methods declared on it become global to all modules on Invalid Date]]></title><description><![CDATA[<p>However. Supprinsgly. Setting up the .NET runtime. and calling the writeline. Takes very little cpu budget.. </p>]]></description><link>http://screeps.com/forum/post/7540</link><guid isPermaLink="true">http://screeps.com/forum/post/7540</guid><dc:creator><![CDATA[Fusspawn]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Add the node &quot;global&quot; object to the environment. so that methods declared on it become global to all modules on Invalid Date]]></title><description><![CDATA[<p>I don't know if this will help you, but objects created without <code>var</code> are visible globally.</p>
<p><code>myModule</code>:</p>
<pre><code class="javascript">myGlobalVar = "immaglobal";
var myLocalVar = "immalocal";
</code></pre>
<p><code>myOtherModule</code>:</p>
<pre><code class="javascript">console.log(myGlobal); // "immaglobal"
console.log(myLocal); // error, undefined
</code></pre>
<p><code>main</code>:</p>
<pre><code class="javascript">require('myModule');
require('myOtherModule');
console.log(myGlobal); // &gt; "immaglobal"
console.log(myLocal); // &gt; error, undefined
</code></pre>]]></description><link>http://screeps.com/forum/post/7541</link><guid isPermaLink="true">http://screeps.com/forum/post/7541</guid><dc:creator><![CDATA[JustMonkeyCode]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Add the node &quot;global&quot; object to the environment. so that methods declared on it become global to all modules on Invalid Date]]></title><description><![CDATA[<p>While my post was true at the time I posted it, this no longer works, which is not awesome. I was using that fact to expose my constructors globally.</p>]]></description><link>http://screeps.com/forum/post/7542</link><guid isPermaLink="true">http://screeps.com/forum/post/7542</guid><dc:creator><![CDATA[JustMonkeyCode]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Add the node &quot;global&quot; object to the environment. so that methods declared on it become global to all modules on Invalid Date]]></title><description><![CDATA[<p>Thanks for the info. and the update.</p>]]></description><link>http://screeps.com/forum/post/7543</link><guid isPermaLink="true">http://screeps.com/forum/post/7543</guid><dc:creator><![CDATA[Fusspawn]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>