fix(javascript): expose operands of unmodelled implicit execution (#10631)

* fix(javascript): expose operands of unmodelled implicit execution

The member-mutation collectors now escape the operands of every execution
kind they did not apply: yielded values, JSX element operands, dynamic
import specifiers and options, decorated classes, with-statement scope
objects, iteration inside accessors and syntax the classification does not
describe. Each of these left a literal where the equivalent explicit call
already yields unknown.

Decorators are classified at the class definition that calls them and are
evaluated as definition-time expressions.

* fix(javascript): expose decorated instance members and keep a decorator's outer this

A class's decorator execution now exposes decorated members' functions and initializers, which a decorator can call without the class running them. The getter receiver walk uses the shared javaScriptDefinitionExpression owner, so class and member decorators see the enclosing this like heritage and computed keys.
This commit is contained in:
morluto authored and GitHub committed 2026-11-15 08:37:09 +08:00
1 parent 8c052bdec5
commit f56b417a58
5 files changed
+225 -82

No files matched your search

@@ -102,7 +102,7 @@ it.each([
["class C extends Base {}", { ClassDeclaration: ["class-definition"] }],
[
"@decorate class C {}",
{ ClassDeclaration: ["class-definition"], Decorator: ["decorator"] },
{ ClassDeclaration: ["class-definition", "decorator"] },
],
["import(value);", { ImportExpression: ["dynamic-import"] }],
["with (value) key;", { WithStatement: ["dynamic-scope"] }],