Skip to content

Commit c0c9b78

Browse files
nainartabatkins
authored andcommitted
Cater for RangeError caused by dividing by 0 (#589)
* Cater for RangeError caused by dividing by 0 Fixes #575 * Indent properly
1 parent 5ab5fbe commit c0c9b78

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

css-typed-om/Overview.bs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -878,10 +878,12 @@ The following are the arithmetic operations you can perform on dimensions:
878878
1. If |this| is a {{CSSMathInvert}} object,
879879
return |this|’s {{CSSMathInvert/value}} internal slot.
880880

881-
2. If |this| is a {{CSSUnitValue}} object with {{CSSUnitValue/unit}} internal slot set to "number",
882-
return a new {{CSSUnitValue}}
883-
with the {{CSSUnitValue/unit}} internal slot set to "number",
884-
and a {{CSSUnitValue/value}} internal slot set to the inverse of |this|’s.
881+
2. If |this| is a {{CSSUnitValue}} object with {{CSSUnitValue/unit}} internal slot set to "number":
882+
1. If |this|’s {{CSSUnitValue/value}} internal slot is set to 0,
883+
[=throw=] a {{RangeError}}.
884+
2. Else return a new {{CSSUnitValue}}
885+
with the {{CSSUnitValue/unit}} internal slot set to "number",
886+
and a {{CSSUnitValue/value}} internal slot set to the inverse of |this|’s.
885887

886888
3. Otherwise,
887889
return a new {{CSSMathInvert}} object

0 commit comments

Comments
 (0)