style(dart): Run dartfmt v0.1.8+2 on all pure Dart code

Update formatting for all pure Dart code in the repo.
This commit is contained in:
Tim Blasi 2015-07-27 17:26:28 -07:00
parent 6fac901151
commit 2c9951273a
63 changed files with 406 additions and 273 deletions

View File

@ -15,8 +15,7 @@ export 'package:angular2/src/change_detection/directive_record.dart'
show DirectiveIndex, DirectiveRecord; show DirectiveIndex, DirectiveRecord;
export 'package:angular2/src/change_detection/interfaces.dart' export 'package:angular2/src/change_detection/interfaces.dart'
show ChangeDetector, ChangeDetectorDefinition, ProtoChangeDetector; show ChangeDetector, ChangeDetectorDefinition, ProtoChangeDetector;
export 'package:angular2/src/change_detection/pipes/pipes.dart' export 'package:angular2/src/change_detection/pipes/pipes.dart' show Pipes;
show Pipes;
export 'package:angular2/src/change_detection/proto_record.dart' export 'package:angular2/src/change_detection/proto_record.dart'
show ProtoRecord; show ProtoRecord;
export 'package:angular2/src/change_detection/change_detection_util.dart' export 'package:angular2/src/change_detection/change_detection_util.dart'
@ -27,8 +26,7 @@ typedef ProtoChangeDetector PregenProtoChangeDetectorFactory(
ChangeDetectorDefinition definition); ChangeDetectorDefinition definition);
typedef ChangeDetector InstantiateMethod(dynamic dispatcher, typedef ChangeDetector InstantiateMethod(dynamic dispatcher,
List<ProtoRecord> protoRecords, List<ProtoRecord> protoRecords, List<DirectiveRecord> directiveRecords);
List<DirectiveRecord> directiveRecords);
/// Implementation of [ProtoChangeDetector] for use by pre-generated change /// Implementation of [ProtoChangeDetector] for use by pre-generated change
/// detectors in Angular 2 Dart. /// detectors in Angular 2 Dart.
@ -52,19 +50,19 @@ class PregenProtoChangeDetector extends ProtoChangeDetector {
static bool isSupported() => true; static bool isSupported() => true;
factory PregenProtoChangeDetector(InstantiateMethod instantiateMethod, factory PregenProtoChangeDetector(
ChangeDetectorDefinition def) { InstantiateMethod instantiateMethod, ChangeDetectorDefinition def) {
// TODO(kegluneq): Pre-generate these (#2067). // TODO(kegluneq): Pre-generate these (#2067).
var recordBuilder = new ProtoRecordBuilder(); var recordBuilder = new ProtoRecordBuilder();
def.bindingRecords.forEach((b) { def.bindingRecords.forEach((b) {
recordBuilder.add(b, def.variableNames); recordBuilder.add(b, def.variableNames);
}); });
var protoRecords = coalesce(recordBuilder.records); var protoRecords = coalesce(recordBuilder.records);
return new PregenProtoChangeDetector._(def.id, instantiateMethod, return new PregenProtoChangeDetector._(
protoRecords, def.directiveRecords); def.id, instantiateMethod, protoRecords, def.directiveRecords);
} }
@override @override
instantiate(dynamic dispatcher) => _instantiateMethod( instantiate(dynamic dispatcher) =>
dispatcher, _protoRecords, _directiveRecords); _instantiateMethod(dispatcher, _protoRecords, _directiveRecords);
} }

View File

@ -3,7 +3,8 @@ library angular2.application;
import 'dart:async'; import 'dart:async';
import 'package:angular2/src/reflection/reflection.dart' show reflector; import 'package:angular2/src/reflection/reflection.dart' show reflector;
import 'package:angular2/src/reflection/reflection_capabilities.dart' show ReflectionCapabilities; import 'package:angular2/src/reflection/reflection_capabilities.dart'
show ReflectionCapabilities;
import 'application_common.dart'; import 'application_common.dart';
export 'application_common.dart' show ApplicationRef; export 'application_common.dart' show ApplicationRef;

View File

@ -6,8 +6,7 @@ import 'application_common.dart';
/// Starts an application from a root component. /// Starts an application from a root component.
/// ///
/// See [commonBootstrap] for detailed documentation. /// See [commonBootstrap] for detailed documentation.
Future<ApplicationRef> bootstrapStatic( Future<ApplicationRef> bootstrapStatic(Type appComponentType,
Type appComponentType,
[List componentInjectableBindings]) { [List componentInjectableBindings]) {
return commonBootstrap(appComponentType, componentInjectableBindings); return commonBootstrap(appComponentType, componentInjectableBindings);
} }

View File

