Skip to content

Commit 826050e

Browse files
author
Stanimir Karoserov
committed
updated camera & console
1 parent db987a3 commit 826050e

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

camera/camera.ios.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ function topViewControllerWithRootViewController(rootViewController: any) {
3636
export var takePicture = function (options?: types.Options): promises.Promise<imageSource.ImageSource> {
3737
var d = promises.defer<imageSource.ImageSource>();
3838

39-
// FIXME: this is done to prevent listener from being freed by JS garbage collector
40-
// we will try to fix this at JS Bridge level
39+
// This is done to prevent listener from being freed by JS garbage collector
4140
var listener;
4241

4342
var ImagePickerControllerListener = Foundation.NSObject.extends({
@@ -49,7 +48,6 @@ export var takePicture = function (options?: types.Options): promises.Promise<im
4948
imagePickerControllerDidFinishPickingMediaWithInfo: function (picker, info) {
5049
console.log('takeImage received');
5150
picker.presentingViewController.dismissViewControllerAnimatedCompletion(true, null);
52-
// FIXME: do not work with listener here
5351
listener = null;
5452
var image = imageSource.fromNativeSource(info.valueForKey(UIKit.UIImagePickerControllerOriginalImage));
5553
d.resolve(image);
@@ -58,7 +56,6 @@ export var takePicture = function (options?: types.Options): promises.Promise<im
5856
imagePickerControllerDidCancel: function (picker) {
5957
console.info('takeImage canceled');
6058
picker.presentingViewController.dismissViewControllerAnimatedCompletion(true, null);
61-
// FIXME: do not work with listener here
6259
listener = null;
6360
d.reject(new Error('takePicture canceled by user'));
6461
}

console/console.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,9 @@ export declare class Console {
6161
* @param obj The object instance to be dumped.
6262
*/
6363
public dump(obj: any): void;
64+
65+
/**
66+
* Prints the state of the specified object to the console.
67+
*/
68+
public dir(obj: any): void;
6469
}

console/console.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,4 +320,6 @@ export class Console {
320320
result.push('=== dump(): finished ===');
321321
this.log(result.join('\n'));
322322
}
323-
}
323+
324+
public dir = this.dump;
325+
}

declarations.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ declare module i {
2020
log(message: any, ...optionalParams: any[]): void;
2121
trace(): void;
2222
dump(obj: any): void;
23+
dir(obj: any): void;
2324
}
2425
}
2526

0 commit comments

Comments
 (0)