mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
18 lines
488 B
TypeScript
18 lines
488 B
TypeScript
//// [tests/cases/compiler/emitSkipsThisWithRestParameter.ts] ////
|
|
|
|
//// [emitSkipsThisWithRestParameter.ts]
|
|
function rebase(fn: (base: any, ...args: any[]) => any): (...args: any[]) => any {
|
|
return function(this: any, ...args: any[]) {
|
|
return fn.apply(this, [ this ].concat(args));
|
|
};
|
|
}
|
|
|
|
|
|
//// [emitSkipsThisWithRestParameter.js]
|
|
"use strict";
|
|
function rebase(fn) {
|
|
return function (...args) {
|
|
return fn.apply(this, [this].concat(args));
|
|
};
|
|
}
|