Created
May 6, 2011 07:13
-
-
Save kg/958550 to your computer and use it in GitHub Desktop.
JSIL metaprogramming test case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using JSIL; | |
public static class Program { | |
public static void Main (string[] args) { | |
const string pri = "pri"; | |
string nt = "nt"; | |
var p = Builtins.Global[pri + nt]; | |
if (p != null) | |
p("printed"); | |
if (Builtins.Local["p"] != null) | |
Builtins.Local["p"]("printed again"); | |
var q = Builtins.Global["quit"]; | |
if (q != null) | |
q(); | |
Console.WriteLine("test"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// l3k4qh1i, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null | |
JSIL.DeclareNamespace(this, "Program"); | |
Program.Main = function (args) { | |
var nt = null, p = null, q = null; | |
nt = "nt"; | |
p = JSIL.GlobalNamespace[System.String.Concat("pri", nt)]; | |
if (!!(p !== null)) { | |
p("printed"); | |
} | |
if (!!(p !== null)) { | |
p("printed again"); | |
} | |
q = JSIL.GlobalNamespace.quit; | |
if (!!(q !== null)) { | |
q(); | |
} | |
System.Console.WriteLine("test"); | |
} | |
timeout(30); Program.Main([]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment