From fad25c2b104685b5ea290cdf7095f503db6480a1 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Mon, 23 Feb 2015 11:44:59 -0800 Subject: [PATCH] chore: Adding return types to Dart facades Closes #758 --- modules/angular2/src/facade/dom.dart | 14 +++++++------- modules/angular2/src/facade/lang.dart | 6 +++--- modules/angular2/src/facade/math.dart | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/angular2/src/facade/dom.dart b/modules/angular2/src/facade/dom.dart index 25283272a1..43613afbfe 100644 --- a/modules/angular2/src/facade/dom.dart +++ b/modules/angular2/src/facade/dom.dart @@ -144,13 +144,13 @@ class DOM { static bool hasClass(Element element, String classname) => element.classes.contains(classname); - static setStyle(Element element, String stylename, String stylevalue) { + static void setStyle(Element element, String stylename, String stylevalue) { element.style.setProperty(stylename, stylevalue); } - static removeStyle(Element element, String stylename) { + static void removeStyle(Element element, String stylename) { element.style.removeProperty(stylename); } - static getStyle(Element element, String stylename) { + static String getStyle(Element element, String stylename) { return element.style.getPropertyValue(stylename); } @@ -193,8 +193,8 @@ class DOM { } class CSSRuleWrapper { - static isPageRule(CssRule rule) => rule is CssPageRule; - static isStyleRule(CssRule rule) => rule is CssStyleRule; - static isMediaRule(CssRule rule) => rule is CssMediaRule; - static isKeyframesRule(CssRule rule) => rule is CssKeyframesRule; + static bool isPageRule(CssRule rule) => rule is CssPageRule; + static bool isStyleRule(CssRule rule) => rule is CssStyleRule; + static bool isMediaRule(CssRule rule) => rule is CssMediaRule; + static bool isKeyframesRule(CssRule rule) => rule is CssKeyframesRule; } diff --git a/modules/angular2/src/facade/lang.dart b/modules/angular2/src/facade/lang.dart index ceb79f6633..e6a121f01c 100644 --- a/modules/angular2/src/facade/lang.dart +++ b/modules/angular2/src/facade/lang.dart @@ -193,14 +193,14 @@ bool assertionsEnabled() { // Can't be all uppercase as our transpiler would think it is a special directive... class Json { static parse(String s) => convert.JSON.decode(s); - static stringify(data) => convert.JSON.encode(data); + static String stringify(data) => convert.JSON.encode(data); } class DateWrapper { - static fromMillis(int ms) { + static DateTime fromMillis(int ms) { return new DateTime.fromMillisecondsSinceEpoch(ms); } - static now() { + static DateTime now() { return new DateTime.now(); } } diff --git a/modules/angular2/src/facade/math.dart b/modules/angular2/src/facade/math.dart index ef37a0b178..034723fd5d 100644 --- a/modules/angular2/src/facade/math.dart +++ b/modules/angular2/src/facade/math.dart @@ -3,7 +3,7 @@ library angular.core.facade.math; import 'dart:core' show double, num; import 'dart:math' as math; -var NaN = double.NAN; +const NaN = double.NAN; class Math { static num pow(num x, num exponent) {