Merged
Conversation
1. constructor functions are not supported 2. a few other features are now supported
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the JavaScript support documentation in CHANGES.md to clarify removed/unsupported JS patterns (notably constructor functions) and adjust the removed/unsupported feature lists to match current behavior.
Changes:
- Removes the earlier introductory mention that implied constructor functions still work, and replaces it with a clearer framing about trimming underused features.
- Adds explicit documentation and examples showing constructor functions are not supported and recommends converting to
class. - Updates the removed/unsupported JSDoc type/tag lists and the “Expando declarations” table to reflect the revised support matrix.
Show a summary per file
| File | Description |
|---|---|
| CHANGES.md | Updates JS support documentation, especially around expando-based constructor functions and related JSDoc/expando notes. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 2
Comment on lines
69
to
72
| | `@author` | <pre><code>/** @author Finn <finn@treehouse.com> */</pre></code> | Keep the same. | `@treehouse` parses as a new tag in Corsa. | | ||
| | Postfix optional type | `T?` | `T \| undefined` | This was legacy in Closure. | | ||
| | Postfix definite type | `T!` | `T` | This was legacy in Closure. | | ||
| | Identifier-named typedefs |<pre><code>`/** @typedef {T} */ typeName;</pre></code> | <pre><code>/** @typedef {T} typeName */</pre></code> | Closure feature. | | ||
| | Closure function type syntax | <pre><code>/* @type {function(string): void} */</pre></code> | <pre><code>/* @type {(s: string) => void} */</pre></code> | | | ||
| | Automatic typeof insertion | <pre><code>const o = { a: 1 };</code><br/><code>/\** @type {o} */</code><br/><code>var o2 = { a: 1 };</code></pre> | <pre><code>const o = { a: 1 };</code><br/><code>/\** @type {typeof o} */</code><br/><code>var o2 = { a: 1 };</code></pre> | | |
| #### `@class` or `@constructor` does not make a function into a constructor function. | ||
|
|
||
| Corsa ignores `@class` and `@constructor`. This makes a difference on a function without this-property assignments or associated prototype-function assignments. | ||
| Constructor functions are no longer supported. See the Expandos section. |
ahejlsberg
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I called out constructor function removal at the beginning since we've got a few questions about it recently.