@ -10,7 +10,8 @@ import './interface_query.dart';
* In the future this class will implement an Observable interface. * In the future this class will implement an Observable interface.
* For now it uses a plain list of observable callbacks. * For now it uses a plain list of observable callbacks.
*/ */
class QueryList<T> extends Object with IterableMixin<T> implements IQueryList<T> { class QueryList<T> extends Object with IterableMixin<T>
implements IQueryList<T> {
List<T> _results = []; List<T> _results = [];
List _callbacks = []; List _callbacks = [];
bool _dirty = false; bool _dirty = false;

View File

@ -11,7 +11,6 @@ typedef void ErrorHandlingFn(error, stackTrace);
* is cancelled. * is cancelled.
*/ */
class WrappedTimer implements Timer { class WrappedTimer implements Timer {
Timer _timer; Timer _timer;
ZeroArgFunction _onCancelCb; ZeroArgFunction _onCancelCb;
@ -124,7 +123,8 @@ class NgZone {
* *
* This hook is useful for validating application state (e.g. in a test). * This hook is useful for validating application state (e.g. in a test).
*/ */
void overrideOnEventDone(ZeroArgFunction onEventDoneFn, [bool waitForAsync = false]) { void overrideOnEventDone(ZeroArgFunction onEventDoneFn,
[bool waitForAsync = false]) {
_onEventDone = onEventDoneFn; _onEventDone = onEventDoneFn;
if (waitForAsync) { if (waitForAsync) {
@ -264,7 +264,8 @@ class NgZone {
} }
} }
Timer _createTimer(Zone self, ZoneDelegate parent, Zone zone, Duration duration, fn()) { Timer _createTimer(
Zone self, ZoneDelegate parent, Zone zone, Duration duration, fn()) {
WrappedTimer wrappedTimer; WrappedTimer wrappedTimer;
var cb = () { var cb = () {
fn(); fn();

View File

@ -7,40 +7,40 @@ export 'metadata.dart';
* {@link InjectMetadata}. * {@link InjectMetadata}.
*/ */
class Inject extends InjectMetadata { class Inject extends InjectMetadata {
const Inject(dynamic token): super(token); const Inject(dynamic token) : super(token);
} }
/** /**
* {@link OptionalMetadata}. * {@link OptionalMetadata}.
*/ */
class Optional extends OptionalMetadata { class Optional extends OptionalMetadata {
const Optional(): super(); const Optional() : super();
} }
/** /**
* {@link InjectableMetadata}. * {@link InjectableMetadata}.
*/ */
class Injectable extends InjectableMetadata { class Injectable extends InjectableMetadata {
const Injectable(): super(); const Injectable() : super();
} }
/** /**
* {@link SelfMetadata}. * {@link SelfMetadata}.
*/ */
class Self extends SelfMetadata { class Self extends SelfMetadata {
const Self(): super(); const Self() : super();
} }
/** /**
* {@link AncestorMetadata}. * {@link AncestorMetadata}.
*/ */
class Ancestor extends AncestorMetadata { class Ancestor extends AncestorMetadata {
const Ancestor({bool self}): super(self:self); const Ancestor({bool self}) : super(self: self);
} }
/** /**
* {@link UnboundedMetadata}. * {@link UnboundedMetadata}.
*/ */
class Unbounded extends UnboundedMetadata { class Unbounded extends UnboundedMetadata {
const Unbounded({bool self}): super(self:self); const Unbounded({bool self}) : super(self: self);
} }

View File

@ -41,16 +41,16 @@ class ObservableListDiff extends IterableChanges {
_updated = false; _updated = false;
return super.transform(collection, args); return super.transform(collection, args);
// An update has been registered since the last change detection check. // An update has been registered since the last change detection check.
// - We reset the flag. // - We reset the flag.
// - We diff the collection. // - We diff the collection.
} else if (_updated){ } else if (_updated) {
_updated = false; _updated = false;
return super.transform(collection, args); return super.transform(collection, args);
// No updates has been registered. // No updates has been registered.
// Returning this tells change detection that object has not change, // Returning this tells change detection that object has not change,
// so it should NOT update the binding. // so it should NOT update the binding.
} else { } else {
return this; return this;
} }

View File

@ -392,7 +392,6 @@ class BrowserDomAdapter extends GenericBrowserDomAdapter {
} }
} }
var baseElement = null; var baseElement = null;
String getBaseElementHref() { String getBaseElementHref() {
if (baseElement == null) { if (baseElement == null) {

View File

@ -17,20 +17,25 @@ class Html5LibDomAdapter implements DomAdapter {
return true; return true;
} }
void setProperty(Element element, String name, Object value) => throw 'not implemented'; void setProperty(Element element, String name, Object value) =>
throw 'not implemented';
getProperty(Element element, String name) => throw 'not implemented'; getProperty(Element element, String name) => throw 'not implemented';
invoke(Element element, String methodName, List args) => throw 'not implemented'; invoke(Element element, String methodName, List args) =>
throw 'not implemented';
logError(error) { logError(error) {
stderr.writeln('${error}'); stderr.writeln('${error}');
} }
log(error) { stdout.writeln('${error}'); } log(error) {
logGroup(error) { stdout.writeln('${error}'); } stdout.writeln('${error}');
logGroupEnd() { } }
logGroup(error) {
stdout.writeln('${error}');
}
logGroupEnd() {}
@override @override
final attrToPropMap = const { final attrToPropMap = const {
@ -245,8 +250,8 @@ class Html5LibDomAdapter implements DomAdapter {
} }
getAttribute(element, String attribute) { getAttribute(element, String attribute) {
// `attributes` keys can be {@link AttributeName}s. // `attributes` keys can be {@link AttributeName}s.
var key = element.attributes.keys.firstWhere( var key = element.attributes.keys.firstWhere((key) => '$key' == attribute,
(key) => '$key' == attribute, orElse: () {}); orElse: () {});
return element.attributes[key]; return element.attributes[key];
} }
setAttribute(element, String name, String value) { setAttribute(element, String name, String value) {

View File

@ -29,7 +29,8 @@ class PromiseWrapper {
return promise.catchError(onError); return promise.catchError(onError);
} }
static PromiseCompleter<dynamic> completer() => new PromiseCompleter(new Completer()); static PromiseCompleter<dynamic> completer() =>
new PromiseCompleter(new Completer());
} }
class TimerWrapper { class TimerWrapper {

View File

@ -4,18 +4,12 @@ import 'package:intl/intl.dart';
String _normalizeLocale(String locale) => locale.replaceAll('-', '_'); String _normalizeLocale(String locale) => locale.replaceAll('-', '_');
enum NumberFormatStyle { enum NumberFormatStyle { DECIMAL, PERCENT, CURRENCY }
DECIMAL,
PERCENT,
CURRENCY
}
class NumberFormatter { class NumberFormatter {
static String format(num number, String locale, NumberFormatStyle style, static String format(num number, String locale, NumberFormatStyle style,
{int minimumIntegerDigits: 1, {int minimumIntegerDigits: 1, int minimumFractionDigits: 0,
int minimumFractionDigits: 0, int maximumFractionDigits: 3, String currency,
int maximumFractionDigits: 3,
String currency,
bool currencyAsSymbol: false}) { bool currencyAsSymbol: false}) {
locale = _normalizeLocale(locale); locale = _normalizeLocale(locale);
NumberFormat formatter; NumberFormat formatter;
@ -29,7 +23,8 @@ class NumberFormatter {
case NumberFormatStyle.CURRENCY: case NumberFormatStyle.CURRENCY:
if (currencyAsSymbol) { if (currencyAsSymbol) {
// See https://github.com/dart-lang/intl/issues/59. // See https://github.com/dart-lang/intl/issues/59.
throw new Exception('Displaying currency as symbol is not supported.'); throw new Exception(
'Displaying currency as symbol is not supported.');
} }
formatter = new NumberFormat.currencyPattern(locale, currency); formatter = new NumberFormat.currencyPattern(locale, currency);
break; break;

View File

@ -201,7 +201,8 @@ class BaseException extends Error {
final originalException; final originalException;
final originalStack; final originalStack;
BaseException([this.message, this.originalException, this.originalStack, this.context]); BaseException(
[this.message, this.originalException, this.originalStack, this.context]);
String toString() { String toString() {
return this.message; return this.message;

View File

@ -1,4 +1,5 @@
library angular2.src.http.backends.browser_jsonp; library angular2.src.http.backends.browser_jsonp;
import 'package:angular2/di.dart'; import 'package:angular2/di.dart';
import 'dart:html' show document; import 'dart:html' show document;
import 'dart:js' show context, JsObject, JsArray; import 'dart:js' show context, JsObject, JsArray;
@ -50,7 +51,9 @@ class BrowserJsonp {
} }
// Attach the <script> element to the DOM // Attach the <script> element to the DOM
send(dynamic node) { document.body.append(node); } send(dynamic node) {
document.body.append(node);
}
// Remove <script> element from the DOM // Remove <script> element from the DOM
cleanup(dynamic node) { cleanup(dynamic node) {

View File

@ -5,7 +5,7 @@ import 'package:angular2/di.dart';
@Injectable() @Injectable()
class BrowserXhr { class BrowserXhr {
HttpRequest build() { HttpRequest build() {
return new HttpRequest(); return new HttpRequest();
} }
} }

View File

@ -1,4 +1,5 @@
library angular2.src.http.http_utils; library angular2.src.http.http_utils;
import 'dart:js' show JsObject; import 'dart:js' show JsObject;
import 'dart:collection' show LinkedHashMap, LinkedHashSet; import 'dart:collection' show LinkedHashMap, LinkedHashSet;

View File

@ -49,37 +49,188 @@ class ReflectionCapabilities implements PlatformReflectionCapabilities {
return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) => return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) =>
create(name, [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10]).reflectee; create(name, [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10]).reflectee;
case 11: case 11:
return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) => return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) => create(
create(name, [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11]).reflectee; name, [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11]).reflectee;
case 12: case 12:
return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) => return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) => create(
create(name, [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12]).reflectee; name, [
a1,
a2,
a3,
a4,
a5,
a6,
a7,
a8,
a9,
a10,
a11,
a12
]).reflectee;
case 13: case 13:
return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) => return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) =>
create(name, [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13]).reflectee; create(name, [
a1,
a2,
a3,
a4,
a5,
a6,
a7,
a8,
a9,
a10,
a11,
a12,
a13
]).reflectee;
case 14: case 14:
return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) => return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) =>
create(name, [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14]).reflectee; create(name, [
a1,
a2,
a3,
a4,
a5,
a6,
a7,
a8,
a9,
a10,
a11,
a12,
a13,
a14
]).reflectee;
case 15: case 15:
return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) => return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,
create(name, [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15]).reflectee; a15) => create(name, [
a1,
a2,
a3,
a4,
a5,
a6,
a7,
a8,
a9,
a10,
a11,
a12,
a13,
a14,
a15
]).reflectee;
case 16: case 16:
return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) => return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,
create(name, [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16]).reflectee; a15, a16) => create(name, [
a1,
a2,
a3,
a4,
a5,
a6,
a7,
a8,
a9,
a10,
a11,
a12,
a13,
a14,
a15,
a16
]).reflectee;
case 17: case 17:
return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) => return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,
create(name, [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17]).reflectee; a15, a16, a17) => create(name, [
a1,
a2,
a3,
a4,
a5,
a6,
a7,
a8,
a9,
a10,
a11,
a12,
a13,
a14,
a15,
a16,
a17
]).reflectee;
case 18: case 18:
return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) => return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,
create(name, [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18]).reflectee; a15, a16, a17, a18) => create(name, [
a1,
a2,
a3,
a4,
a5,
a6,
a7,
a8,
a9,
a10,
a11,
a12,
a13,
a14,
a15,
a16,
a17,
a18
]).reflectee;
case 19: case 19:
return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) => return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,
create(name, [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19]). a15, a16, a17, a18, a19) => create(name, [
reflectee; a1,
a2,
a3,
a4,
a5,
a6,
a7,
a8,
a9,
a10,
a11,
a12,
a13,
a14,
a15,
a16,
a17,
a18,
a19
]).reflectee;
case 20: case 20:
return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) => return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,
create(name, [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20]). a15, a16, a17, a18, a19, a20) => create(name, [
reflectee; a1,
a2,
a3,
a4,
a5,
a6,
a7,
a8,
a9,
a10,
a11,
a12,
a13,
a14,
a15,
a16,
a17,
a18,
a19,
a20
]).reflectee;
} }
throw "Cannot create a factory for '${stringify(type)}' because its constructor has more than 20 arguments"; throw "Cannot create a factory for '${stringify(type)}' because its constructor has more than 20 arguments";

