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

Side by Side Diff: gin/arguments.cc

Issue 59153005: Begin implementing V8 bindings for Mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix skipped comment Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gin/arguments.h ('k') | gin/array_buffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "gin/arguments.h"
6
7 #include <sstream>
8 #include "gin/converter.h"
9
10 namespace gin {
11
12 Arguments::Arguments(const v8::FunctionCallbackInfo<v8::Value>& info)
13 : isolate_(info.GetIsolate()),
14 info_(info),
15 next_(0),
16 insufficient_arguments_(false) {
17 }
18
19 Arguments::~Arguments() {
20 }
21
22 void Arguments::ThrowError() {
23 if (insufficient_arguments_)
24 return ThrowTypeError("Insufficient number of arguments.");
25
26 std::stringstream stream;
27 stream << "Error processing argument " << next_ - 1 << ".";
Aaron Boodman 2013/11/11 21:37:32 This will do the wrong thing when the client calls
Aaron Boodman 2013/11/11 21:38:59 Nevermind. LGTM.
28 ThrowTypeError(stream.str());
29 }
30
31 void Arguments::ThrowTypeError(const std::string& message) {
32 isolate_->ThrowException(v8::Exception::TypeError(
33 StringToV8(isolate_, message)));
34 }
35
36 } // namespace gin
OLDNEW
« no previous file with comments | « gin/arguments.h ('k') | gin/array_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698