<commit_before>(**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *)

open Type

let mk_with_proto cx reason
  ?(sealed=false) ?(exact=true) ?(frozen=false) ?dict ?call ?(props=SMap.empty) proto =
  let sealed =
    if sealed then Sealed
    else UnsealedInFile (Loc.source (Reason.aloc_of_reason reason |> ALoc.to_loc))
  in
  let flags = { sealed; exact; frozen } in
  let call = Option.map call ~f:(Context.make_call_prop cx) in
  let pmap = Context.make_property_map cx props in
  DefT (reason, ObjT (mk_objecttype ~flags ~dict ~call pmap proto))

let mk cx reason =
  mk_with_proto cx reason (ObjProtoT reason)

and sealed_in_op reason_op = function
  | Sealed -> true
  | UnsealedInFile source -> source <> (Loc.source (Reason.aloc_of_reason reason_op |> ALoc.to_loc))<commit_msg>Remove unnecessary `ALoc.to_loc` calls in `obj_type.ml`<commit_after>(**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *)

open Type

let mk_with_proto cx reason
  ?(sealed=false) ?(exact=true) ?(frozen=false) ?dict ?call ?(props=SMap.empty) proto =
  let sealed =
    if sealed then Sealed
    else UnsealedInFile (ALoc.source (Reason.aloc_of_reason reason))
  in
  let flags = { sealed; exact; frozen } in
  let call = Option.map call ~f:(Context.make_call_prop cx) in
  let pmap = Context.make_property_map cx props in
  DefT (reason, ObjT (mk_objecttype ~flags ~dict ~call pmap proto))

let mk cx reason =
  mk_with_proto cx reason (ObjProtoT reason)

and sealed_in_op reason_op = function
  | Sealed -> true
  | UnsealedInFile source -> source <> (ALoc.source (Reason.aloc_of_reason reason_op))
{'fraction_non_alphanumeric': 0.09978308026030369, 'fraction_numerical': 0.004338394793926247, 'mean_word_length': 4.211864406779661, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4855912', 'n_tokens_mistral': 633, 'n_tokens_neox': 616, 'n_words': 210}