File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -5311,6 +5311,21 @@ const _super = (function (geti, seti) {
53115311 emitSignatureParameters ( ctor ) ;
53125312 }
53135313 else {
5314+ // The ES2015 spec specifies in 14.5.14. Runtime Semantics: ClassDefinitionEvaluation:
5315+ // If constructor is empty, then
5316+ // If ClassHeritag_eopt is present and protoParent is not null, then
5317+ // Let constructor be the result of parsing the source text
5318+ // constructor(...args) { super (...args);}
5319+ // using the syntactic grammar with the goal symbol MethodDefinition[~Yield].
5320+ // Else,
5321+ // Let constructor be the result of parsing the source text
5322+ // constructor( ){ }
5323+ // using the syntactic grammar with the goal symbol MethodDefinition[~Yield].
5324+ //
5325+ // While we could emit the '...args' rest parameter, certain later tools in the pipeline might
5326+ // downlevel the '...args' portion less efficiently by naively copying the contents of 'arguments' to an array.
5327+ // Instead, we'll avoid using a rest parameter and spread into the super call as
5328+ // 'super(...arguments)' instead of 'super(...args)', as you can see below.
53145329 write ( "()" ) ;
53155330 }
53165331 }
@@ -5349,6 +5364,7 @@ const _super = (function (geti, seti) {
53495364 write ( "_super.apply(this, arguments);" ) ;
53505365 }
53515366 else {
5367+ // See comment above on using '...arguments' instead of '...args'.
53525368 write ( "super(...arguments);" ) ;
53535369 }
53545370 emitEnd ( baseTypeElement ) ;
You can’t perform that action at this time.
0 commit comments