fix(examples): add a couple entrypoints, adjust pubspec, fix change detector bug in Dart

This commit is contained in:
Sigmund Cherem
2015-07-14 16:04:49 -07:00
committed by vsavkin
parent f25e43fab8
commit b03560b670
4 changed files with 71 additions and 12 deletions
@@ -1,4 +1,4 @@
import {isPresent, isBlank} from 'angular2/src/facade/lang';
import {isPresent, isBlank, looseIdentical} from 'angular2/src/facade/lang';
import {List, ListWrapper, Map} from 'angular2/src/facade/collection';
import {RecordType, ProtoRecord} from './proto_record';
@@ -44,11 +44,11 @@ function _selfRecord(r: ProtoRecord, contextIndex: number, selfIndex: number): P
}
function _findMatching(r: ProtoRecord, rs: List<ProtoRecord>) {
return ListWrapper.find(rs, (rr) => rr.mode !== RecordType.DIRECTIVE_LIFECYCLE &&
_sameDirIndex(rr, r) && rr.mode === r.mode &&
rr.funcOrValue === r.funcOrValue &&
rr.contextIndex === r.contextIndex && rr.name === r.name &&
ListWrapper.equals(rr.args, r.args));
return ListWrapper.find(
rs, (rr) => rr.mode !== RecordType.DIRECTIVE_LIFECYCLE && _sameDirIndex(rr, r) &&
rr.mode === r.mode && looseIdentical(rr.funcOrValue, r.funcOrValue) &&
rr.contextIndex === r.contextIndex && looseIdentical(rr.name, r.name) &&
ListWrapper.equals(rr.args, r.args));
}
function _sameDirIndex(a: ProtoRecord, b: ProtoRecord): boolean {
+3 -1
View File
@@ -198,7 +198,9 @@ Error makeTypeError([String message = ""]) {
const _NAN_KEY = const Object();
// Dart can have identical(str1, str2) == false while str1 == str2
// Dart can have identical(str1, str2) == false while str1 == str2. Moreover,
// after compiling with dart2js identical(str1, str2) might return true.
// (see dartbug.com/22496 for details).
bool looseIdentical(a, b) =>
a is String && b is String ? a == b : identical(a, b);