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

Issue 245113006: Consistently type check analysis server request parameters. (Closed)

Created:
6 years, 8 months ago by Paul Berry
Modified:
6 years, 8 months ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Consistently type check analysis server request parameters. Introduces a class RequestDatum, which wraps request parameters (or components thereof) and provides type checking and coercion. RequestDatum also provides an operator[] so that nested parameters can be type checked and coerced at every level of nesting. Previously, our checking and coercion was ad-hoc, and as a result some parameters weren't type checked at all. R=brianwilkerson@google.com Committed: https://code.google.com/p/dart/source/detail?r=35228

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+327 lines, -98 lines) Patch
M pkg/analysis_server/lib/src/domain_context.dart View 6 chunks +15 lines, -17 lines 0 comments Download
M pkg/analysis_server/lib/src/domain_server.dart View 2 chunks +4 lines, -4 lines 0 comments Download
M pkg/analysis_server/lib/src/protocol.dart View 3 chunks +143 lines, -48 lines 4 comments Download
M pkg/analysis_server/test/domain_context_test.dart View 2 chunks +8 lines, -5 lines 0 comments Download
M pkg/analysis_server/test/protocol_test.dart View 5 chunks +157 lines, -24 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Paul Berry
6 years, 8 months ago (2014-04-21 22:02:43 UTC) #1
Brian Wilkerson
LGTM https://codereview.chromium.org/245113006/diff/1/pkg/analysis_server/lib/src/protocol.dart File pkg/analysis_server/lib/src/protocol.dart (right): https://codereview.chromium.org/245113006/diff/1/pkg/analysis_server/lib/src/protocol.dart#newcode97 pkg/analysis_server/lib/src/protocol.dart:97: * Return the value of the parameter with ...
6 years, 8 months ago (2014-04-21 22:12:32 UTC) #2
Paul Berry
Committed patchset #1 manually as r35228 (presubmit successful).
6 years, 8 months ago (2014-04-21 22:21:45 UTC) #3
Paul Berry
6 years, 8 months ago (2014-04-21 22:22:21 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/245113006/diff/1/pkg/analysis_server/lib/src/...
File pkg/analysis_server/lib/src/protocol.dart (right):

https://codereview.chromium.org/245113006/diff/1/pkg/analysis_server/lib/src/...
pkg/analysis_server/lib/src/protocol.dart:97: * Return the value of the
parameter with the given [name], or defaultValue
On 2014/04/21 22:12:32, Brian Wilkerson wrote:
> "defaultValue" --> "[defaultValue]"

Done.

https://codereview.chromium.org/245113006/diff/1/pkg/analysis_server/lib/src/...
pkg/analysis_server/lib/src/protocol.dart:100: RequestDatum getParameter(String
name, dynamic defaultValue) {
On 2014/04/21 22:12:32, Brian Wilkerson wrote:
> Do we want a default default value, such as
>   RequestDatum getParameter(String name, [dynamic defaultValue = null])

I don't know.  Currently there's not really a need for it, since the only use of
this method is for server.createContext's packageMap parameter, and the default
that makes sense for that is {}.

I'll keep this in mind as I'm getting more commands implemented.

Powered by Google App Engine
This is Rietveld 408576698