mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
In Gecko engine `commandLine.options.watch` evaluates to a truthy value (a function). Adding an extra check to work around. [Definition of CompilerOptions.watch in compiler/types](https://github.com/Microsoft/TypeScript/blob/master/src/compiler/types.ts#L1860) ``` typescript export interface CompilerOptions { // . . . watch?: boolean; ``` [Object.prototype.watch on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/watch) > Warning: Generally you should avoid using watch() and unwatch() when possible. These two methods are > implemented only in Gecko, and they're intended primarily for debugging use. In addition, using watchpoints > has a serious negative impact on performance, which is especially true when used on global objects, such > as window. You can usually use setters and getters or proxies instead. See Browser compatibility for details. > Also, do not confuse Object.watch with Object.observe.