@@ -41058,6 +41058,21 @@ var ts;
4105841058 emitSignatureParameters(ctor);
4105941059 }
4106041060 else {
41061+ // The ES2015 spec specifies in 14.5.14. Runtime Semantics: ClassDefinitionEvaluation:
41062+ // If constructor is empty, then
41063+ // If ClassHeritag_eopt is present and protoParent is not null, then
41064+ // Let constructor be the result of parsing the source text
41065+ // constructor(...args) { super (...args);}
41066+ // using the syntactic grammar with the goal symbol MethodDefinition[~Yield].
41067+ // Else,
41068+ // Let constructor be the result of parsing the source text
41069+ // constructor( ){ }
41070+ // using the syntactic grammar with the goal symbol MethodDefinition[~Yield].
41071+ //
41072+ // While we could emit the '...args' rest parameter, certain later tools in the pipeline might
41073+ // downlevel the '...args' portion less efficiently by naively copying the contents of 'arguments' to an array.
41074+ // Instead, we'll avoid using a rest parameter and spread into the super call as
41075+ // 'super(...arguments)' instead of 'super(...args)', as you can see below.
4106141076 write("()");
4106241077 }
4106341078 }
@@ -41092,6 +41107,7 @@ var ts;
4109241107 write("_super.apply(this, arguments);");
4109341108 }
4109441109 else {
41110+ // See comment above on using '...arguments' instead of '...args'.
4109541111 write("super(...arguments);");
4109641112 }
4109741113 emitEnd(baseTypeElement);
@@ -55629,7 +55645,10 @@ var ts;
5562955645 // We are completing on contextual types, but may also include properties
5563055646 // other than those within the declared type.
5563155647 isNewIdentifierLocation = true;
55648+ // If the object literal is being assigned to something of type 'null | { hello: string }',
55649+ // it clearly isn't trying to satisfy the 'null' type. So we grab the non-nullable type if possible.
5563255650 typeForObject = typeChecker.getContextualType(objectLikeContainer);
55651+ typeForObject = typeForObject && typeForObject.getNonNullableType();
5563355652 existingMembers = objectLikeContainer.properties;
5563455653 }
5563555654 else if (objectLikeContainer.kind === 167 /* ObjectBindingPattern */) {
@@ -55640,7 +55659,7 @@ var ts;
5564055659 // We don't want to complete using the type acquired by the shape
5564155660 // of the binding pattern; we are only interested in types acquired
5564255661 // through type declaration or inference.
55643- // Also proceed if rootDeclaration is parameter and if its containing function expression\ arrow function is contextually typed -
55662+ // Also proceed if rootDeclaration is a parameter and if its containing function expression/ arrow function is contextually typed -
5564455663 // type of parameter will flow in from the contextual type of the function
5564555664 var canGetType = !!(rootDeclaration.initializer || rootDeclaration.type);
5564655665 if (!canGetType && rootDeclaration.kind === 142 /* Parameter */) {
0 commit comments