Parent: #22
Goal
Implement real source-location plumbing for evaluated scripts/modules before treating JavaScriptCore-shaped source metadata as stable API surface.
Background
JSEvaluateScript still accepts sourceURL and startingLineNumber, but the parser/runtime diagnostic path currently reports coarse error names rather than source-aware locations. Earlier #22 cleanup intentionally avoided a decorative implementation because attaching the arguments only at the C boundary would not improve parse/runtime diagnostics.
Scope
- Add a source-name / starting-line representation to the parser/evaluator pipeline.
- Preserve enough token/node or diagnostic span information to report meaningful parse errors.
- Thread source names through runtime stack/error reporting where applicable.
- Make
JSEvaluateScript(..., sourceURL, startingLineNumber, exception)either honor those values with focused tests or replace/remove the inert arguments before stabilization. - Update docs so embedders know exactly what source metadata is supported.
Acceptance criteria
- A focused C-API test proves
sourceURLandstartingLineNumberaffect observable diagnostics/stack/error metadata. - Parser/runtime tests cover at least one parse error and one thrown runtime error with source metadata.
docs/api.mdno longer listssourceURL/startingLineNumberas inert compatibility arguments.