Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[enhance] bslregisterlib: validate js based on conf.

  • Loading branch information...
commit d676e96909324e8c5d4fbedfa8c877b5a069806a 1 parent b683260
@arthuraa arthuraa authored
Showing with 11 additions and 11 deletions.
  1. +11 −11 compiler/libbsl/bslRegisterLib.ml
View
22 compiler/libbsl/bslRegisterLib.ml
@@ -1205,22 +1205,22 @@ let js_validator finalized_t =
)
in
- (* The path were preprocessed JS files will be *)
- let path_for_validation file =
- let (/) a b = Filename.concat a b in
- let path =
- (name ^ ".opp")/(Filename.dirname file)/
- (Printf.sprintf "%s_%s" name (Filename.basename file)) in
- if builddir == "" then path else builddir/path in
+ (* The path were preprocessed JS files will be, if they need validation. *)
+ let path_for_validation (file, _, conf) =
+ match conf with
+ | BslJsConf.Verbatim -> None
+ | BslJsConf.Optimized _ ->
+ let (/) a b = Filename.concat a b in
+ let path =
+ (name ^ ".opp")/(Filename.dirname file)/
+ (Printf.sprintf "%s_%s" name (Filename.basename file)) in
+ Some (if builddir == "" then path else builddir/path) in
let command = Format.sprintf "%s %a %a %a --js_output_file output.js"
executable
pp_str_list cmd_options
pp_extern_files_list extern_files
- pp_file_list
- (List.map
- (fun (f,_,_) -> path_for_validation f)
- finalized_t.f_js_code)
+ pp_file_list (List.filter_map path_for_validation finalized_t.f_js_code)
in
OManager.verbose "JS VALIDATION : %s\n" command;
let r = Sys.command command in
Please sign in to comment.
Something went wrong with that request. Please try again.