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

Side by Side Diff: gin/arguments.h

Issue 401823002: Added IsConstructorCall to gin::Arguments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit tests Created 6 years, 5 months 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
« no previous file with comments | « no previous file | gin/arguments.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GIN_ARGUMENTS_H_ 5 #ifndef GIN_ARGUMENTS_H_
6 #define GIN_ARGUMENTS_H_ 6 #define GIN_ARGUMENTS_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "gin/converter.h" 9 #include "gin/converter.h"
10 #include "gin/gin_export.h" 10 #include "gin/gin_export.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 info_->GetReturnValue().Set(ConvertToV8(isolate_, val)); 72 info_->GetReturnValue().Set(ConvertToV8(isolate_, val));
73 } 73 }
74 74
75 v8::Handle<v8::Value> PeekNext() const; 75 v8::Handle<v8::Value> PeekNext() const;
76 76
77 void ThrowError() const; 77 void ThrowError() const;
78 void ThrowTypeError(const std::string& message) const; 78 void ThrowTypeError(const std::string& message) const;
79 79
80 v8::Isolate* isolate() const { return isolate_; } 80 v8::Isolate* isolate() const { return isolate_; }
81 81
82 // Allows the function handler to distinguish between normal invocation
83 // and object construction.
84 bool IsConstructCall() const;
85
82 private: 86 private:
83 v8::Isolate* isolate_; 87 v8::Isolate* isolate_;
84 const v8::FunctionCallbackInfo<v8::Value>* info_; 88 const v8::FunctionCallbackInfo<v8::Value>* info_;
85 int next_; 89 int next_;
86 bool insufficient_arguments_; 90 bool insufficient_arguments_;
87 }; 91 };
88 92
89 } // namespace gin 93 } // namespace gin
90 94
91 #endif // GIN_ARGUMENTS_H_ 95 #endif // GIN_ARGUMENTS_H_
OLDNEW
« no previous file with comments | « no previous file | gin/arguments.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698