Skip to content

Commit 240957c

Browse files
author
Alex D
committed
fixes
1 parent cc4f3e1 commit 240957c

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

src/emitterlua.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -712,17 +712,14 @@ export class EmitterLua {
712712
}
713713

714714
if (parameters) {
715-
let dotDotDotAny = false;
716715
parameters.forEach(p => {
717716
const paramName = (<ts.Identifier>p.name).text;
718717
if (addThisAsParameter && paramName === 'this') {
718+
addThisAsParameter = false;
719719
return;
720720
}
721721

722722
this.functionContext.createParam(paramName);
723-
if (p.dotDotDotToken) {
724-
dotDotDotAny = true;
725-
}
726723
});
727724
}
728725

test/test.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
function padLeft(value: string, padding: number)
2-
function padLeft(value: string, padding: string)
3-
function padLeft(value: string, padding: any) {
4-
if (typeof padding === "number") {
5-
return String(padding) + value;
6-
}
7-
8-
if (typeof padding === "string") {
9-
return padding + value;
10-
}
11-
12-
throw new Error(`Expected string or number, got \'${padding}\'.`);
13-
}
14-
15-
console.log(padLeft("Hello world", 4));
1+
class StringHelper {
2+
public static getLength(this: string): number {
3+
return string.len(this);
4+
}
5+
}

0 commit comments

Comments
 (0)