Skip to content
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

Exception when NaN or Infinity are used as key to map #1059

Open
connorskees opened this issue Aug 19, 2020 · 1 comment
Open

Exception when NaN or Infinity are used as key to map #1059

connorskees opened this issue Aug 19, 2020 · 1 comment
Assignees
Labels
blocked Waiting on another issue to be fixed bug

Comments

@connorskees
Copy link
Contributor

For the following inputs dart-sass will raise an exception,

$a: ((0/0): a);
$a: ((1/0): a);
$a: ((-1/0): a);
Stacktrace
Unexpected exception:
Unsupported operation: Infinity or NaN toInt


dart:core                                                            double.round
package:sass/src/util/number.dart 22:61                              fuzzyHashCode
package:sass/src/value/number.dart 521:23                            SassNumber.hashCode
dart:collection                                                      _LinkedHashMapMixin.containsKey
package:sass/src/visitor/evaluate.dart 2037:15                       _EvaluateVisitor.visitMapExpression
package:sass/src/ast/sass/expression/map.dart 24:56                  MapExpression.accept
package:sass/src/visitor/evaluate.dart 1855:33                       _EvaluateVisitor.visitVariableDeclaration
package:sass/src/ast/sass/statement/variable_declaration.dart 75:15  VariableDeclaration.accept
package:sass/src/visitor/evaluate.dart 862:13                        _EvaluateVisitor.visitStylesheet
package:sass/src/visitor/evaluate.dart 678:7                         _EvaluateVisitor._execute.<fn>
package:sass/src/visitor/evaluate.dart 2700:26                       _EvaluateVisitor._withEnvironment
package:sass/src/visitor/evaluate.dart 648:5                         _EvaluateVisitor._execute
package:sass/src/visitor/evaluate.dart 486:20                        _EvaluateVisitor.run.<fn>
package:sass/src/warn.dart 32:20                                     withWarnCallback.<fn>
dart:async                                                           runZoned
package:sass/src/warn.dart 31:10                                     withWarnCallback
package:sass/src/visitor/evaluate.dart 502:12                        _EvaluateVisitor._withWarnCallback
package:sass/src/visitor/evaluate.dart 473:12                        _EvaluateVisitor.run
package:sass/src/visitor/evaluate.dart 95:10                         evaluate
package:sass/src/compile.dart 134:24                                 _compileStylesheet
package:sass/src/compile.dart 64:10                                  compile
package:sass/src/executable/compile_stylesheet.dart 91:13            compileStylesheet

Related to sass/sass#2892

nex3 added a commit to sass/sass-spec that referenced this issue Sep 4, 2020
nex3 added a commit to sass/sass-spec that referenced this issue Oct 28, 2020
See sass/dart-sass#1059

Co-authored-by: Awjin Ahn <awjin@google.com>
@nex3 nex3 self-assigned this May 16, 2022
@nex3 nex3 added the bug label May 16, 2022
@nex3
Copy link
Contributor

nex3 commented May 16, 2022

Blocked on dart-lang/sdk#49033.

@nex3 nex3 added the blocked Waiting on another issue to be fixed label May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Waiting on another issue to be fixed bug
Projects
None yet
Development

No branches or pull requests

2 participants