From ccb41632c7927d787ed3948d8527d2a30fdd2976 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Mon, 13 Jul 2015 14:22:43 -0700 Subject: [PATCH] feat(facade): add getTypeNameForDebugging function --- modules/angular2/src/facade/lang.dart | 2 ++ modules/angular2/src/facade/lang.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/modules/angular2/src/facade/lang.dart b/modules/angular2/src/facade/lang.dart index 7f64937600..4ed795451e 100644 --- a/modules/angular2/src/facade/lang.dart +++ b/modules/angular2/src/facade/lang.dart @@ -5,6 +5,8 @@ import 'dart:math' as math; import 'dart:convert' as convert; import 'dart:async' show Future; +String getTypeNameForDebugging(Type type) => type.toString(); + class Math { static final _random = new math.Random(); static int floor(num n) => n.floor(); diff --git a/modules/angular2/src/facade/lang.ts b/modules/angular2/src/facade/lang.ts index 03402316cf..d99cd9a206 100644 --- a/modules/angular2/src/facade/lang.ts +++ b/modules/angular2/src/facade/lang.ts @@ -5,6 +5,10 @@ export {_global as global}; export var Type = Function; export type Type = new (...args: any[]) => any; +export function getTypeNameForDebugging(type: Type): string { + return type['name']; +} + export class BaseException extends Error { stack; constructor(public message?: string, public originalException?, public originalStack?) {