Skip to content

Commit 9fbcf5f

Browse files
committed
Fix typescript 1.6 compile errors.
- Remove unknown properties in object literals. - Don't use module-level `delete` statements.
1 parent b7c87bb commit 9fbcf5f

File tree

16 files changed

+72
-43
lines changed

16 files changed

+72
-43
lines changed

apps/tests/layouts/dock-layout-tests.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ export function setUpModule() {
5050

5151
export function tearDownModule() {
5252
navHelper.goBack();
53-
delete testPage;
54-
delete rootLayout;
55-
delete tmp;
53+
testPage = null;
54+
rootLayout = null;
55+
tmp = null;
5656
}
5757

5858
export function setUp() {
@@ -212,4 +212,4 @@ export function test_codesnippets() {
212212
dockLayout.addChild(btnDockedToRight);
213213
// ```
214214
// </snippet>
215-
}
215+
}

apps/tests/layouts/grid-layout-tests.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ export function setUpModule() {
5252
export function tearDownModule() {
5353
navHelper.goBack();
5454

55-
delete tmp;
56-
delete newPage;
57-
delete rootLayout;
55+
tmp = null;
56+
newPage = null;
57+
rootLayout = null;
5858
}
5959

6060
export function setUp() {

apps/tests/layouts/stack-layout-tests.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ export function setUpModule() {
2929

3030
export function tearDownModule() {
3131
navHelper.goBack();
32-
delete tmp;
33-
delete newPage;
34-
delete rootLayout;
35-
delete btn1;
36-
delete btn2;
32+
tmp = null;
33+
newPage = null;
34+
rootLayout = null;
35+
btn1 = null;
36+
btn2 = null;
3737
}
3838

3939
export function setUp() {

apps/tests/ui/scroll-view/scroll-view-tests.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ export function setUpModule() {
4949

5050
export function tearDownModule() {
5151
helper.goBack();
52-
delete tmp;
53-
delete newPage;
54-
delete scrollView;
52+
tmp = null;
53+
newPage = null;
54+
scrollView = null;
5555
}
5656

5757
export function setUp() {

apps/tests/ui/style/style-properties-tests.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export function setUpModule() {
2525

2626
export function tearDownModule() {
2727
helper.goBack();
28-
delete testBtn;
29-
delete testPage;
28+
testBtn = null;
29+
testPage = null;
3030
}
3131

3232
export function tearDown() {
@@ -362,4 +362,4 @@ function test_native_font(style: string, weight: string) {
362362
TKUnit.assertEqual((<UIButton>testView.ios).titleLabel.font.fontName.toLowerCase(), (fontName + "-" + fontNameSuffix).toLowerCase(), "native font " + weight + " " + style);
363363
}
364364
//TODO: If needed add tests for other platforms
365-
}
365+
}

data/observable/observable.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ declare module "data/observable" {
9797
* Notifies all the registered listeners for the event provided in the data.eventName.
9898
* @param data The data associated with the event.
9999
*/
100-
notify(data: EventData): void;
100+
notify<T extends EventData>(data: T): void;
101101

102102
/**
103103
* Notifies all the registered listeners for the property change event.
@@ -119,4 +119,4 @@ declare module "data/observable" {
119119
_emit(eventNames: string);
120120
//@endprivate
121121
}
122-
}
122+
}

data/observable/observable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class Observable implements definition.Observable {
118118
this[data.propertyName] = data.value;
119119
}
120120

121-
public notify(data: definition.EventData) {
121+
public notify<T extends definition.EventData>(data: T) {
122122
var observers = this._getEventList(data.eventName);
123123
if (!observers) {
124124
return;
@@ -197,4 +197,4 @@ export class Observable implements definition.Observable {
197197
public toString(): string {
198198
return this.typeName;
199199
}
200-
}
200+
}

ui/animation/animation.ios.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,7 @@ export class Animation extends common.Animation implements definition.Animation
272272
value: Animation._affineTransform(CGAffineTransformIdentity, propertyAnimations[i].property, propertyAnimations[i].value),
273273
duration: propertyAnimations[i].duration,
274274
delay: propertyAnimations[i].delay,
275-
iterations: propertyAnimations[i].iterations,
276-
iosUIViewAnimationCurve: propertyAnimations[i].curve
275+
iterations: propertyAnimations[i].iterations
277276
};
278277
trace.write("Created new transform animation: " + common.Animation._getAnimationInfo(newTransformAnimation), trace.categories.Animation);
279278

@@ -299,4 +298,4 @@ export class Animation extends common.Animation implements definition.Animation
299298

300299
return result;
301300
}
302-
}
301+
}

ui/builder/component-builder.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ export function getComponentModule(elementName: string, namespace: string, attri
101101
}
102102

103103
if (instance && instanceModule) {
104-
var bindings = new Array<bindable.BindingOptions>();
105-
106104
for (var attr in attributes) {
107105

108106
var attrValue = <string>attributes[attr];
@@ -136,7 +134,7 @@ export function getComponentModule(elementName: string, namespace: string, attri
136134
}
137135
}
138136

139-
componentModule = { component: instance, exports: instanceModule, bindings: bindings };
137+
componentModule = {component: instance, exports: instanceModule};
140138
}
141139

142140
return componentModule;

ui/button/button.android.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
global.moduleMerge(common, exports);
44

5+
interface Owned {
6+
owner: any;
7+
}
8+
59
export class Button extends common.Button {
610
private _android: android.widget.Button;
711
private _isPressed: boolean;
@@ -22,7 +26,8 @@ export class Button extends common.Button {
2226

2327
this._android = new android.widget.Button(this._context);
2428

25-
this._android.setOnClickListener(new android.view.View.OnClickListener({
29+
this._android.setOnClickListener(new android.view.View.OnClickListener(
30+
<Owned & android.view.View.IOnClickListener>{
2631
get owner() {
2732
return that.get();
2833
},
@@ -34,4 +39,4 @@ export class Button extends common.Button {
3439
}
3540
}));
3641
}
37-
}
42+
}

0 commit comments

Comments
 (0)