convert JavaScript to C #

Source: Internet
Author: User

Because of a requirement, JavaScript has to be translated into C #.

There's actually a powerful node. js.

Talk about Code,

You can actually use dynamic to do this. But dynamic has a lot of problems.

Directly on the code bar, not difficult, is very verbose.

Https://github.com/zzbjuke/javascripttoCsharp

Description

C # Variables cannot be changed once they are defined. Unless you use the object type.

JS can be arbitrarily changed.

All types are reference types and inherit BaseType

Assigning a value to an object call the __set__ method

        <summary>///Set value///        </summary>/        <param name= "name" ></param>        // <param name= "value" ></param>        ///<returns></returns> public virtual void __set__ ( String name, _u_ value) {                   }

Call Object Method __call__ method

        <summary>/        //Call method        ///</summary>//<param name= "name" ></param>        // /<param name= "args" ></param>///        <returns></returns> public        virtual _u_ __call__ ( String name, _u_ _this, params _u_[] args) {        }

  

comparison operator, unary operator, two-tuple operator direct (operator) overload reference (_u_.cs)

convert JavaScript to C #

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.