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

Issue 1539953002: Fix "if" conditions in summary Builder setters. (Closed)

Created:
5 years ago by Paul Berry
Modified:
5 years ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org, scheglov
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix "if" conditions in summary Builder setters. Previously, we were generating code like: if (_value != null || _value == <default>) { <store _value in the summary> } which meant that (a) default values were being unnecessarily stored in the summaries, and (b) passing null to a summary Builder setter would have caused a crash. This CL modifies the code generator to output code like this: if (!(_value == null || _value == <default>)) { <store _value in the summary> } which has the intended behavior of treating `null` like the default value, and suppressing the default value from appearing in the summary. R=brianwilkerson@google.com Committed: https://github.com/dart-lang/sdk/commit/f1ea359020ef8b09db37d44b5a6b83d2a4317b9b

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -83 lines) Patch
M pkg/analyzer/lib/src/summary/format.dart View 82 chunks +82 lines, -82 lines 0 comments Download
M pkg/analyzer/tool/summary/generate.dart View 1 chunk +1 line, -1 line 1 comment Download

Messages

Total messages: 8 (4 generated)
Paul Berry
5 years ago (2015-12-18 18:09:47 UTC) #3
Paul Berry
5 years ago (2015-12-18 18:09:47 UTC) #4
Brian Wilkerson
LGTM https://codereview.chromium.org/1539953002/diff/1/pkg/analyzer/tool/summary/generate.dart File pkg/analyzer/tool/summary/generate.dart (right): https://codereview.chromium.org/1539953002/diff/1/pkg/analyzer/tool/summary/generate.dart#newcode335 pkg/analyzer/tool/summary/generate.dart:335: out('if (!(_value == null$condition)) {'); The case where ...
5 years ago (2015-12-18 18:16:10 UTC) #6
Paul Berry
5 years ago (2015-12-18 18:23:08 UTC) #8
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
f1ea359020ef8b09db37d44b5a6b83d2a4317b9b (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698