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

Issue 364973002: Fix more pub bugs. (Closed)

Created:
6 years, 5 months ago by Bob Nystrom
Modified:
6 years, 5 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -0 lines) Patch
M sdk/lib/_internal/pub/lib/src/command.dart View 1 chunk +5 lines, -0 lines 2 comments Download
M sdk/lib/_internal/pub/lib/src/exceptions.dart View 1 chunk +2 lines, -0 lines 0 comments Download
M sdk/lib/_internal/pub/test/build/outputs_results_to_json_test.dart View 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Bob Nystrom
Trying to unbreak the bots. :(
6 years, 5 months ago (2014-07-03 01:16:35 UTC) #1
Siggi Cherem (dart-lang)
lgtm
6 years, 5 months ago (2014-07-03 01:17:20 UTC) #2
Bob Nystrom
Committed patchset #1 manually as r37968 (presubmit successful).
6 years, 5 months ago (2014-07-03 01:18:13 UTC) #3
nweiz
https://codereview.chromium.org/364973002/diff/1/sdk/lib/_internal/pub/lib/src/command.dart File sdk/lib/_internal/pub/lib/src/command.dart (right): https://codereview.chromium.org/364973002/diff/1/sdk/lib/_internal/pub/lib/src/command.dart#newcode231 sdk/lib/_internal/pub/lib/src/command.dart:231: void usageError(String message) { Does this shadow [usageError] in ...
6 years, 5 months ago (2014-07-07 19:57:18 UTC) #4
Bob Nystrom
6 years, 5 months ago (2014-07-07 21:03:00 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/364973002/diff/1/sdk/lib/_internal/pub/lib/sr...
File sdk/lib/_internal/pub/lib/src/command.dart (right):

https://codereview.chromium.org/364973002/diff/1/sdk/lib/_internal/pub/lib/sr...
sdk/lib/_internal/pub/lib/src/command.dart:231: void usageError(String message)
{
On 2014/07/07 19:57:18, nweiz wrote:
> Does this shadow [usageError] in utils? That seems weird.

Yeah. :(

> Where is it important that we eagerly bind the usage? Can we do this
explicitly there?

The help command and the top level command routing code both throw usageErrors()
for specific command objects. For the former, you want usage for the failed
command, not the help command itself. For the latter, you aren't inside a
command, so the lazy binding won't happen.

I think the right thing to do is ditch the lazy usage binding I added. I did
that so that you could throw a usageError() outside of the context of a command
(in executable.dart), but I think it's simpler to just pass in the command to
that.

I'll send out a patch.

Powered by Google App Engine
This is Rietveld 408576698