Module: RequireHooks::Bootsnap::LoadIseqExt

Defined in:
lib/require-hooks/mode/bootsnap.rb

Instance Method Summary collapse

Instance Method Details

#load_iseq(path) ⇒ Object

Around hooks must be performed every time we trigger a file load, even if the file is already cached.



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/require-hooks/mode/bootsnap.rb', line 31

def load_iseq(path)
  ctx = RequireHooks.context_for(path)
  # Early-return for non-trackable paths
  return super if ctx.empty?

  ctx.run_around_load_callbacks(path) do
    iseq = super
    return unless iseq

    iseq.eval
    EMPTY_ISEQ
  end
end