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

Unified Diff: gin/arguments.cc

Issue 89723002: Convert the rest of the functions in core.cc to use CreateFunctionTemplate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase+comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gin/arguments.h ('k') | gin/array_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/arguments.cc
diff --git a/gin/arguments.cc b/gin/arguments.cc
index 9eedfa3cd9e0250713528e6339edf4d9cd16d53f..284451479d5ebf8ea9181c6bac28a86847e97cc4 100644
--- a/gin/arguments.cc
+++ b/gin/arguments.cc
@@ -9,9 +9,16 @@
namespace gin {
+Arguments::Arguments()
+ : isolate_(NULL),
+ info_(NULL),
+ next_(0),
+ insufficient_arguments_(false) {
+}
+
Arguments::Arguments(const v8::FunctionCallbackInfo<v8::Value>& info)
: isolate_(info.GetIsolate()),
- info_(info),
+ info_(&info),
next_(0),
insufficient_arguments_(false) {
}
@@ -20,9 +27,9 @@ Arguments::~Arguments() {
}
v8::Handle<v8::Value> Arguments::PeekNext() {
- if (next_ >= info_.Length())
+ if (next_ >= info_->Length())
return v8::Handle<v8::Value>();
- return info_[next_];
+ return (*info_)[next_];
}
void Arguments::ThrowError() {
@@ -38,4 +45,10 @@ void Arguments::ThrowTypeError(const std::string& message) {
StringToV8(isolate_, message)));
}
+template<>
+bool Arguments::GetNext<Arguments>(Arguments* out) {
+ *out = *this;
+ return true;
+}
+
} // namespace gin
« 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