Home | History | Annotate | Download | only in src
      1 // Copyright 2018 the V8 project 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 #ifndef V8_ARGUMENTS_INL_H_
      6 #define V8_ARGUMENTS_INL_H_
      7 
      8 #include "src/arguments.h"
      9 
     10 #include "src/handles-inl.h"
     11 #include "src/objects-inl.h"
     12 
     13 namespace v8 {
     14 namespace internal {
     15 
     16 template <class S>
     17 Handle<S> Arguments::at(int index) {
     18   return Handle<S>::cast(at<Object>(index));
     19 }
     20 
     21 int Arguments::smi_at(int index) { return Smi::ToInt((*this)[index]); }
     22 
     23 double Arguments::number_at(int index) { return (*this)[index]->Number(); }
     24 
     25 }  // namespace internal
     26 }  // namespace v8
     27 
     28 #endif  // V8_ARGUMENTS_INL_H_
     29