2
0
Эх сурвалжийг харах

workaround for latest monaco

Nicolas Cannasse 1 жил өмнө
parent
commit
a007ef4df8
2 өөрчлөгдсөн 14 нэмэгдсэн , 3 устгасан
  1. 1 0
      common.hxml
  2. 13 3
      hide/tools/Macros.hx

+ 1 - 0
common.hxml

@@ -13,3 +13,4 @@
 -D no-deprecation-warnings
 -D manual_sync_pad
 -cp libs
+--macro hide.tools.Macros.initHide()

+ 13 - 3
hide/tools/Macros.hx

@@ -15,6 +15,16 @@ class Macros {
 	}
 
 	#if macro
+
+	public static function initHide() {
+		switch( Context.getType("Reflect") ) {
+		case TInst(c,_):
+			// avoid conflict with monaco class
+			c.get().meta.add(":native",[macro "_Reflect"], (macro null).pos);
+		default:
+		}
+	}
+
 	static function includeShaderSources() {
 		var paths = [
 			"h3d/shader/BaseMesh.hx",
@@ -106,10 +116,10 @@ class Macros {
 				case FVar(t, e):
 					// Don't save a field with his default value
 					if( e != null )
-						saveExpr.push(macro if( this.$name != $e ) obj.$name = this.$name); 
+						saveExpr.push(macro if( this.$name != $e ) obj.$name = this.$name);
 					else {
 						switch t {
-							// Basic types default values : https://haxe.org/manual/types-nullability.html 					
+							// Basic types default values : https://haxe.org/manual/types-nullability.html
 							case TPath(p):
 								if( p.name == "Bool" )
 									saveExpr.push(macro if( this.$name != false) obj.$name = this.$name);
@@ -117,7 +127,7 @@ class Macros {
 									saveExpr.push(macro if( this.$name != #if flash NaN #else 0.0 #end ) obj.$name = this.$name);
 								else if( p.name == "Int" )
 									saveExpr.push(macro if( this.$name != 0 ) obj.$name = this.$name);
-								else 
+								else
 									saveExpr.push(macro if( this.$name != null ) obj.$name = this.$name);
 							default:
 								saveExpr.push(macro if( this.$name != null ) obj.$name = this.$name);