Template object lifetime doesn't match the spec
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: jonco, Unassigned)
References
()
Details
The spec has been updated to clarify the lifetime of template objects created for string templates. The summary is:
The Lit framework depends on the identity of template arrays being stable (and not being recreated) so long as the site might still get evaluated in the future.
The update talks about the GetTemplateObject spec function and the realm's TemplateMap field, but those don't exist in our implementation because we store the template objects as GC things associated with the CallSiteObj bytecode.
As far as I can see this means we will discard them on relazification and recreate them on delazification, which would be non-compliant. However I tried to write a test to prove this using the relazifyFunctions() testing function but I couldn't get it to fail so I'm not sure either way.
Comment 1•3 years ago
•
|
||
(In reply to Jon Coppeard (:jonco) from comment #0)
As far as I can see this means we will discard them on relazification and recreate them on delazification, which would be non-compliant. However I tried to write a test to prove this using the relazifyFunctions() testing function but I couldn't get it to fail so I'm not sure either way.
We don't relazify functions that have call site template objects.
| Reporter | ||
Comment 2•3 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #1)
Thanks. In that case we are compliant after all.
Description
•