Skip to content

Commit

Permalink
[flow] Gate extending globals in check_service under `enable_declare_…
Browse files Browse the repository at this point in the history
…global`

Summary:
It doesn't help with the `Parsing_heaps.Leader_not_found` crash with this repro (D69571207), but this is certainly safer.

Changelog: [internal]

Reviewed By: panagosg7

Differential Revision: D69570928

fbshipit-source-id: 74f1ea99dd33ba0aa35aae55d5596fac9ceecbf1
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Feb 13, 2025
1 parent eb6888e commit 79b161a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/services/inference/check_service.ml
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,7 @@ let mk_check_file ~reader ~options ~master_cx ~cache () =
in
Lazy.force file_rec
and extend_local_globals cx ~resolved_requires =
if File_key.is_lib_file (Context.file cx) then
()
else
if Context.enable_declare_global cx && not (File_key.is_lib_file (Context.file cx)) then
let local_builtins =
lazy
(let global_types =
Expand Down Expand Up @@ -370,6 +368,8 @@ let mk_check_file ~reader ~options ~master_cx ~cache () =
)
in
Context.extend_local_builtins cx local_builtins
else
()
in
let check_file file_key resolved_modules ast file_sig docblock aloc_table find_ref_request =
let (_, { Flow_ast.Program.all_comments = comments; _ }) = ast in
Expand Down

0 comments on commit 79b161a

Please sign in to comment.