You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove redundant alias handling in JS compiler. NFC. (#17420)
This change removes the redundant handling of aliases, leaving the
simpler and more efficient one in place.
With this method the final output contains:
```
var foo = target;
```
Rather than:
```
function foo(arg1, arg2) {
return target(arg1, arg1);
}
```
error(`${aliasSig} (${lib[aliasSig]}) differs from ${targetSig} (${lib[targetSig]})`);
279
-
}
280
-
281
-
constsig=lib[aliasSig]||lib[targetSig];
282
-
if(typeofsig!='string'){
283
-
error(`Function ${x} aliases to target function ${target}, but neither the alias or the target provide a signature. Please add a ${targetSig}: 'vifj...' annotation or a ${aliasSig}: 'vifj...' annotation to describe the type of function forwarding that is needed!`);
284
-
}
285
-
286
-
// If only one of the target or the alias specifies a sig then copy
287
-
// this signature to the other.
288
-
if(!lib[aliasSig]){
289
-
lib[aliasSig]=lib[targetSig];
290
-
}elseif(!lib[targetSig]){
291
-
lib[targetSig]=lib[aliasSig];
292
-
}
293
-
294
-
if(typeoflib[target]!='function'){
295
-
error(`no alias found for ${x}`);
296
-
}
297
-
298
-
constargCount=sig.length-1;
299
-
if(argCount!==lib[target].length){
300
-
error(`incorrect number of arguments in signature of ${x} (declared: ${argCount}, expected: ${lib[target].length})`);
0 commit comments