Closed Bug 1672886 Opened 4 years ago Closed 4 years ago

Add valid internal source locations for JS private class method field initializer lambdas

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Similar to Bug 1672065, the private-method case uses a non-standard way of creating FunctionBox, so we should add tests to track regressions in line/column representation.

https://searchfox.org/mozilla-central/rev/25d5a4443a7e13cfa58eff38f1faa5e69f0b170f/js/src/frontend/Parser.cpp#7854

Add tests to document the BaseScripts generated for different parse
constructs and track the sourceStart/sourceEnd values. This uses the debugger
API to find hidden scripts and access the source values. The details this
test checks are arbitrary implementation details, and the test expectations
can be updated as necessary.

Private class methods define an internal lambda function for the initializer,
but it currently uses source coordinates of [0,0) which isn't very helpful.
This patch updates it to cover the full field name until end of method body.

These distinctions are generally not exposed to users, but having internal
consistency is still helpful for defining engine invariants.

Depends on D94611

Summary: Add tests for private method source locations → Add valid internal source locations for JS private class methods
Summary: Add valid internal source locations for JS private class methods → Add valid internal source locations for JS private class method field initializer lambdas
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/718fef3b5b28
Add tests for script source extents. r=arai
https://hg.mozilla.org/integration/autoland/rev/6df41b430313
Fix SourceExtent of JS private class methods. r=arai
https://hg.mozilla.org/integration/autoland/rev/9d118cc87d6a
Update js::SourceExtent documentation. r=arai
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: