|
@@ -109,10 +109,11 @@ class ExampleJSGenerator {
|
|
checkFieldName(c, f);
|
|
checkFieldName(c, f);
|
|
var field = field(f.name);
|
|
var field = field(f.name);
|
|
fprint("$p.prototype$field = ");
|
|
fprint("$p.prototype$field = ");
|
|
- if( f.expr == null )
|
|
|
|
|
|
+ var e = f.expr();
|
|
|
|
+ if( e == null )
|
|
print("null");
|
|
print("null");
|
|
else {
|
|
else {
|
|
- genExpr(f.expr);
|
|
|
|
|
|
+ genExpr(e);
|
|
}
|
|
}
|
|
newline();
|
|
newline();
|
|
}
|
|
}
|
|
@@ -120,13 +121,14 @@ class ExampleJSGenerator {
|
|
function genStaticField( c : ClassType, p : String, f : ClassField ) {
|
|
function genStaticField( c : ClassType, p : String, f : ClassField ) {
|
|
checkFieldName(c, f);
|
|
checkFieldName(c, f);
|
|
var field = field(f.name);
|
|
var field = field(f.name);
|
|
- if( f.expr == null ) {
|
|
|
|
|
|
+ var e = f.expr();
|
|
|
|
+ if( e == null ) {
|
|
fprint("$p$field = null");
|
|
fprint("$p$field = null");
|
|
newline();
|
|
newline();
|
|
} else switch( f.kind ) {
|
|
} else switch( f.kind ) {
|
|
case FMethod(_):
|
|
case FMethod(_):
|
|
fprint("$p$field = ");
|
|
fprint("$p$field = ");
|
|
- genExpr(f.expr);
|
|
|
|
|
|
+ genExpr(e);
|
|
newline();
|
|
newline();
|
|
default:
|
|
default:
|
|
statics.add( { c : c, f : f } );
|
|
statics.add( { c : c, f : f } );
|
|
@@ -139,7 +141,7 @@ class ExampleJSGenerator {
|
|
var p = getPath(c);
|
|
var p = getPath(c);
|
|
fprint("$p = $$hxClasses['$p'] = ");
|
|
fprint("$p = $$hxClasses['$p'] = ");
|
|
if( c.constructor != null )
|
|
if( c.constructor != null )
|
|
- genExpr(c.constructor.get().expr);
|
|
|
|
|
|
+ genExpr(c.constructor.get().expr());
|
|
else
|
|
else
|
|
print("function() { }");
|
|
print("function() { }");
|
|
newline();
|
|
newline();
|
|
@@ -210,7 +212,7 @@ class ExampleJSGenerator {
|
|
var p = getPath(c);
|
|
var p = getPath(c);
|
|
var f = field(cf.name);
|
|
var f = field(cf.name);
|
|
fprint("$p$f = ");
|
|
fprint("$p$f = ");
|
|
- genExpr(cf.expr);
|
|
|
|
|
|
+ genExpr(cf.expr());
|
|
newline();
|
|
newline();
|
|
}
|
|
}
|
|
|
|
|