Skip to content

test: add vm module edge cases

Rodrigo Muino Tomonari requested to merge github/fork/fhinkel/vm-tests into master

This PR adds two, admittedly contrived, examples that test edge cases of the vm module.

They demonstrate that the if statements if (maybe_rv.IsEmpty()) and if (maybe_prop_attr.IsNothing()) in the GetterCallback and the QueryCallback in src/node_contextify.cc are observable. So far we have no tests that break when these statements are removed (neither does Jest).

Both GetterCallback and QueryCallback explicitly check the global_proxy() if a property is not found on the sandbox. In these tests, the explicit check inside the callback yields different results than deferring the check until after the callback. The check is deferred, if the callbacks do not intercept, i.e., if args.GetReturnValue().Set() is not called.

Since we're working on fixing several of the vm issues, I'd like to have these tests so we're at least aware if we cause any breaking changes.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Merge request reports

Loading