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

Unified Diff: dart/frog/leg/ssa/codegen.dart

Issue 9549002: For reasons beyond logic, null matches any exception type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 | « dart/frog/leg/ssa/builder.dart ('k') | dart/tests/language/language-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/ssa/codegen.dart
diff --git a/dart/frog/leg/ssa/codegen.dart b/dart/frog/leg/ssa/codegen.dart
index 7921553b4d9fb8a9449943a6aa370a594a6e9e35..46b705d5e7a4c11cd9bf63c57b29dd14523e2ad4 100644
--- a/dart/frog/leg/ssa/codegen.dart
+++ b/dart/frog/leg/ssa/codegen.dart
@@ -929,6 +929,10 @@ class SsaCodeGenerator implements HVisitor {
LibraryElement coreLibrary = compiler.coreLibrary;
ClassElement objectClass = coreLibrary.find(const SourceString('Object'));
HInstruction input = node.expression;
+ if (node.nullOk) {
+ use(input, JSPrecedence.LOGICAL_OR_PRECEDENCE);
Lasse Reichstein Nielsen 2012/03/01 08:38:17 That should be EQUALITY_PRECEDENCE. It's the left
ahe 2012/03/06 10:16:01 Done.
+ buffer.add(' === (void 0) ||');
ahe 2012/02/29 20:44:20 I think this will work well for checked mode as we
+ }
Lasse Reichstein Nielsen 2012/03/02 09:44:09 This also changes the expected precedence for the
ahe 2012/03/06 10:16:01 Done.
if (element == objectClass) {
// TODO(ahe): This probably belongs in the constant folder.
buffer.add('true');
« no previous file with comments | « dart/frog/leg/ssa/builder.dart ('k') | dart/tests/language/language-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698