lib: add validation for options in compileFunction
This PR adds a validation step for the options parameter in the compileFunction method within lib/vm.js. The validateObject function is used to ensure that options is an object, aligning with the validation approach used in other functions like measureMemory in lib/vm.js.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 87.99%. Comparing base (
9029aec) to head (8df7b68). Report is 60 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #56023 +/- ##
==========================================
+ Coverage 87.95% 87.99% +0.03%
==========================================
Files 656 656
Lines 188372 188960 +588
Branches 35979 35975 -4
==========================================
+ Hits 165687 166275 +588
- Misses 15851 15854 +3
+ Partials 6834 6831 -3
| Files with missing lines | Coverage Δ | |
|---|---|---|
| lib/vm.js | 99.28% <100.00%> (+<0.01%) |
:arrow_up: |
@legendecas I added the test case, can you please check it?
CI: https://ci.nodejs.org/job/node-test-pull-request/63862/
CI: https://ci.nodejs.org/job/node-test-pull-request/63885/
CI: https://ci.nodejs.org/job/node-test-pull-request/63900/
Landed in 56c8360f878a3ccaf244416d9757ed03ec2e901e