You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After submitting issue #22253, which is also related to something missing in decorator context objects, I noticed that none of the context objects from the reproduction run seemed to have a has method in their access objects.
According to the proposal specification, only the get and set property should vary in their presence depending on the type of target being decorated. The has method is supposed to be present in the context of every decorator type (other than "class", obviously).
Here's a quick reproduction:
constexample=(target,context)=>{const{ name, kind }=context;console.log(`name: "${name.toString()}"\nkind: ${context.kind}\n"access" in context => ${("access"incontext)}\n"has" in context.access => ${("has"incontext.access)}\n"get" in context.access => ${("get"incontext.access)}\n"set" in context.access => ${("set"incontext.access)}\n`,);};// quick, non-exhaustive demo with various target typesclassFoo{
@examplesomeMethod(){/* ignore */}
@examplegetsomeGetter(){returntrue;}
@examplesetsomeSetter(_){/* ignore */}
@example accessor foobar="bazbuzz";
@examplefieldOfBrokenDreams="change me";}
lucacasonato
added
bug
Something isn't working correctly
upstream
Changes in upstream are required to solve these issues
swc
related to swc (bundling/transpiling)
labels
Jun 18, 2024
Version: Deno v1.40.3+0bfa0cc
After submitting issue #22253, which is also related to something missing in decorator context objects, I noticed that none of the context objects from the reproduction run seemed to have a
has
method in theiraccess
objects.According to the proposal specification, only the
get
andset
property should vary in their presence depending on the type of target being decorated. Thehas
method is supposed to be present in the context of every decorator type (other than"class"
, obviously).Here's a quick reproduction:
And the output of the above code is:
Notice that
"has" in context.access
always results infalse
.The text was updated successfully, but these errors were encountered: