Skip to content

Commit 6bb3b81

Browse files
committed
cleanup: remove toBool
Since we decided to use the semantics of the host language, toBool is no longer needed.
1 parent 77aa3ed commit 6bb3b81

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

modules/change_detection/src/record_range.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
RECORD_TYPE_PROPERTY
1212
} from './record';
1313

14-
import {FIELD, IMPLEMENTS, isBlank, isPresent, int, toBool, autoConvertAdd, BaseException,
14+
import {FIELD, IMPLEMENTS, isBlank, isPresent, int, autoConvertAdd, BaseException,
1515
NumberWrapper} from 'facade/lang';
1616
import {List, Map, ListWrapper, MapWrapper, StringMapWrapper} from 'facade/collection';
1717
import {ContextWithVariableBindings} from './parser/context_with_variable_bindings';

modules/facade/src/lang.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ class IMPLEMENTS {
2727

2828
bool isPresent(obj) => obj != null;
2929
bool isBlank(obj) => obj == null;
30-
bool toBool(x) {
31-
if (x is bool) return x;
32-
if (x is num) return x != 0;
33-
return false;
34-
}
3530

3631
String stringify(obj) => obj.toString();
3732

modules/facade/src/lang.es6

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ export function isBlank(obj):boolean {
2727
return obj === undefined || obj === null;
2828
}
2929

30-
export function toBool(obj) {
31-
return !!obj;
32-
}
33-
3430
export function stringify(token):string {
3531
if (typeof token === 'string') {
3632
return token;

0 commit comments

Comments
 (0)