Update the JS NameResolver for Stencil
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox78 | --- | fixed |
People
(Reporter: tcampbell, Assigned: tcampbell)
References
Details
Attachments
(1 file)
The NameResolver code directly accesses the JSFunctions to read and write their guessed atom names. Right now this happens in a batch process at the very end of the initial parse, but we should still support it inside Stencil.
To fix this, we need to cleanup how guessed atoms are handled in the FunctionBox. Right now we track the "explicit" name, but this should be generalized.
Some terminology:
- "explicit" name: The binding name in the source. Eg the
finfunction f() { }. Is exposed onfun.namein JS. - "implicit" name: The spec defines that some grammar forms should apply a name to an otherwise anonymous function. This is exposed on
fun.nameand may be computed at compile time (eg. thefooinlet foo = function() {};), and others cases may compute at runtime usingJSOp::SetFunName(eg. thefooinlet name = "foo"; let x = { [name]: function() { } }). - "guessed" name: The engine synthesizes a name using the
NameResolver. These usually have/and^characters. These function do not have afun.namevalue, but the names may be used by the debugger to help out the user.
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
| Assignee | ||
Comment 1•5 years ago
|
||
Use the FunctionFlags in the FunctionBox to distinguish explict, inferred,
and guessed atom types. When inter-converting between FunctionBox and
JSFunctions we now sync all types of atoms.
Note that if the function pre-exists we still propegate the name directly.
The code coverage initialization is triggered by JSScript creation which is
not fully deferred, so we need to the setInferredName to take effect before
then.
Comment 3•5 years ago
|
||
| bugherder | ||
Description
•