View File

@ -101,7 +101,8 @@ class Expect extends gns.Expect {
void toThrowErrorWith(message) => expectException(this.actual, message); void toThrowErrorWith(message) => expectException(this.actual, message);
void toBePromise() => gns.guinness.matchers.toBeTrue(actual is Future); void toBePromise() => gns.guinness.matchers.toBeTrue(actual is Future);
void toImplement(expected) => toBeA(expected); void toImplement(expected) => toBeA(expected);
void toBeNaN() => gns.guinness.matchers.toBeTrue(double.NAN.compareTo(actual) == 0); void toBeNaN() =>
gns.guinness.matchers.toBeTrue(double.NAN.compareTo(actual) == 0);
void toHaveText(expected) => _expect(elementText(actual), expected); void toHaveText(expected) => _expect(elementText(actual), expected);
void toHaveBeenCalledWith([a = _u, b = _u, c = _u, d = _u, e = _u, f = _u]) => void toHaveBeenCalledWith([a = _u, b = _u, c = _u, d = _u, e = _u, f = _u]) =>
_expect(_argsMatch(actual, a, b, c, d, e, f), true, _expect(_argsMatch(actual, a, b, c, d, e, f), true,

View File

@ -78,7 +78,8 @@ class _CodegenState {
_CodegenState._(this._changeDetectorDefId, this._contextTypeName, _CodegenState._(this._changeDetectorDefId, this._contextTypeName,
this._changeDetectorTypeName, String changeDetectionStrategy, this._changeDetectorTypeName, String changeDetectionStrategy,
List<ProtoRecord> records, List<DirectiveRecord> directiveRecords, this._generateCheckNoChanges) List<ProtoRecord> records, List<DirectiveRecord> directiveRecords,
this._generateCheckNoChanges)
: _records = records, : _records = records,
_directiveRecords = directiveRecords, _directiveRecords = directiveRecords,
_names = new CodegenNameUtil(records, directiveRecords, '_', _UTIL), _names = new CodegenNameUtil(records, directiveRecords, '_', _UTIL),
@ -92,7 +93,8 @@ class _CodegenState {
.forEach((rec) => protoRecords.add(rec, def.variableNames)); .forEach((rec) => protoRecords.add(rec, def.variableNames));
var records = coalesce(protoRecords.records); var records = coalesce(protoRecords.records);
return new _CodegenState._(def.id, typeName, changeDetectorTypeName, return new _CodegenState._(def.id, typeName, changeDetectorTypeName,
def.strategy, records, def.directiveRecords, def.generateCheckNoChanges); def.strategy, records, def.directiveRecords,
def.generateCheckNoChanges);
} }
void _writeToBuf(StringBuffer buf) { void _writeToBuf(StringBuffer buf) {

View File

@ -5,8 +5,7 @@ import 'dart:async';
import 'dart:core'; import 'dart:core';
import 'package:angular2/src/web-workers/shared/message_bus.dart' import 'package:angular2/src/web-workers/shared/message_bus.dart'
show MessageBus, MessageBusSink, MessageBusSource; show MessageBus, MessageBusSink, MessageBusSource;
import 'package:angular2/src/web-workers/ui/impl.dart' import 'package:angular2/src/web-workers/ui/impl.dart' show bootstrapUICommon;
show bootstrapUICommon;
/** /**
* Bootstrapping a WebWorker * Bootstrapping a WebWorker
@ -23,7 +22,7 @@ void bootstrap(String uri) {
/** /**
* To be called from the main thread to spawn and communicate with the worker thread * To be called from the main thread to spawn and communicate with the worker thread
*/ */
Future<UIMessageBus> spawnWorker(Uri uri){ Future<UIMessageBus> spawnWorker(Uri uri) {
var receivePort = new ReceivePort(); var receivePort = new ReceivePort();
var isolateEndSendPort = receivePort.sendPort; var isolateEndSendPort = receivePort.sendPort;
return Isolate.spawnUri(uri, const [], isolateEndSendPort).then((_) { return Isolate.spawnUri(uri, const [], isolateEndSendPort).then((_) {
@ -57,7 +56,8 @@ class UIMessageBusSink extends MessageBusSink {
class UIMessageBusSource extends MessageBusSource { class UIMessageBusSource extends MessageBusSource {
final ReceivePort _port; final ReceivePort _port;
final Stream rawDataStream; final Stream rawDataStream;
Map<int, StreamSubscription> _listenerStore = new Map<int, StreamSubscription>(); Map<int, StreamSubscription> _listenerStore =
new Map<int, StreamSubscription>();
int _numListeners = 0; int _numListeners = 0;
UIMessageBusSource(ReceivePort port) UIMessageBusSource(ReceivePort port)
@ -68,8 +68,8 @@ class UIMessageBusSource extends MessageBusSource {
return message is SendPort; return message is SendPort;
}); });
int addListener(Function fn){ int addListener(Function fn) {
var subscription = rawDataStream.listen((message){ var subscription = rawDataStream.listen((message) {
fn({"data": message}); fn({"data": message});
}); });
@ -77,7 +77,7 @@ class UIMessageBusSource extends MessageBusSource {
return _numListeners; return _numListeners;
} }
void removeListener(int index){ void removeListener(int index) {
_listenerStore[index].cancel(); _listenerStore[index].cancel();
_listenerStore.remove(index); _listenerStore.remove(index);
} }

View File

@ -3,7 +3,7 @@ library angular2.src.web_workers.worker;
import "package:angular2/src/web-workers/shared/message_bus.dart" import "package:angular2/src/web-workers/shared/message_bus.dart"
show MessageBus, MessageBusSource, MessageBusSink; show MessageBus, MessageBusSource, MessageBusSink;
import "package:angular2/src/web-workers/worker/application_common.dart" import "package:angular2/src/web-workers/worker/application_common.dart"
show bootstrapWebworkerCommon; show bootstrapWebworkerCommon;
import "package:angular2/src/facade/async.dart" show Future; import "package:angular2/src/facade/async.dart" show Future;
import "package:angular2/src/core/application.dart" show ApplicationRef; import "package:angular2/src/core/application.dart" show ApplicationRef;
import "package:angular2/src/facade/lang.dart" show Type, BaseException; import "package:angular2/src/facade/lang.dart" show Type, BaseException;
@ -27,8 +27,8 @@ Future<ApplicationRef> bootstrapWebworker(
[List<dynamic> componentInjectableBindings = null]) { [List<dynamic> componentInjectableBindings = null]) {
ReceivePort rPort = new ReceivePort(); ReceivePort rPort = new ReceivePort();
WorkerMessageBus bus = new WorkerMessageBus.fromPorts(replyTo, rPort); WorkerMessageBus bus = new WorkerMessageBus.fromPorts(replyTo, rPort);
return bootstrapWebworkerCommon(appComponentType, bus, return bootstrapWebworkerCommon(
componentInjectableBindings); appComponentType, bus, componentInjectableBindings);
} }
class WorkerMessageBus extends MessageBus { class WorkerMessageBus extends MessageBus {
@ -57,15 +57,16 @@ class WorkerMessageBusSink extends MessageBusSink {
class WorkerMessageBusSource extends MessageBusSource { class WorkerMessageBusSource extends MessageBusSource {
final ReceivePort _port; final ReceivePort _port;
final Stream rawDataStream; final Stream rawDataStream;
Map<int, StreamSubscription> _listenerStore = new Map<int, StreamSubscription>(); Map<int, StreamSubscription> _listenerStore =
new Map<int, StreamSubscription>();
int _numListeners = 0; int _numListeners = 0;
WorkerMessageBusSource(ReceivePort rPort) WorkerMessageBusSource(ReceivePort rPort)
: _port = rPort, : _port = rPort,
rawDataStream = rPort.asBroadcastStream(); rawDataStream = rPort.asBroadcastStream();
int addListener(Function fn){ int addListener(Function fn) {
var subscription = rawDataStream.listen((message){ var subscription = rawDataStream.listen((message) {
fn({"data": message}); fn({"data": message});
}); });
@ -73,7 +74,7 @@ class WorkerMessageBusSource extends MessageBusSource {
return _numListeners; return _numListeners;
} }
void removeListener(int index){ void removeListener(int index) {
_listenerStore[index].cancel(); _listenerStore[index].cancel();
_listenerStore.remove(index); _listenerStore.remove(index);
} }

View File

@ -18,8 +18,8 @@ main() {
}); });
it("should be true when the lifecycle includes onChange", () { it("should be true when the lifecycle includes onChange", () {
expect(metadata(DirectiveNoHooks, expect(metadata(DirectiveNoHooks, new Directive(
new Directive(lifecycle: [LifecycleEvent.onChange])).callOnChange).toBe(true); lifecycle: [LifecycleEvent.onChange])).callOnChange).toBe(true);
}); });
it("should be false otherwise", () { it("should be false otherwise", () {
@ -40,8 +40,8 @@ main() {
}); });
it("should be true when the lifecycle includes onDestroy", () { it("should be true when the lifecycle includes onDestroy", () {
expect(metadata(DirectiveNoHooks, expect(metadata(DirectiveNoHooks, new Directive(
new Directive(lifecycle: [LifecycleEvent.onDestroy])).callOnDestroy).toBe(true); lifecycle: [LifecycleEvent.onDestroy])).callOnDestroy).toBe(true);
}); });
it("should be false otherwise", () { it("should be false otherwise", () {
@ -58,8 +58,8 @@ main() {
}); });
it("should be true when the lifecycle includes onCheck", () { it("should be true when the lifecycle includes onCheck", () {
expect(metadata(DirectiveNoHooks, expect(metadata(DirectiveNoHooks, new Directive(
new Directive(lifecycle: [LifecycleEvent.onCheck])).callOnCheck).toBe(true); lifecycle: [LifecycleEvent.onCheck])).callOnCheck).toBe(true);
}); });
it("should be false otherwise", () { it("should be false otherwise", () {
@ -77,7 +77,8 @@ main() {
it("should be true when the lifecycle includes onInit", () { it("should be true when the lifecycle includes onInit", () {
expect(metadata(DirectiveNoHooks, expect(metadata(DirectiveNoHooks,
new Directive(lifecycle: [LifecycleEvent.onInit])).callOnInit).toBe(true); new Directive(lifecycle: [LifecycleEvent.onInit])).callOnInit)
.toBe(true);
}); });
it("should be false otherwise", () { it("should be false otherwise", () {
@ -94,7 +95,9 @@ main() {
it("should be true when the lifecycle includes onAllChangesDone", () { it("should be true when the lifecycle includes onAllChangesDone", () {
expect(metadata(DirectiveNoHooks, new Directive( expect(metadata(DirectiveNoHooks, new Directive(
lifecycle: [LifecycleEvent.onAllChangesDone])).callOnAllChangesDone).toBe(true); lifecycle: [
LifecycleEvent.onAllChangesDone
])).callOnAllChangesDone).toBe(true);
}); });
it("should be false otherwise", () { it("should be false otherwise", () {

View File

@ -45,13 +45,15 @@ main() {
TestComponentBuilder, TestComponentBuilder,
AsyncTestCompleter AsyncTestCompleter
], (tb, async) { ], (tb, async) {
tb.overrideView(Dummy, new View( tb
template: '<type-literal-component></type-literal-component>', .overrideView(Dummy, new View(
directives: [TypeLiteralComponent])) template: '<type-literal-component></type-literal-component>',
directives: [TypeLiteralComponent]))
.createAsync(Dummy).then((tc) { .createAsync(Dummy)
.then((tc) {
tc.detectChanges(); tc.detectChanges();
expect(asNativeElements(tc.componentViewChildren)).toHaveText('[Hello, World]'); expect(asNativeElements(tc.componentViewChildren))
.toHaveText('[Hello, World]');
async.done(); async.done();
}); });
})); }));
@ -62,11 +64,12 @@ main() {
TestComponentBuilder, TestComponentBuilder,
AsyncTestCompleter AsyncTestCompleter
], (tb, async) { ], (tb, async) {
tb.overrideView(Dummy, new View( tb
template: '<throwing-component></throwing-component>', .overrideView(Dummy, new View(
directives: [ThrowingComponent])) template: '<throwing-component></throwing-component>',
directives: [ThrowingComponent]))
.createAsync(Dummy).catchError((e, stack) { .createAsync(Dummy)
.catchError((e, stack) {
expect(e).toContainError("MockException"); expect(e).toContainError("MockException");
expect(e).toContainError("functionThatThrows"); expect(e).toContainError("functionThatThrows");
async.done(); async.done();
@ -77,11 +80,12 @@ main() {
TestComponentBuilder, TestComponentBuilder,
AsyncTestCompleter AsyncTestCompleter
], (tb, async) { ], (tb, async) {
tb.overrideView(Dummy, new View( tb
template: '<throwing-component2></throwing-component2>', .overrideView(Dummy, new View(
directives: [ThrowingComponent2])) template: '<throwing-component2></throwing-component2>',
directives: [ThrowingComponent2]))
.createAsync(Dummy).catchError((e, stack) { .createAsync(Dummy)
.catchError((e, stack) {
expect(e).toContainError("NonError"); expect(e).toContainError("NonError");
expect(e).toContainError("functionThatThrows"); expect(e).toContainError("functionThatThrows");
async.done(); async.done();
@ -94,13 +98,15 @@ main() {
TestComponentBuilder, TestComponentBuilder,
AsyncTestCompleter AsyncTestCompleter
], (tb, async) { ], (tb, async) {
tb.overrideView(Dummy, new View( tb
template: '<property-access></property-access>', .overrideView(Dummy, new View(
directives: [PropertyAccess])) template: '<property-access></property-access>',
directives: [PropertyAccess]))
.createAsync(Dummy).then((tc) { .createAsync(Dummy)
.then((tc) {
tc.detectChanges(); tc.detectChanges();
expect(asNativeElements(tc.componentViewChildren)).toHaveText('prop:foo-prop;map:foo-map'); expect(asNativeElements(tc.componentViewChildren))
.toHaveText('prop:foo-prop;map:foo-map');
async.done(); async.done();
}); });
})); }));
@ -109,11 +115,12 @@ main() {
TestComponentBuilder, TestComponentBuilder,
AsyncTestCompleter AsyncTestCompleter
], (tb, async) { ], (tb, async) {
tb.overrideView(Dummy, new View( tb
template: '<no-property-access></no-property-access>', .overrideView(Dummy, new View(
directives: [NoPropertyAccess])) template: '<no-property-access></no-property-access>',
directives: [NoPropertyAccess]))
.createAsync(Dummy).then((tc) { .createAsync(Dummy)
.then((tc) {
expect(() => tc.detectChanges()) expect(() => tc.detectChanges())
.toThrowError(new RegExp('property not found')); .toThrowError(new RegExp('property not found'));
async.done(); async.done();
@ -126,11 +133,12 @@ main() {
TestComponentBuilder, TestComponentBuilder,
AsyncTestCompleter AsyncTestCompleter
], (tb, async) { ], (tb, async) {
tb.overrideView(Dummy, new View( tb
template: '''<on-change [prop]="'hello'"></on-change>''', .overrideView(Dummy, new View(
directives: [OnChangeComponent])) template: '''<on-change [prop]="'hello'"></on-change>''',
directives: [OnChangeComponent]))
.createAsync(Dummy).then((tc) { .createAsync(Dummy)
.then((tc) {
tc.detectChanges(); tc.detectChanges();
var cmp = tc.componentViewChildren[0].inject(OnChangeComponent); var cmp = tc.componentViewChildren[0].inject(OnChangeComponent);
expect(cmp.prop).toEqual('hello'); expect(cmp.prop).toEqual('hello');
@ -141,13 +149,17 @@ main() {
}); });
describe("ObservableListDiff", () { describe("ObservableListDiff", () {
it('should be notified of changes', inject([TestComponentBuilder, Log], fakeAsync((TestComponentBuilder tcb, Log log) { it('should be notified of changes', inject([
tcb.overrideView(Dummy, new View( TestComponentBuilder,
template: '''<component-with-observable-list [list]="value"></component-with-observable-list>''', Log
directives: [ComponentWithObservableList])) ], fakeAsync((TestComponentBuilder tcb, Log log) {
tcb
.createAsync(Dummy).then((tc) { .overrideView(Dummy, new View(
tc.componentInstance.value = new ObservableList.from([1,2]); template: '''<component-with-observable-list [list]="value"></component-with-observable-list>''',
directives: [ComponentWithObservableList]))
.createAsync(Dummy)
.then((tc) {
tc.componentInstance.value = new ObservableList.from([1, 2]);
tc.detectChanges(); tc.detectChanges();
@ -170,7 +182,7 @@ main() {
expect(asNativeElements(tc.componentViewChildren)).toHaveText('123'); expect(asNativeElements(tc.componentViewChildren)).toHaveText('123');
// we replaced the list => a check // we replaced the list => a check
tc.componentInstance.value = new ObservableList.from([5,6,7]); tc.componentInstance.value = new ObservableList.from([5, 6, 7]);
tc.detectChanges(); tc.detectChanges();
@ -257,18 +269,25 @@ class OnChangeComponent implements OnChange {
changeDetection: ON_PUSH, changeDetection: ON_PUSH,
properties: const ['list'], properties: const ['list'],
hostInjector: const [ hostInjector: const [
const Binding(Pipes, toValue: const Pipes (const {"iterableDiff": const [const ObservableListDiffFactory(), const IterableChangesFactory(), const NullPipeFactory()]})) const Binding(Pipes,
toValue: const Pipes(const {
"iterableDiff": const [
const ObservableListDiffFactory(),
const IterableChangesFactory(),
const NullPipeFactory()
] ]
) }))
@View(template: '<span *ng-for="#item of list">{{item}}</span><directive-logging-checks></directive-logging-checks>', directives: const [NgFor, DirectiveLoggingChecks]) ])
class ComponentWithObservableList { @View(
template: '<span *ng-for="#item of list">{{item}}</span><directive-logging-checks></directive-logging-checks>',
directives: const [NgFor, DirectiveLoggingChecks])
class ComponentWithObservableList {
Iterable list; Iterable list;
} }
@Directive( @Directive(
selector: 'directive-logging-checks', selector: 'directive-logging-checks',
lifecycle: const [LifecycleEvent.onCheck] lifecycle: const [LifecycleEvent.onCheck])
)
class DirectiveLoggingChecks implements OnCheck { class DirectiveLoggingChecks implements OnCheck {
Log log; Log log;

View File

@ -19,30 +19,32 @@ main() {
}); });
it("should be false otherwise", () { it("should be false otherwise", () {
expect(pipeFactory.supports([1,2,3])).toBe(false); expect(pipeFactory.supports([1, 2, 3])).toBe(false);
}); });
}); });
it("should return the wrapped value to trigger change detection on first invocation of transform", () { it("should return the wrapped value to trigger change detection on first invocation of transform",
() {
final pipe = pipeFactory.create(changeDetectorRef); final pipe = pipeFactory.create(changeDetectorRef);
final c = new ObservableList.from([1,2]); final c = new ObservableList.from([1, 2]);
expect(pipe.transform(c, []).wrapped).toBe(pipe); expect(pipe.transform(c, []).wrapped).toBe(pipe);
}); });
it("should return itself when no changes between the calls", () { it("should return itself when no changes between the calls", () {
final pipe = pipeFactory.create(changeDetectorRef); final pipe = pipeFactory.create(changeDetectorRef);
final c = new ObservableList.from([1,2]); final c = new ObservableList.from([1, 2]);
pipe.transform(c, []); pipe.transform(c, []);
expect(pipe.transform(c, [])).toBe(pipe); expect(pipe.transform(c, [])).toBe(pipe);
}); });
it("should return the wrapped value once a change has been trigger", fakeAsync(() { it("should return the wrapped value once a change has been trigger",
fakeAsync(() {
final pipe = pipeFactory.create(changeDetectorRef); final pipe = pipeFactory.create(changeDetectorRef);
final c = new ObservableList.from([1,2]); final c = new ObservableList.from([1, 2]);
pipe.transform(c, []); pipe.transform(c, []);
@ -56,10 +58,11 @@ main() {
expect(pipe.transform(c, []).wrapped).toBe(pipe); expect(pipe.transform(c, []).wrapped).toBe(pipe);
})); }));
it("should request a change detection check upon receiving a change", fakeAsync(() { it("should request a change detection check upon receiving a change",
fakeAsync(() {
final pipe = pipeFactory.create(changeDetectorRef); final pipe = pipeFactory.create(changeDetectorRef);
final c = new ObservableList.from([1,2]); final c = new ObservableList.from([1, 2]);
pipe.transform(c, []); pipe.transform(c, []);
c.add(3); c.add(3);
@ -71,20 +74,21 @@ main() {
it("should return the wrapped value after changing a collection", () { it("should return the wrapped value after changing a collection", () {
final pipe = pipeFactory.create(changeDetectorRef); final pipe = pipeFactory.create(changeDetectorRef);
final c1 = new ObservableList.from([1,2]); final c1 = new ObservableList.from([1, 2]);
final c2 = new ObservableList.from([3,4]); final c2 = new ObservableList.from([3, 4]);
expect(pipe.transform(c1, []).wrapped).toBe(pipe); expect(pipe.transform(c1, []).wrapped).toBe(pipe);
expect(pipe.transform(c2, []).wrapped).toBe(pipe); expect(pipe.transform(c2, []).wrapped).toBe(pipe);
}); });
it("should not unbsubscribe from the stream of chagnes after changing a collection", () { it("should not unbsubscribe from the stream of chagnes after changing a collection",
() {
final pipe = pipeFactory.create(changeDetectorRef); final pipe = pipeFactory.create(changeDetectorRef);
final c1 = new ObservableList.from([1,2]); final c1 = new ObservableList.from([1, 2]);
expect(pipe.transform(c1, []).wrapped).toBe(pipe); expect(pipe.transform(c1, []).wrapped).toBe(pipe);
final c2 = new ObservableList.from([3,4]); final c2 = new ObservableList.from([3, 4]);
expect(pipe.transform(c2, []).wrapped).toBe(pipe); expect(pipe.transform(c2, []).wrapped).toBe(pipe);
// pushing into the first collection has no effect, and we do not see the change // pushing into the first collection has no effect, and we do not see the change

View File

@ -6,4 +6,4 @@ library angular2.test.router.route_config_spec;
* The rest of the router tests have typed annotations, so there's no need to add * The rest of the router tests have typed annotations, so there's no need to add
* additional tests here for Dart. * additional tests here for Dart.
*/ */
main () {} main() {}

View File

@ -30,7 +30,6 @@ void initReflector() {
], const [], () => new MixedSoupComponent(), const [OnChange])) ], const [], () => new MixedSoupComponent(), const [OnChange]))
..registerType(MatchedSoupComponent, new _ngRef.ReflectionInfo(const [ ..registerType(MatchedSoupComponent, new _ngRef.ReflectionInfo(const [
const Component( const Component(
selector: '[soup]', selector: '[soup]', lifecycle: const [LifecycleEvent.onChange])
lifecycle: const [LifecycleEvent.onChange])
], const [], () => new MatchedSoupComponent(), const [OnChange])); ], const [], () => new MatchedSoupComponent(), const [OnChange]));
} }

View File

@ -91,7 +91,9 @@ class _MyComponent_ChangeDetector0 extends _gen.AbstractChangeDetector {
_alreadyChecked = true; _alreadyChecked = true;
} }
void checkNoChanges() {this.runDetectChanges(true);} void checkNoChanges() {
this.runDetectChanges(true);
}
void callOnAllChangesDone() { void callOnAllChangesDone() {
dispatcher.notifyOnAllChangesDone(); dispatcher.notifyOnAllChangesDone();

View File

@ -1,5 +1,3 @@
library benchmarks.e2e_test.change_detection_perf; library benchmarks.e2e_test.change_detection_perf;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library benchmarks.e2e_test.compiler_perf; library benchmarks.e2e_test.compiler_perf;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library benchmarks.e2e_test.costs_perf; library benchmarks.e2e_test.costs_perf;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library benchmarks.e2e_test.di_perf; library benchmarks.e2e_test.di_perf;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library benchmarks.e2e_test.element_injector_perf; library benchmarks.e2e_test.element_injector_perf;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library benchmarks.e2e_test.largetable_perf; library benchmarks.e2e_test.largetable_perf;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library benchmarks.e2e_test.naive_infinite_scroll_perf; library benchmarks.e2e_test.naive_infinite_scroll_perf;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library benchmarks.e2e_test.naive_infinite_scroll_spec; library benchmarks.e2e_test.naive_infinite_scroll_spec;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library benchmarks.e2e_test.selector_perf; library benchmarks.e2e_test.selector_perf;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library benchmarks.e2e_test.static_tree_perf; library benchmarks.e2e_test.static_tree_perf;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library benchmarks.e2e_test.tree_perf; library benchmarks.e2e_test.tree_perf;
main() { main() {}
}

View File

@ -38,8 +38,8 @@ main() {
TreeNode createData() { TreeNode createData() {
var values = count++ % 2 == 0 var values = count++ % 2 == 0
? ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*'] ? ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*']
: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', '-']; : ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', '-'];
return buildTree(MAX_DEPTH, values, 0); return buildTree(MAX_DEPTH, values, 0);
} }
@ -62,8 +62,7 @@ main() {
@Component( @Component(
selector: 'tree0', selector: 'tree0',
map: const {'data': '=>data'}, map: const {'data': '=>data'},
template: '<span> {{data.value}} ' template: '<span> {{data.value}} ')
)
class TreeComponent0 { class TreeComponent0 {
var data; var data;
} }
@ -71,8 +70,7 @@ class TreeComponent0 {
@Component( @Component(
selector: 'tree1', selector: 'tree1',
map: const {'data': '=>data'}, map: const {'data': '=>data'},
template: '<span> {{data.value}} <tree0 data=data.right></tree0><tree0 data=data.left></tree0>' template: '<span> {{data.value}} <tree0 data=data.right></tree0><tree0 data=data.left></tree0>')
)
class TreeComponent1 { class TreeComponent1 {
var data; var data;
} }
@ -80,8 +78,7 @@ class TreeComponent1 {
@Component( @Component(
selector: 'tree2', selector: 'tree2',
map: const {'data': '=>data'}, map: const {'data': '=>data'},
template: '<span> {{data.value}} <tree1 data=data.right></tree1><tree1 data=data.left></tree1>' template: '<span> {{data.value}} <tree1 data=data.right></tree1><tree1 data=data.left></tree1>')
)
class TreeComponent2 { class TreeComponent2 {
var data; var data;
} }
@ -89,8 +86,7 @@ class TreeComponent2 {
@Component( @Component(
selector: 'tree3', selector: 'tree3',
map: const {'data': '=>data'}, map: const {'data': '=>data'},
template: '<span> {{data.value}} <tree2 data=data.right></tree2><tree2 data=data.left></tree2>' template: '<span> {{data.value}} <tree2 data=data.right></tree2><tree2 data=data.left></tree2>')
)
class TreeComponent3 { class TreeComponent3 {
var data; var data;
} }
@ -98,8 +94,7 @@ class TreeComponent3 {
@Component( @Component(
selector: 'tree4', selector: 'tree4',
map: const {'data': '=>data'}, map: const {'data': '=>data'},
template: '<span> {{data.value}} <tree3 data=data.right></tree3><tree3 data=data.left></tree3>' template: '<span> {{data.value}} <tree3 data=data.right></tree3><tree3 data=data.left></tree3>')
)
class TreeComponent4 { class TreeComponent4 {
var data; var data;
} }
@ -107,8 +102,7 @@ class TreeComponent4 {
@Component( @Component(
selector: 'tree5', selector: 'tree5',
map: const {'data': '=>data'}, map: const {'data': '=>data'},
template: '<span> {{data.value}} <tree4 data=data.right></tree4><tree4 data=data.left></tree4>' template: '<span> {{data.value}} <tree4 data=data.right></tree4><tree4 data=data.left></tree4>')
)
class TreeComponent5 { class TreeComponent5 {
var data; var data;
} }
@ -116,8 +110,7 @@ class TreeComponent5 {
@Component( @Component(
selector: 'tree6', selector: 'tree6',
map: const {'data': '=>data'}, map: const {'data': '=>data'},
template: '<span> {{data.value}} <tree5 data=data.right></tree5><tree5 data=data.left></tree5>' template: '<span> {{data.value}} <tree5 data=data.right></tree5><tree5 data=data.left></tree5>')
)
class TreeComponent6 { class TreeComponent6 {
var data; var data;
} }
@ -125,8 +118,7 @@ class TreeComponent6 {
@Component( @Component(
selector: 'tree7', selector: 'tree7',
map: const {'data': '=>data'}, map: const {'data': '=>data'},
template: '<span> {{data.value}} <tree6 data=data.right></tree6><tree6 data=data.left></tree6>' template: '<span> {{data.value}} <tree6 data=data.right></tree6><tree6 data=data.left></tree6>')
)
class TreeComponent7 { class TreeComponent7 {
var data; var data;
} }
@ -134,8 +126,7 @@ class TreeComponent7 {
@Component( @Component(
selector: 'tree8', selector: 'tree8',
map: const {'data': '=>data'}, map: const {'data': '=>data'},
template: '<span> {{data.value}} <tree7 data=data.right></tree7><tree7 data=data.left></tree7>' template: '<span> {{data.value}} <tree7 data=data.right></tree7><tree7 data=data.left></tree7>')
)
class TreeComponent8 { class TreeComponent8 {
var data; var data;
} }
@ -143,8 +134,7 @@ class TreeComponent8 {
@Component( @Component(
selector: 'tree9', selector: 'tree9',
map: const {'data': '=>data'}, map: const {'data': '=>data'},
template: '<span> {{data.value}} <tree8 data=data.right></tree8><tree8 data=data.left></tree8>' template: '<span> {{data.value}} <tree8 data=data.right></tree8><tree8 data=data.left></tree8>')
)
class TreeComponent9 { class TreeComponent9 {
var data; var data;
} }

View File

@ -1,2 +1,3 @@
library benchpress.index; library benchpress.index;
//no dart implementation //no dart implementation

View File

@ -1,2 +1,3 @@
library benchpress.src.firefox_extension.data.installed_script; library benchpress.src.firefox_extension.data.installed_script;
//no dart implementation //no dart implementation

View File

@ -1,2 +1,3 @@
library benchpress.src.firefox_extension.lib.main; library benchpress.src.firefox_extension.lib.main;
//no dart implementation //no dart implementation

View File

@ -1,2 +1,3 @@
library benchpress.src.firefox_extension.lib.parser_util; library benchpress.src.firefox_extension.lib.parser_util;
//no dart implementation //no dart implementation

View File

@ -1,2 +1,3 @@
library benchpress.src.firefox_extension.lib.test_helper; library benchpress.src.firefox_extension.lib.test_helper;
//no dart implementation //no dart implementation

View File

@ -1,2 +1,3 @@
library benchpress.src.webdriver.selenium_webdriver_adapter; library benchpress.src.webdriver.selenium_webdriver_adapter;
//no dart implementation //no dart implementation

View File

@ -1,2 +1,3 @@
library benchpress.test.firefox_extension.conf; library benchpress.test.firefox_extension.conf;
//empty as we don't have a version for dart //empty as we don't have a version for dart

View File

@ -1,5 +1,3 @@
library benchpress.test.firefox_extension.parser_util_spec; library benchpress.test.firefox_extension.parser_util_spec;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library benchpress.test.firefox_extension.sample_benchmark; library benchpress.test.firefox_extension.sample_benchmark;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library benchpress.test.firefox_extension.spec; library benchpress.test.firefox_extension.spec;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library examples.e2e_test.async_spec; library examples.e2e_test.async_spec;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library examples.e2e_test.hello_world.hello_world_spec; library examples.e2e_test.hello_world.hello_world_spec;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library examples.e2e_test.http.http_spec; library examples.e2e_test.http.http_spec;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library examples.e2e_test.jsonp.jsonp_spec; library examples.e2e_test.jsonp.jsonp_spec;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library examples.e2e_test.key_events.key_events_spec; library examples.e2e_test.key_events.key_events_spec;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library examples.e2e_test.message_bus; library examples.e2e_test.message_bus;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library examples.e2e_test.hello_world.model_driven_forms_spec; library examples.e2e_test.hello_world.model_driven_forms_spec;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library examples.e2e_test.order_management_spec; library examples.e2e_test.order_management_spec;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library examples.e2e_test.person_management_spec; library examples.e2e_test.person_management_spec;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library examples.e2e_test.sourcemap.sourcemap_spec; library examples.e2e_test.sourcemap.sourcemap_spec;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library examples.e2e_test.hello_world.template_driven_forms_spec; library examples.e2e_test.hello_world.template_driven_forms_spec;
main() { main() {}
}

View File

@ -1,5 +1,3 @@
library examples.e2e_test.zippy_component.zippy_spec; library examples.e2e_test.zippy_component.zippy_spec;
main() { main() {}
}

View File

@ -8,7 +8,6 @@ void commonDemoSetup() {
} }
class DemoUrlResolver extends UrlResolver { class DemoUrlResolver extends UrlResolver {
@override @override
String resolve(String baseUrl, String url) { String resolve(String baseUrl, String url) {
const MATERIAL_PKG = 'package:angular2_material/'; const MATERIAL_PKG = 'package:angular2_material/';
@ -16,7 +15,8 @@ class DemoUrlResolver extends UrlResolver {
// We run a proxy server in front of pub serve that prepends "example" to // We run a proxy server in front of pub serve that prepends "example" to
// paths // paths
if (url.startsWith(MATERIAL_PKG)) { if (url.startsWith(MATERIAL_PKG)) {
return '/examples/packages/angular2_material/' + url.substring(MATERIAL_PKG.length); return '/examples/packages/angular2_material/' +
url.substring(MATERIAL_PKG.length);
} }
return super.resolve(baseUrl, url); return super.resolve(baseUrl, url);
} }

View File

@ -2,11 +2,12 @@ library examples.src.web_workers.index;
import "index_common.dart" show HelloCmp; import "index_common.dart" show HelloCmp;
import "dart:isolate"; import "dart:isolate";
import "package:angular2/src/web-workers/worker/application.dart" show bootstrapWebworker; import "package:angular2/src/web-workers/worker/application.dart"
show bootstrapWebworker;
import "package:angular2/src/reflection/reflection_capabilities.dart"; import "package:angular2/src/reflection/reflection_capabilities.dart";
import "package:angular2/src/reflection/reflection.dart"; import "package:angular2/src/reflection/reflection.dart";
main(List<String> args, SendPort replyTo){ main(List<String> args, SendPort replyTo) {
reflector.reflectionCapabilities = new ReflectionCapabilities(); reflector.reflectionCapabilities = new ReflectionCapabilities();
bootstrapWebworker(replyTo, HelloCmp); bootstrapWebworker(replyTo, HelloCmp);
} }

View File

@ -4,7 +4,7 @@ import "package:angular2/src/web-workers/ui/application.dart" show bootstrap;
import "package:angular2/src/reflection/reflection_capabilities.dart"; import "package:angular2/src/reflection/reflection_capabilities.dart";
import "package:angular2/src/reflection/reflection.dart"; import "package:angular2/src/reflection/reflection.dart";
main(){ main() {
reflector.reflectionCapabilities = new ReflectionCapabilities(); reflector.reflectionCapabilities = new ReflectionCapabilities();
bootstrap("background_index.dart"); bootstrap("background_index.dart");
} }