Jelajahi Sumber

[display] make some methods under `#if macro` visible in display mode (fixes #6000)

Alexander Kuzmenko 7 tahun lalu
induk
melakukan
cdfe207bad

+ 1 - 1
std/haxe/macro/CompilationServer.hx

@@ -50,7 +50,7 @@ abstract ModuleCheckPolicy(Int) {
 	`--macro server.field(args)`.
 **/
 class CompilationServer {
-	#if macro
+	#if (macro || display)
 
 	/**
 		Sets the `ModuleCheckPolicy` of all files whose dot-path matches an

+ 1 - 1
std/haxe/macro/Context.hl.hx

@@ -27,7 +27,7 @@ import haxe.macro.Type.TypedExpr;
 @:noDoc @:hlNative("macro")
 class Context {
 
-#if macro
+#if (macro || display)
 
 	public static function error( msg : String, pos : Position ) : Dynamic {
 		return null;

+ 1 - 1
std/haxe/macro/ExampleJSGenerator.hx

@@ -244,7 +244,7 @@ class ExampleJSGenerator {
 		sys.io.File.saveContent(api.outputFile, buf.toString());
 	}
 
-	#if macro
+	#if (macro || display)
 	public static function use() {
 		Compiler.setCustomJSGenerator(function(api) new ExampleJSGenerator(api).generate());
 	}

+ 1 - 1
std/haxe/macro/Format.hx

@@ -28,7 +28,7 @@ import haxe.macro.Context;
 **/
 class Format {
 
-	#if macro
+	#if (macro || display)
 	public static function format( estr : Expr ) {
 		var str = switch( estr.expr ) {
 			case EConst(c): switch(c) { case CString(s): s; default: null; }