diff options
Diffstat (limited to 'deps/v8/src/debug/interface-types.h')
-rw-r--r-- | deps/v8/src/debug/interface-types.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/deps/v8/src/debug/interface-types.h b/deps/v8/src/debug/interface-types.h index 71bf7fd187..76bd29651d 100644 --- a/deps/v8/src/debug/interface-types.h +++ b/deps/v8/src/debug/interface-types.h @@ -9,7 +9,9 @@ #include "include/v8-function-callback.h" #include "include/v8-local-handle.h" +#include "src/base/logging.h" #include "src/base/macros.h" +#include "v8-isolate.h" namespace v8 { @@ -89,15 +91,30 @@ class V8_EXPORT_PRIVATE BreakLocation : public Location { BreakLocationType type_; }; -class ConsoleCallArguments : private v8::FunctionCallbackInfo<v8::Value> { +class ConsoleCallArguments { public: - int Length() const { return v8::FunctionCallbackInfo<v8::Value>::Length(); } - V8_INLINE Local<Value> operator[](int i) const { - return v8::FunctionCallbackInfo<v8::Value>::operator[](i); + int Length() const { return length_; } + /** + * Accessor for the available arguments. Returns `undefined` if the index + * is out of bounds. + */ + V8_INLINE v8::Local<v8::Value> operator[](int i) const { + // values_ points to the first argument. + if (i < 0 || length_ <= i) return Undefined(GetIsolate()); + DCHECK_NOT_NULL(values_); + return Local<Value>::FromSlot(values_ + i); } + V8_INLINE v8::Isolate* GetIsolate() const { return isolate_; } + explicit ConsoleCallArguments(const v8::FunctionCallbackInfo<v8::Value>&); - explicit ConsoleCallArguments(const internal::BuiltinArguments&); + explicit ConsoleCallArguments(internal::Isolate* isolate, + const internal::BuiltinArguments&); + + private: + v8::Isolate* isolate_; + internal::Address* values_; + int length_; }; class ConsoleContext { |