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
Script fails when trying to set a value on the context.metadata field.
@setMetadata - bar
/Users/ivanmushketyk/Development/courses-creation/pluralsight-typescript-decorators/metadata.js:48
context.metadata[context.name] = true;
^
TypeError: Cannot set properties of undefined (setting 'bar')
at setMetadata (/Users/ivanmushketyk/Development/courses-creation/pluralsight-typescript-decorators/metadata.js:48:36)
at __esDecorate (/Users/ivanmushketyk/Development/courses-creation/pluralsight-typescript-decorators/metadata.js:12:40)
at /Users/ivanmushketyk/Development/courses-creation/pluralsight-typescript-decorators/metadata.js:78:13
at /Users/ivanmushketyk/Development/courses-creation/pluralsight-typescript-decorators/metadata.js:82:11
at Object.<anonymous> (/Users/ivanmushketyk/Development/courses-creation/pluralsight-typescript-decorators/metadata.js:84:2)
π Expected behavior
It should not fail, and metadata should be displayed using the console.log statement
Additional information about the issue
Compiler version:
tsc --version
Version 5.2.1-rc
The text was updated successfully, but these errors were encountered:
π Search Terms
"decorator metadata" in both closed and opened issues.
π Version & Regression Information
context.metadata
is undefined in a decorator functionβ― Playground Link
No response
π» Code
Code mostly copies the example from the TypeScript 5.2 release notes.
π Actual behavior
Script fails when trying to set a value on the
context.metadata
field.π Expected behavior
It should not fail, and metadata should be displayed using the
console.log
statementAdditional information about the issue
Compiler version:
The text was updated successfully, but these errors were encountered: