-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyHelp WantedYou can do thisYou can do this
Milestone
Description
π Search Terms
defineProperty, cannot find namee
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about
defineProperty
β― Playground Link
π» Code
// javascript.js
// @ts-check
// Does not error unless in `.ts` file.
Object.defineProperty(foo, "name", { value: "default", writable: false });π Actual behavior
No error in .js files
π Expected behavior
Errors in .js files with TS2304: Cannot find name 'foo'.
Additional information about the issue
Full repro: https://github.com/eps1lon/tsc-object-define-property
mohityadav8 and lubieowoce
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyHelp WantedYou can do thisYou can do this