C# 轉 JS 編譯器 Saltarelle
這個編譯器可以將 C# 代碼編譯成 JavaScript 代碼。所以你可以使用所有 C# 的優勢,例如靜態類型檢查,自動補全,Lambda 表達式等等。再也不會有“object does not support this property or method”錯誤了!
Saltarelle 兼容其他的 JavaScript 類庫和框架,例如 jQuery。Saltarelle 支持 C# 4.0:
支持C# 語言特性如下:
This is a list of C# language features and whether SaltarelleCompiler supports them. If a feature is not on the list, it is most likely supported (unless it is very obscure).
- Inheritance
Supported - Type inference
Supported - ref/out parameters
Supported - Generics
Supported - Anonymous types
Supported - Lambdas and anonymous delegates
Supported - User-defined operators
Supported - User-defined conversions
Supported - Method overloading
Supported - Constructor overloading
Supported - Object and collection initializers
Supported - foreach
Supported - using statement
Supported - Exception handling
Supported - Named and default arguments
Supported - C# variable capture semantics
Supported - Always evaluate expressions left-to-right
Supported - Properties
Supported - Indexers
Supported - Events
Supported - Nullable types and lifted operators
Supported - dynamic
Supported - Nested types
Supported - Query expressions
Supported - goto/goto case/goto default
Supported - Iterator blocks (yield)
Supported - lock statement
Has no effect - async
Not yet supported - Multi-dimensional arrays
Not yet supported - Expression trees
Not yet supported - operator true/false
Not yet supported - extern alias
Not yet supported - Clipped integer type (short/byte)
Not yet supported - checked/unchecked
Not yet supported - User-defined value types
Not yet supported - Pointers
No support planned
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!