Commit e6c548d
fix(ext/node): implement displayErrors for vm scripts (#33942)
## Summary
- Implements the `displayErrors` option for vm scripts in
`ext/node/ops/vm.rs`
- When `displayErrors` is true (the default), decorates the thrown
error's `stack` property with source location info —
`filename:line\nsource_line\narrow\n\n` — prepended to the existing
stack, matching Node.js behaviour
- Adds `validateObject(options, "options")` to `vm.compileFunction` so
the test's invalid-options assertions throw with the expected
`ERR_INVALID_ARG_TYPE` message
- Enables `parallel/test-vm-basic.js` in
`tests/node_compat/config.jsonc`
Closes denoland/orchid#3
Diff is fully self-contained: 51 lines in `ext/node/ops/vm.rs` + 1 line
in `ext/node/polyfills/vm.js` + 1 line in
`tests/node_compat/config.jsonc`. No follow-up needed; everything the
enabled test requires is in this PR.
Co-authored-by: Divy Srivastava <me@littledivy.com>1 parent 6a70eb7 commit e6c548d
3 files changed
Lines changed: 52 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
255 | 304 | | |
256 | 305 | | |
257 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| 359 | + | |
359 | 360 | | |
360 | 361 | | |
361 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3640 | 3640 | | |
3641 | 3641 | | |
3642 | 3642 | | |
| 3643 | + | |
3643 | 3644 | | |
3644 | 3645 | | |
3645 | 3646 | | |
| |||
0 commit comments