@@ -10,16 +10,14 @@ import 'dart:js' as js;
1010// Proxies a Dart function that accepts up to 10 parameters.
1111js.JsFunction _jsFunction (Function fn) {
1212 const Object X = __varargSentinel;
13- return new js.JsFunction .withThis (
14- (thisArg, [o1 = X , o2 = X , o3 = X , o4 = X , o5 = X , o6 = X , o7 = X , o8= X , o9= X , o10= X ]) {
15- return __invokeFn (fn, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10);
16- });
13+ return new js.JsFunction .withThis ((thisArg, [o1 = X , o2 = X , o3 = X , o4 = X ,
14+ o5 = X , o6 = X , o7 = X , o8 = X , o9 = X , o10 = X ]) {
15+ return __invokeFn (fn, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10);
16+ });
1717}
1818
19-
2019const Object __varargSentinel = const Object ();
2120
22-
2321__invokeFn (fn, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10) {
2422 var args = [o1, o2, o3, o4, o5, o6, o7, o8, o9, o10];
2523 while (args.length > 0 && identical (args.last, __varargSentinel)) {
@@ -28,7 +26,6 @@ __invokeFn(fn, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10) {
2826 return _jsify (Function .apply (fn, args));
2927}
3028
31-
3229// Helper function to JSify a Dart object. While this is *required* to JSify
3330// the result of a scope.eval(), other uses are not required and are used to
3431// work around http://dartbug.com/17752 in a convenient way (that bug affects
@@ -44,8 +41,9 @@ _jsify(var obj) {
4441 return _jsFunction (obj);
4542 }
4643 if ((obj is Map ) || (obj is Iterable )) {
47- var mappedObj = (obj is Map ) ?
48- new Map .fromIterables (obj.keys, obj.values.map (_jsify)) : obj.map (_jsify);
44+ var mappedObj = (obj is Map )
45+ ? new Map .fromIterables (obj.keys, obj.values.map (_jsify))
46+ : obj.map (_jsify);
4947 if (obj is List ) {
5048 return new js.JsArray .from (mappedObj);
5149 } else {
@@ -75,19 +73,18 @@ class PublicTestability implements _JsObjectProxyable {
7573
7674 js.JsObject _toJsObject () {
7775 return _jsify ({
78- 'findBindings' : (bindingString, [exactMatch, allowNonElementNodes]) =>
79- findBindings (bindingString, exactMatch, allowNonElementNodes),
80- 'whenStable' : (callback) =>
81- whenStable (() => callback.apply ([])),
76+ 'findBindings' : (bindingString, [exactMatch, allowNonElementNodes]) =>
77+ findBindings (bindingString, exactMatch, allowNonElementNodes),
78+ 'whenStable' : (callback) => whenStable (() => callback.apply ([])),
8279 })..['_dart_' ] = this ;
8380 }
8481}
8582
8683class GetTestability {
8784 static addToWindow (TestabilityRegistry registry) {
8885 js.context['getAngularTestability' ] = _jsify ((Element elem) {
89- Testability testability = registry.findTestabilityInTree (elem);
90- return _jsify (new PublicTestability (testability));
91- });
86+ Testability testability = registry.findTestabilityInTree (elem);
87+ return _jsify (new PublicTestability (testability));
88+ });
9289 }
9390}
0 commit comments