X Tutup
Skip to content

Commit b03560b

Browse files
sigmundchvsavkin
authored andcommitted
fix(examples): add a couple entrypoints, adjust pubspec, fix change detector bug in Dart
1 parent f25e43f commit b03560b

File tree

4 files changed

+69
-10
lines changed

4 files changed

+69
-10
lines changed

modules/angular2/src/change_detection/coalesce.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {isPresent, isBlank} from 'angular2/src/facade/lang';
1+
import {isPresent, isBlank, looseIdentical} from 'angular2/src/facade/lang';
22
import {List, ListWrapper, Map} from 'angular2/src/facade/collection';
33
import {RecordType, ProtoRecord} from './proto_record';
44

@@ -44,11 +44,11 @@ function _selfRecord(r: ProtoRecord, contextIndex: number, selfIndex: number): P
4444
}
4545

4646
function _findMatching(r: ProtoRecord, rs: List<ProtoRecord>) {
47-
return ListWrapper.find(rs, (rr) => rr.mode !== RecordType.DIRECTIVE_LIFECYCLE &&
48-
_sameDirIndex(rr, r) && rr.mode === r.mode &&
49-
rr.funcOrValue === r.funcOrValue &&
50-
rr.contextIndex === r.contextIndex && rr.name === r.name &&
51-
ListWrapper.equals(rr.args, r.args));
47+
return ListWrapper.find(
48+
rs, (rr) => rr.mode !== RecordType.DIRECTIVE_LIFECYCLE && _sameDirIndex(rr, r) &&
49+
rr.mode === r.mode && looseIdentical(rr.funcOrValue, r.funcOrValue) &&
50+
rr.contextIndex === r.contextIndex && looseIdentical(rr.name, r.name) &&
51+
ListWrapper.equals(rr.args, r.args));
5252
}
5353

5454
function _sameDirIndex(a: ProtoRecord, b: ProtoRecord): boolean {

modules/angular2/src/facade/lang.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ Error makeTypeError([String message = ""]) {
198198

199199
const _NAN_KEY = const Object();
200200

201-
// Dart can have identical(str1, str2) == false while str1 == str2
201+
// Dart can have identical(str1, str2) == false while str1 == str2. Moreover,
202+
// after compiling with dart2js identical(str1, str2) might return true.
203+
// (see dartbug.com/22496 for details).
202204
bool looseIdentical(a, b) =>
203205
a is String && b is String ? a == b : identical(a, b);
204206

modules/examples/pubspec.yaml

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,74 @@ dependency_overrides:
1616
path: ../angular2_material
1717
transformers:
1818
- angular2:
19+
$exclude:
1920
# The build currently fails on material files because there is not yet
2021
# support for transforming cross-package urls. (see issue #2982)
21-
$exclude: 'web/src/material/**'
22+
- 'web/src/material/**'
23+
- 'web/src/zippy_component/**'
24+
# No need to transform the dart:mirrors specific entrypoints
25+
- '**/index_dynamic.dart'
2226
entry_points:
23-
- web/src/hello_world/index_common.dart
27+
- web/src/gestures/index.dart
28+
- web/src/hello_world/index.dart
29+
- web/src/http/index.dart
30+
- web/src/key_events/index.dart
31+
- web/src/sourcemap/index.dart
2432
- web/src/todo/index.dart
33+
# These entrypoints are disabled until nested-directives are supported
34+
# by transformers (issue #1747):
35+
# web/src/model_driven_forms/index.dart
36+
# web/src/order_management/index.dart
37+
# web/src/person_management/index.dart
38+
# web/src/template_driven_forms/index.dart
39+
#
40+
# These entrypoints are disabled until cross-package urls are working (issue #2982)
41+
# - web/src/material/button/index.dart
42+
# - web/src/material/checkbox/index.dart
43+
# - web/src/material/dialog/index.dart
44+
# - web/src/material/grid_list/index.dart
45+
# - web/src/material/input/index.dart
46+
# - web/src/material/progress-linear/index.dart
47+
# - web/src/material/radio/index.dart
48+
# - web/src/material/switcher/index.dart
49+
# - web/src/zippy_component/index.dart
50+
#
51+
# This entrypoint is not needed:
52+
# - web/src/material/demo_common.dart
2553
reflection_entry_points:
54+
- web/src/gestures/index.dart
2655
- web/src/hello_world/index.dart
56+
- web/src/http/index.dart
57+
- web/src/key_events/index.dart
58+
- web/src/sourcemap/index.dart
2759
- web/src/todo/index.dart
60+
# These entrypoints are disabled until nested-directives are supported
61+
# by transformers (issue #1747):
62+
# web/src/model_driven_forms/index.dart
63+
# web/src/order_management/index.dart
64+
# web/src/person_management/index.dart
65+
# web/src/template_driven_forms/index.dart
66+
#
67+
# These entrypoints are disabled until cross-package urls are working (issue #2982)
68+
# - web/src/material/button/index.dart
69+
# - web/src/material/checkbox/index.dart
70+
# - web/src/material/dialog/index.dart
71+
# - web/src/material/grid_list/index.dart
72+
# - web/src/material/input/index.dart
73+
# - web/src/material/progress-linear/index.dart
74+
# - web/src/material/radio/index.dart
75+
# - web/src/material/switcher/index.dart
76+
# - web/src/zippy_component/index.dart
77+
#
78+
# This entrypoint is not needed:
79+
# - web/src/material/demo_common.dart
80+
2881
- $dart2js:
2982
minify: false
3083
commandLineOptions:
31-
- --dump-info
3284
- --show-package-warnings
3385
- --trust-type-annotations
3486
- --trust-primitives
3587
- --enable-experimental-mirrors
88+
# Uncomment to generate summaries from dart2js
89+
# - --dump-info

modules/examples/src/sourcemap/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import {BaseException} from 'angular2/src/facade/lang';
22
import {bootstrap, Component, View} from 'angular2/angular2';
3+
import {reflector} from 'angular2/src/reflection/reflection';
4+
import {ReflectionCapabilities} from 'angular2/src/reflection/reflection_capabilities';
35

46
@Component({
57
selector: 'error-app',
@@ -13,5 +15,6 @@ export class ErrorComponent {
1315
}
1416

1517
export function main() {
18+
reflector.reflectionCapabilities = new ReflectionCapabilities(); // for the Dart version
1619
bootstrap(ErrorComponent);
1720
}

0 commit comments

Comments
 (0)
X Tutup