From a85812f688b1a9b70be597bb715490c3290f29aa Mon Sep 17 00:00:00 2001 From: vsavkin Date: Fri, 3 Oct 2014 16:29:59 -0400 Subject: [PATCH] refactor(injector): rename humanize into stringify --- modules/di/src/exceptions.js | 8 ++++---- modules/facade/src/lang.dart | 2 +- modules/facade/src/lang.es6 | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/di/src/exceptions.js b/modules/di/src/exceptions.js index d2bc10bd77..b7537917f9 100644 --- a/modules/di/src/exceptions.js +++ b/modules/di/src/exceptions.js @@ -1,9 +1,9 @@ import {ListWrapper, List} from 'facade/collection'; -import {humanize} from 'facade/lang'; +import {stringify} from 'facade/lang'; function constructResolvingPath(keys: List) { if (keys.length > 1) { - var tokenStrs = ListWrapper.map(keys, (k) => humanize(k.token)); + var tokenStrs = ListWrapper.map(keys, (k) => stringify(k.token)); return " (" + tokenStrs.join(' -> ') + ")"; } else { return ""; @@ -16,7 +16,7 @@ export class NoProviderError extends Error { } _constructResolvingMessage(keys:List) { - var last = humanize(ListWrapper.last(keys).token); + var last = stringify(ListWrapper.last(keys).token); return `No provider for ${last}!${constructResolvingPath(keys)}`; } @@ -31,7 +31,7 @@ export class AsyncProviderError extends Error { } _constructResolvingMessage(keys:List) { - var last = humanize(ListWrapper.last(keys).token); + var last = stringify(ListWrapper.last(keys).token); return `Cannot instantiate ${last} synchronously. ` + `It is provided as a future!${constructResolvingPath(keys)}`; } diff --git a/modules/facade/src/lang.dart b/modules/facade/src/lang.dart index 56126b5796..ef17c7382c 100644 --- a/modules/facade/src/lang.dart +++ b/modules/facade/src/lang.dart @@ -21,7 +21,7 @@ class IMPLEMENTS { bool isPresent(obj) => obj != null; bool isBlank(obj) => obj == null; -String humanize(obj) => obj.toString(); +String stringify(obj) => obj.toString(); class StringWrapper { static String fromCharCode(int code) { diff --git a/modules/facade/src/lang.es6 b/modules/facade/src/lang.es6 index 8f8feb1bc7..bee94c2a9a 100644 --- a/modules/facade/src/lang.es6 +++ b/modules/facade/src/lang.es6 @@ -19,7 +19,7 @@ export function isBlank(obj){ return obj == undefined || obj == null; } -export function humanize(token) { +export function stringify(token) { if (typeof token === 'string') { return token; }