File tree Expand file tree Collapse file tree 4 files changed +10
-5
lines changed
Expand file tree Collapse file tree 4 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,7 @@ function topViewControllerWithRootViewController(rootViewController: any) {
3636export 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 }
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments