Remove extra if and else chain
Checklist
-
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
vm
Description of change
- Remove extra if and else chain for better readability
- Extract new
runInThisContext
andrunInContext
function so no code duplication and the function creation if encapsulated - Change legacy
var
tolet