Comments (1)
When creating externs you may hit problems with reserved keywords (https://haxe.org/manual/expression.html), in which case you can use the @:native
meta:
extern class A {
@:native('default') var default_: String;
...
}
extern interface B {
@:native('class') var clazz: Dynamic;
...
}
var a: A;
a.default_ = 'x'; // will be generated as `a.default = "x"`
This @:native
meta is only supported on classes and interfaces declarations, but not typedefs; most of the time interfaces can be used interchangeably to represent extern JSON objects.
from haxe.org-comments.
Related Issues (20)
- [haxe.org/manual] Dynamic (Class Fields - Access Modifier) HOT 10
- [code.haxe.org] Abstract types - Email address as abstract type HOT 1
- [code.haxe.org] Beginner - Pattern matching HOT 2
- [code.haxe.org] Abstract types - Pipe using Abstract Operator Overloading HOT 2
- [haxe.org/manual] Target Details HOT 1
- [haxe.org/manual] Generic HOT 2
- [haxe.org/manual] Null Safety HOT 2
- [haxe.org/manual] Blocks HOT 3
- [haxe.org/manual] Tail Recursion Elimination (TRE) HOT 1
- [haxe.org/manual] Module Sub-Types HOT 3
- [code.haxe.org] Macros - Working with compiler flags HOT 1
- [haxe.org/manual] Extractors HOT 2
- [haxe.org/manual] Array Access (Types - Abstract) HOT 2
- [haxe.org/manual] Overriding Methods HOT 1
- [haxe.org/manual] Variable capture HOT 2
- [haxe.org/manual] Tracing Types HOT 1
- [code.haxe.org] Beginner - Using numbers HOT 2
- [haxe.org/manual] Defines (Target Details - C++) HOT 7
- [haxe.org/manual] Import defaults / import.hx HOT 1
- [haxe.org/manual] Type Parameters (Type System) HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haxe.org-comments.