Skip to content

Instantly share code, notes, and snippets.

@ProdigySim
Created November 7, 2012 21:13
Show Gist options
  • Save ProdigySim/4034510 to your computer and use it in GitHub Desktop.
Save ProdigySim/4034510 to your computer and use it in GitHub Desktop.
saltarelle import constructor names
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.CompilerServices;
namespace saltytest
{
class Program
{
static void Main()
{
ExternalType t = new ExternalType();
t.DoSomething();
ExternalType2 t2 = new ExternalType2();
t2.DoSomething();
ExternalType3 t3 = new ExternalType3();
t3.DoSomething();
ExternalType4 t4 = new ExternalType4();
t4.DoSomething();
}
}
[Imported]
public class ExternalType
{
public extern ExternalType();
public extern void DoSomething();
}
[ScriptName("ExternalType2")]
[Imported]
public class ExternalType2
{
public extern ExternalType2();
public extern void DoSomething();
}
[ScriptName("ExternalType3")]
[Imported]
public class ExternalType3
{
[ScriptName("ExternalType3")]
public extern ExternalType3();
public extern void DoSomething();
}
[Imported]
public class ExternalType4
{
[ScriptName("ExternalType4")]
public extern ExternalType4();
public extern void DoSomething();
}
}
// Output:
////////////////////////////////////////////////////////////////////////////////
//// saltytest.Program
//var $saltytest_$Program = function() {
//};
//$saltytest_$Program.$main = function() {
// var t = new Object();
// t.doSomething();
// var t2 = new Object();
// t2.doSomething();
// var t3 = new Object.ExternalType3();
// t3.doSomething();
// var t4 = new Object.ExternalType4();
// t4.doSomething();
//};
//Type.registerClass(null, 'saltytest.$Program', $saltytest_$Program, Object);
//$saltytest_$Program.$main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment