Git Product home page Git Product logo

blade's People

Contributors

digitalbeacon avatar dorba avatar ventajou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blade's Issues

Signature of "map"

I believe the signature of the extension method should be changed to

public static TOut[] map<T, TOut>(this T[] array, Func<T, int, T[], TOut> callback, object thisObj = null)

As it does not makes much sense to have the return type to be T[] if the mapping method returns TOut.

Array initialization happening after calling the base constructor

Consider the following:

    class BaseClass
    {
        public virtual string[] Foo { get { return new[] { "Base" }; } }

        public BaseClass()
        {
            console.log(Foo);
        }
    }

    class ChildClass : BaseClass
    {
        private string[] _bar = new string[] { "Child" };
        public override string[] Foo { get { return _bar; } }

        public ChildClass()
            : base()
        { }
    }

The compiled JavaScript will actually initialize the array out of order, which is inconsistent with how c# works:

ChildClass = (function() {
    Blade.derive(ChildClass, BaseClass);
    var $base = BaseClass.prototype;
    function ChildClass() {
        $base.constructor.call(this);
        this._bar = ['Child'];
    }
    var p = ChildClass.prototype;
    p.get_Foo = function() {
        return this._bar;
    };
    return ChildClass;
})();

Requirements

It look like Roslyn is required. Roslyn requires the VsSDK. I tried to install that but then it asked for my VS install disk. I bailed at that point.

Is all that really required? I have VS 2010 Ultimate (and 2012 RC) installed.

Any help on the easiest route to get going would be great. I can't wait to dig in!

Dan

Base constructor with arguments not supported.

The following code fails to compile with the error: No translator was found to handle model of type Blade.Compiler.Models.Argument

    public class TestClass
    {
        public TestClass(string someString)
        {
        }
    }

    public class TestSubClass : TestClass
    {
        public TestSubClass(string someString)
            : base(someString)
        {
        }
    }

Floating point constants are localized...

Floating point constants are generated with the current Windows culture. For example compiling the following:

public const double test = 0.2f;

when Windows is set for France settings, will output this:

BladeBug.Class1.test = 0,2;

Source code maps

Chrome has support for source maps in its set of developer tools for debugging javascript code. Source maps allow you to map the generated javascript to lines in the original source, so you can debug in the original source language. Would be nice to support this feature in a C# to javascript compiler by also generating source map files.

License

hey guys,

could you please clarify which license you use and add the file to the root of the project ?

Thanks
Pavel

Method to define simple JSON like classes, and import global functions

Hello,

I'm planning to use Blade in place of ScriptSharp, and would also like to contribute if possible. Some questions:

  1. Is there a way to define a class that when instantiated creates a code like

[ScriptJson???]
public class Dummy {
public int a;
public int b;
}

C# ---> var x = new Dummy() { a = 5, b = 4 } ;
JS ---> var x = { a: 5, b: 4 };

Managed to do something close by using ScriptName("Object") but it generates too verbose code with inline functions etc.

  1. How to import externally defined global functions?
  2. A way to generate script code directly, like Script.Literal?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.