cleanup: remove toBool
Since we decided to use the semantics of the host language, toBool is no longer needed.
This commit is contained in:
parent
77aa3ed61b
commit
6bb3b81465
|
@ -11,7 +11,7 @@ import {
|
|||
RECORD_TYPE_PROPERTY
|
||||
} from './record';
|
||||
|
||||
import {FIELD, IMPLEMENTS, isBlank, isPresent, int, toBool, autoConvertAdd, BaseException,
|
||||
import {FIELD, IMPLEMENTS, isBlank, isPresent, int, autoConvertAdd, BaseException,
|
||||
NumberWrapper} from 'facade/lang';
|
||||
import {List, Map, ListWrapper, MapWrapper, StringMapWrapper} from 'facade/collection';
|
||||
import {ContextWithVariableBindings} from './parser/context_with_variable_bindings';
|
||||
|
|
|
@ -27,11 +27,6 @@ class IMPLEMENTS {
|
|||
|
||||
bool isPresent(obj) => obj != null;
|
||||
bool isBlank(obj) => obj == null;
|
||||
bool toBool(x) {
|
||||
if (x is bool) return x;
|
||||
if (x is num) return x != 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
String stringify(obj) => obj.toString();
|
||||
|
||||
|
|
|
@ -27,10 +27,6 @@ export function isBlank(obj):boolean {
|
|||
return obj === undefined || obj === null;
|
||||
}
|
||||
|
||||
export function toBool(obj) {
|
||||
return !!obj;
|
||||
}
|
||||
|
||||
export function stringify(token):string {
|
||||
if (typeof token === 'string') {
|
||||
return token;
|
||||
|
|
Loading…
Reference in New Issue