-
Notifications
You must be signed in to change notification settings - Fork 142
Fix issue 404 #413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue 404 #413
Conversation
|
|
||
| 3. If there are at least two different [=strong types=] | ||
| among the [=list/items=] in |values|, | ||
| [=throw=] a {{TypeError}}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to throw a TypeError here or return a min/max expression?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throwing a TypeError is correct. You can't compare a length to an angle; doing so will be rejected as a syntax error in CSS, and throws a TypeError here in JS.
css-typed-om/Overview.bs
Outdated
| the {{CSSUnitValue/value}} internal slots | ||
| of the [=list/items=] in |values|. | ||
|
|
||
| 5. If |this| is a {{CSSMathMin}} object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should talk to Tab about in-place modification, not sure it's actually what we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh shoot, you're right, I didn't intend to do an in-place modification in the add() function. My intention is just that, if you already have a Sum, we should just create a larger Sum with all the values, rather than nesting the Sums.
That is, CSS.num(1).add(1).add(2) should give the same result as CSS.num(1).add(2, 3).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, go ahead and stay consistent for this; I need to rewrite the math functions now to take advantage of the proper type system. :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I've done that now, so instead be consistent with text of the new functions. ^_^
css-typed-om/Overview.bs
Outdated
| the {{CSSUnitValue/value}} internal slots | ||
| of the [=list/items=] in |values|. | ||
|
|
||
| 5. If |this| is a {{CSSMathMin}} object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh shoot, you're right, I didn't intend to do an in-place modification in the add() function. My intention is just that, if you already have a Sum, we should just create a larger Sum with all the values, rather than nesting the Sums.
That is, CSS.num(1).add(1).add(2) should give the same result as CSS.num(1).add(2, 3).
|
|
||
| 3. If there are at least two different [=strong types=] | ||
| among the [=list/items=] in |values|, | ||
| [=throw=] a {{TypeError}}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throwing a TypeError is correct. You can't compare a length to an angle; doing so will be rejected as a syntax error in CSS, and throws a TypeError here in JS.
css-typed-om/Overview.bs
Outdated
| the {{CSSUnitValue/value}} internal slots | ||
| of the [=list/items=] in |values|. | ||
|
|
||
| 5. If |this| is a {{CSSMathMin}} object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, go ahead and stay consistent for this; I need to rewrite the math functions now to take advantage of the proper type system. :(
|
@tabatkins take a look please? |
css-typed-om/Overview.bs
Outdated
| If |type| is failure, | ||
| [=throw=] a {{TypeError}}. | ||
|
|
||
| 4. Return a new {{CSSMathMin}} object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Max. ^_^ (Several places in here.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/facepalm.
Done.
nainar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tabatkins take a look? Thanks!
css-typed-om/Overview.bs
Outdated
| If |type| is failure, | ||
| [=throw=] a {{TypeError}}. | ||
|
|
||
| 4. Return a new {{CSSMathMin}} object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/facepalm.
Done.
@shans could you take a look?
This hopefully adds the text needed for issue #404