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

Issue 8492015: Allow printf-style arguments for Dart_Error and Api::Error. (Closed)

Created:
9 years, 1 month ago by turnidge
Modified:
9 years, 1 month ago
Reviewers:
Anton Muhin, siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org, Ben Laurie (Google)
Visibility:
Public.

Description

Allow printf-style arguments for Dart_Error and Api::Error. Convert one error message to use the new facility for testing purposes. The rest of the errors will be improved in follow-on changes. Add tests. Minor comment fixes in dart_api_impl.h.

Patch Set 1 #

Total comments: 4

Patch Set 2 : '' #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -22 lines) Patch
M runtime/include/dart_api.h View 1 1 chunk +1 line, -5 lines 0 comments Download
M runtime/vm/dart_api_impl.h View 1 chunk +14 lines, -12 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 3 chunks +25 lines, -5 lines 4 comments Download
M runtime/vm/dart_api_impl_test.cc View 2 chunks +37 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
turnidge
Siva, Using printf involves an extra copy step for all error messages. I don't think ...
9 years, 1 month ago (2011-11-07 19:19:04 UTC) #1
siva
LGTM http://codereview.chromium.org/8492015/diff/1/runtime/include/dart_api.h File runtime/include/dart_api.h (right): http://codereview.chromium.org/8492015/diff/1/runtime/include/dart_api.h#newcode124 runtime/include/dart_api.h:124: * claim ownership of the 'error' parameter. The ...
9 years, 1 month ago (2011-11-07 23:20:50 UTC) #2
turnidge
http://codereview.chromium.org/8492015/diff/1/runtime/include/dart_api.h File runtime/include/dart_api.h (right): http://codereview.chromium.org/8492015/diff/1/runtime/include/dart_api.h#newcode124 runtime/include/dart_api.h:124: * claim ownership of the 'error' parameter. On 2011/11/07 ...
9 years, 1 month ago (2011-11-07 23:55:35 UTC) #3
Anton Muhin
DBC http://codereview.chromium.org/8492015/diff/4001/runtime/vm/dart_api_impl.cc File runtime/vm/dart_api_impl.cc (right): http://codereview.chromium.org/8492015/diff/4001/runtime/vm/dart_api_impl.cc#newcode2023 runtime/vm/dart_api_impl.cc:2023: OS::VSNPrint(buffer, len+1, format, args); nit: space around + ...
9 years, 1 month ago (2011-11-08 08:32:18 UTC) #4
turnidge
9 years, 1 month ago (2011-11-08 19:01:56 UTC) #5
http://codereview.chromium.org/8492015/diff/4001/runtime/vm/dart_api_impl.cc
File runtime/vm/dart_api_impl.cc (right):

http://codereview.chromium.org/8492015/diff/4001/runtime/vm/dart_api_impl.cc#...
runtime/vm/dart_api_impl.cc:2023: OS::VSNPrint(buffer, len+1, format, args);
On 2011/11/08 08:32:18, antonmuhin wrote:
> nit: space around + ?

Done.

http://codereview.chromium.org/8492015/diff/4001/runtime/vm/dart_api_impl.cc#...
runtime/vm/dart_api_impl.cc:2031: Dart_Handle Api::Error(const char* format,
...) {
On 2011/11/08 08:32:18, antonmuhin wrote:
> looks pretty much like Dart_Error.  Do we need both?

I am providing Dart_Error for external developers.  The "Api" apis are a bit
more extensive and for internal use.  We may be able to get rid of one in the
future -- perhaps by moving more of the "Api" apis to "Dart_" and always using
those.

Will keep this in mind for later.

Powered by Google App Engine
This is Rietveld 408576698