mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-12 12:57:11 -06:00
Skip this in emitter in 2 more places
This commit is contained in:
parent
14aa1323f5
commit
5768b42bfa
@ -4571,14 +4571,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
|
||||
function emitRestParameter(node: FunctionLikeDeclaration) {
|
||||
if (languageVersion < ScriptTarget.ES6 && hasDeclaredRestParameter(node)) {
|
||||
const restIndex = node.parameters.length - 1;
|
||||
const restParam = node.parameters[restIndex];
|
||||
const restParam = node.parameters[node.parameters.length - 1];
|
||||
|
||||
// A rest parameter cannot have a binding pattern, so let's just ignore it if it does.
|
||||
if (isBindingPattern(restParam.name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const skipThisCount = node.parameters.length && (<Identifier>node.parameters[0].name).text === "this" ? 1 : 0;
|
||||
const restIndex = node.parameters.length - 1 - skipThisCount;
|
||||
const tempName = createTempVariable(TempFlags._i).text;
|
||||
writeLine();
|
||||
emitLeadingComments(restParam);
|
||||
@ -6156,10 +6157,11 @@ const _super = (function (geti, seti) {
|
||||
|
||||
if (valueDeclaration) {
|
||||
const parameters = valueDeclaration.parameters;
|
||||
const skipThisCount = parameters.length && (<Identifier>parameters[0].name).text === "this" ? 1 : 0;
|
||||
const parameterCount = parameters.length;
|
||||
if (parameterCount > 0) {
|
||||
for (let i = 0; i < parameterCount; i++) {
|
||||
if (i > 0) {
|
||||
if (parameterCount > skipThisCount) {
|
||||
for (let i = skipThisCount; i < parameterCount; i++) {
|
||||
if (i > skipThisCount) {
|
||||
write(", ");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user