Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ValidResult.java

Issue 17603005: Report CONST_EVAL_THROWS_IDBZE when VM will throw IntegerDivisionByZeroException (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ValidResult.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ValidResult.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ValidResult.java
index 97f66ffe37fe906a74af758673c3b32ebeb9c7cd..131e3312ad59dda122c78cde7614d0d8d4bf3c58 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ValidResult.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ValidResult.java
@@ -581,8 +581,7 @@ public class ValidResult extends EvaluationResultImpl {
} else if (leftValue instanceof BigInteger) {
if (value instanceof BigInteger) {
if (((BigInteger) value).equals(BigInteger.ZERO)) {
- return valueOf(Double.valueOf(((BigInteger) leftValue).doubleValue()
- / ((BigInteger) value).doubleValue()));
+ return error(node, CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE);
}
return valueOf(((BigInteger) leftValue).divide((BigInteger) value));
} else if (value instanceof Double) {

Powered by Google App Engine
This is Rietveld 408576698