Bug 1260933 - Part 2: For invalid duration values, print the invalid value. r=birtles
authorDaisuke Akatsuka <daisuke@mozilla-japan.org>
Thu, 31 Mar 2016 19:20:59 +0900
changeset 291183 2bcb11fae866b7d1446f6f0d2334f20bc6985c5b
parent 291182 1ec5f90ead463d460c46523e1719695418ea8183
child 291184 fceee99ec164f23f18b5f88649912ada60dd0e41
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1260933
milestone48.0a1
Bug 1260933 - Part 2: For invalid duration values, print the invalid value. r=birtles MozReview-Commit-ID: 1vg3M3yY19Z
dom/animation/TimingParams.h
dom/bindings/Errors.msg
--- a/dom/animation/TimingParams.h
+++ b/dom/animation/TimingParams.h
@@ -55,17 +55,18 @@ struct TimingParams
       double durationInMs = aDuration.GetAsUnrestrictedDouble();
       if (durationInMs >= 0) {
         result.emplace(StickyTimeDuration::FromMilliseconds(durationInMs));
       } else {
         aRv.ThrowTypeError<dom::MSG_ENFORCE_RANGE_OUT_OF_RANGE>(
           NS_LITERAL_STRING("duration"));
       }
     } else if (!aDuration.GetAsString().EqualsLiteral("auto")) {
-      aRv.ThrowTypeError<dom::MSG_INVALID_DURATION_ERROR>();
+      aRv.ThrowTypeError<dom::MSG_INVALID_DURATION_ERROR>(
+        aDuration.GetAsString());
     }
     return result;
   }
 
   static void ValidateIterationStart(double aIterationStart,
                                      ErrorResult& aRv)
   {
     if (aIterationStart < 0) {
--- a/dom/bindings/Errors.msg
+++ b/dom/bindings/Errors.msg
@@ -87,10 +87,10 @@ MSG_DEF(MSG_PROMISE_CAPABILITY_HAS_SOMET
 MSG_DEF(MSG_PROMISE_RESOLVE_FUNCTION_NOT_CALLABLE, 0, JSEXN_TYPEERR, "A Promise subclass passed a non-callable value as the resolve function.")
 MSG_DEF(MSG_PROMISE_REJECT_FUNCTION_NOT_CALLABLE, 0, JSEXN_TYPEERR, "A Promise subclass passed a non-callable value as the reject function.")
 MSG_DEF(MSG_PROMISE_ARG_NOT_ITERABLE, 1, JSEXN_TYPEERR, "{0} is not iterable")
 MSG_DEF(MSG_IS_NOT_PROMISE, 1, JSEXN_TYPEERR, "{0} is not a Promise")
 MSG_DEF(MSG_SW_INSTALL_ERROR, 2, JSEXN_TYPEERR, "ServiceWorker script at {0} for scope {1} encountered an error during installation.")
 MSG_DEF(MSG_SW_SCRIPT_THREW, 2, JSEXN_TYPEERR, "ServiceWorker script at {0} for scope {1} threw an exception during script evaluation.")
 MSG_DEF(MSG_TYPEDARRAY_IS_SHARED, 1, JSEXN_TYPEERR, "{0} can't be a typed array on SharedArrayBuffer")
 MSG_DEF(MSG_CACHE_ADD_FAILED_RESPONSE, 3, JSEXN_TYPEERR, "Cache got {0} response with bad status {1} while trying to add request {2}")
-MSG_DEF(MSG_INVALID_DURATION_ERROR, 0, JSEXN_TYPEERR, "Invalid duration.")
+MSG_DEF(MSG_INVALID_DURATION_ERROR, 1, JSEXN_TYPEERR, "Invalid duration '{0}'.")
 MSG_DEF(MSG_INVALID_EASING_ERROR, 1, JSEXN_TYPEERR, "Invalid easing '{0}'.")
\ No newline at end of file