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

Unified Diff: tests/standalone/javascript_compatibility_errors_test.dart

Issue 347873002: Ensure that a javascript compatibility warning results in a (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/javascript_compatibility_errors_test.dart
===================================================================
--- tests/standalone/javascript_compatibility_errors_test.dart (revision 37514)
+++ tests/standalone/javascript_compatibility_errors_test.dart (working copy)
@@ -8,14 +8,14 @@
f(x, y) {
// Unoptimized and optimized code.
- 1 is double; /// 00: compile-time error
- if (1 is double) { x++; } /// 01: compile-time error
- try { 1 as double; } on CastError catch (e) { } /// 02: compile-time error
- try { var y = 1 as double; } on CastError catch (e) { } /// 03: compile-time error
- 1.0 is int; /// 04: compile-time error
- if (1.0 is int) { x++; } /// 05: compile-time error
- try { 1.0 as int; } on CastError catch (e) { } /// 06: compile-time error
- try { var z = 1.0 as int; } on CastError catch (e) { } /// 07: compile-time error
+ 1 is double; /// 00: ok
+ if (1 is double) { x++; } /// 01: ok
+ try { 1 as double; } on CastError catch (e) { } /// 02: ok
+ try { var y = 1 as double; } on CastError catch (e) { } /// 03: ok
+ 1.0 is int; /// 04: ok
+ if (1.0 is int) { x++; } /// 05: ok
+ try { 1.0 as int; } on CastError catch (e) { } /// 06: ok
+ try { var z = 1.0 as int; } on CastError catch (e) { } /// 07: ok
x is double; /// 10: ok
if (x is double) { } /// 11: ok
@@ -26,8 +26,11 @@
try { y as int; } on CastError catch (e) { } /// 16: ok
try { var z = y as int; } on CastError catch (e) { } /// 17: ok
+ // It is a compile-time error if evaluation of a constant object results in
+ // an uncaught exception being thrown, a JavascriptCompatibilityError here.
"${1.0}"; /// 20: compile-time error
var z = "${1.0}"; /// 21: compile-time error
+
(1.0).toString(); /// 22: ok
var z = (1.0).toString(); /// 23: ok
"$y"; /// 24: ok
@@ -56,6 +59,7 @@
"${1.0}"; /// 50: compile-time error
var z = "${1.0}"; /// 51: compile-time error
+
(1.0).toString(); /// 52: ok
var z = (1.0).toString(); /// 53: ok
"$y"; /// 54: ok
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698