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

Issue 10695137: Provide better error message when passing wrong number of arguments. (Closed)

Created:
8 years, 5 months ago by regis
Modified:
8 years, 5 months ago
Reviewers:
srdjan
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Provide better error message when passing wrong number of arguments. Committed: https://code.google.com/p/dart/source/detail?r=9602

Patch Set 1 #

Patch Set 2 : #

Total comments: 10

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -51 lines) Patch
M runtime/vm/code_generator.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 2 chunks +18 lines, -11 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M runtime/vm/object.h View 1 2 1 chunk +13 lines, -2 lines 0 comments Download
M runtime/vm/object.cc View 1 2 2 chunks +59 lines, -5 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 8 chunks +51 lines, -22 lines 0 comments Download
M runtime/vm/resolver.cc View 1 2 3 chunks +27 lines, -8 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
regis
8 years, 5 months ago (2012-07-11 00:28:41 UTC) #1
regis
Srdjan, Please, hold on on this review. I need to fix some API tests doing ...
8 years, 5 months ago (2012-07-11 00:35:28 UTC) #2
regis
On 2012/07/11 00:35:28, regis wrote: > Srdjan, > > Please, hold on on this review. ...
8 years, 5 months ago (2012-07-11 23:22:22 UTC) #3
srdjan
LGTM with comments https://chromiumcodereview.appspot.com/10695137/diff/2002/runtime/vm/object.cc File runtime/vm/object.cc (right): https://chromiumcodereview.appspot.com/10695137/diff/2002/runtime/vm/object.cc#newcode3715 runtime/vm/object.cc:3715: if (message_buffer_size > 0) { || ...
8 years, 5 months ago (2012-07-12 00:06:37 UTC) #4
regis
8 years, 5 months ago (2012-07-12 17:37:36 UTC) #5
Thanks!

https://chromiumcodereview.appspot.com/10695137/diff/2002/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://chromiumcodereview.appspot.com/10695137/diff/2002/runtime/vm/object.c...
runtime/vm/object.cc:3715: if (message_buffer_size > 0) {
On 2012/07/12 00:06:37, srdjan wrote:
> || message_buffer == NULL

OS::SNPrint will work with a NULL buffer, as long as size is 0. So, an
ASSERT(message_buffer != NULL) if the size > 0 would prevent bad callers.

Since I will now use a String, this is not relevant anymore.

https://chromiumcodereview.appspot.com/10695137/diff/2002/runtime/vm/object.c...
runtime/vm/object.cc:3729: if (message_buffer_size > 0) {
On 2012/07/12 00:06:37, srdjan wrote:
> ditto

ditto

https://chromiumcodereview.appspot.com/10695137/diff/2002/runtime/vm/object.c...
runtime/vm/object.cc:3774: if (message_buffer_size > 0) {
On 2012/07/12 00:06:37, srdjan wrote:
> || (message_buffer == NULL)

ditto

https://chromiumcodereview.appspot.com/10695137/diff/2002/runtime/vm/object.h
File runtime/vm/object.h (right):

https://chromiumcodereview.appspot.com/10695137/diff/2002/runtime/vm/object.h...
runtime/vm/object.h:1465: bool AreValidArgumentCounts(int num_arguments,
On 2012/07/12 00:06:37, srdjan wrote:
> Add comment what message_buffer contains and that it can be NULL.

Done

https://chromiumcodereview.appspot.com/10695137/diff/2002/runtime/vm/object.h...
runtime/vm/object.h:1473: 
On 2012/07/12 00:06:37, srdjan wrote:
> Instead of passing the and allocating the message_buffer, it seems simpler to
> return a String instead.

Both functions now take a pointer to a String handle.

Powered by Google App Engine
This is Rietveld 408576698