Nicolas Cannasse 15 年之前
父節點
當前提交
b778c4c0b1
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      genjs.ml

+ 1 - 0
genjs.ml

@@ -601,6 +601,7 @@ let generate_package_create ctx (p,_) =
 	loop [] p
 
 let gen_class_static_field ctx c f =
+	if f.cf_name = "prototype" then error ("The field name '" ^ f.cf_name ^ "'  is not allowed in JS") (match f.cf_expr with None -> c.cl_pos | Some e -> e.epos);
 	match f.cf_expr with
 	| None ->
 		print ctx "%s%s = null" (s_path ctx c.cl_path) (field f.cf_name);