Skip to content

Commit a4cabe7

Browse files
authoredSep 12, 2022
Support for auto-accessor fields from the Stage 3 Decorators proposal (#49705)
* Support for auto-accessor fields * Add tests, ensure accessors are initialized in ctor * classFields cleanup and PR feedback
1 parent 7737473 commit a4cabe7

File tree

196 files changed

+7457
-1227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+7457
-1227
lines changed
 

‎scripts/eslint/rules/debug-assert.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module.exports = createRule({
4646
context.report({ messageId: "secondArgumentDebugAssertError", node: message1Node });
4747
}
4848

49-
if (argsLen < 3) {
49+
if (argsLen !== 3) {
5050
return;
5151
}
5252

‎src/compiler/binder.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -2732,7 +2732,10 @@ namespace ts {
27322732
}
27332733

27342734
function bindPropertyWorker(node: PropertyDeclaration | PropertySignature) {
2735-
return bindPropertyOrMethodOrAccessor(node, SymbolFlags.Property | (node.questionToken ? SymbolFlags.Optional : SymbolFlags.None), SymbolFlags.PropertyExcludes);
2735+
const isAutoAccessor = isAutoAccessorPropertyDeclaration(node);
2736+
const includes = isAutoAccessor ? SymbolFlags.Accessor : SymbolFlags.Property;
2737+
const excludes = isAutoAccessor ? SymbolFlags.AccessorExcludes : SymbolFlags.PropertyExcludes;
2738+
return bindPropertyOrMethodOrAccessor(node, includes | (node.questionToken ? SymbolFlags.Optional : SymbolFlags.None), excludes);
27362739
}
27372740

27382741
function bindAnonymousTypeWorker(node: TypeLiteralNode | MappedTypeNode | JSDocTypeLiteral) {

0 commit comments

Comments
 (0)
Please sign in to comment.