Explorar o código

keep fields if they are featured on Js

Simon Krajewski %!s(int64=13) %!d(string=hai) anos
pai
achega
1fb778494a
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      dce.ml

+ 4 - 0
dce.ml

@@ -68,6 +68,10 @@ let keep_field dce cf =
 	has_meta ":keep" cf.cf_meta
 	|| has_meta ":used" cf.cf_meta
 	|| cf.cf_name = "__init__"
+	|| dce.ctx.com.platform = Js && (try (match get_meta ":feature" cf.cf_meta with
+			| (_,[EConst(String s),_],_) -> Common.has_feature dce.ctx.com s
+			| _ -> raise Not_found)
+		with Not_found -> false)
 
 (* marking *)