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

Issue 8507035: Here's a template for how I plan on doing error-checking on inputs for (Closed)

Created:
9 years, 1 month ago by turnidge
Modified:
9 years, 1 month ago
Reviewers:
Ivan Posva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Here's a template for how I plan on doing error-checking on inputs for dart api functions. Any comments before I change everything? Any way I could get away without creating the extra Object handle by doing sneaky tricks?

Patch Set 1 #

Total comments: 4

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -6 lines) Patch
M runtime/vm/dart_api_impl.cc View 1 4 chunks +26 lines, -4 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 3 chunks +51 lines, -2 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
turnidge
9 years, 1 month ago (2011-11-10 00:03:47 UTC) #1
Ivan Posva
LGTM, and I can't think of a better name for the macro either. -Ivan http://codereview.chromium.org/8507035/diff/1/runtime/vm/dart_api_impl.cc ...
9 years, 1 month ago (2011-11-10 00:12:55 UTC) #2
turnidge
9 years, 1 month ago (2011-11-10 17:48:57 UTC) #3
http://codereview.chromium.org/8507035/diff/1/runtime/vm/dart_api_impl.cc
File runtime/vm/dart_api_impl.cc (right):

http://codereview.chromium.org/8507035/diff/1/runtime/vm/dart_api_impl.cc#new...
runtime/vm/dart_api_impl.cc:30: #define UNWRAP_NONNULL(dart_handle, vm_handle,
Type)                    \
I tried this and it was a bit too magical for me.  I like having the handle
declaration outside of the macro to make it easier to guess what is going on. 
Okay?

On 2011/11/10 00:12:55, Ivan Posva wrote:
> How about adding a line like this here:
> 
> Type& vm_handle = Type::Handle();
> 
> This would avoid having to duplicating the handle allocation everywhere.

http://codereview.chromium.org/8507035/diff/1/runtime/vm/dart_api_impl.cc#new...
runtime/vm/dart_api_impl.cc:43: }                                               
                   \
On 2011/11/10 00:12:55, Ivan Posva wrote:
> \ at column 80.

Done.

Powered by Google App Engine
This is Rietveld 408576698