Skip to content

Commit

Permalink
[dartdevc] Fix emitting double constants from the SDK
Browse files Browse the repository at this point in the history
Change-Id: I38c2f1fe6deca63c3a689503862c3a620017e091
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108880
Reviewed-by: Vijay Menon <[email protected]>
Commit-Queue: Nicholas Shahan <[email protected]>
  • Loading branch information
nshahan authored and [email protected] committed Jul 11, 2019
1 parent 1e4b799 commit 55078c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/dev_compiler/lib/src/kernel/compiler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5295,6 +5295,15 @@ class ProgramCompiler extends Object
return js.number(intValue);
}
}
if (value.isInfinite) {
if (value.isNegative) {
return js.call('-1 / 0');
}
return js.call('1 / 0');
}
if (value.isNaN) {
return js.call('0 / 0');
}
return js.number(value);
}

Expand Down

0 comments on commit 55078c0

Please sign in to comment.