1 // Copyright 2017 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_OBJECTS_INTL_OBJECTS_INL_H_ 6 #define V8_OBJECTS_INTL_OBJECTS_INL_H_ 7 8 #include "src/objects/intl-objects.h" 9 10 #include "src/objects-inl.h" 11 12 namespace v8 { 13 namespace internal { 14 TypeFromInt(int type_int)15inline Intl::Type Intl::TypeFromInt(int type_int) { 16 STATIC_ASSERT(Intl::Type::kNumberFormat == 0); 17 DCHECK_LE(Intl::Type::kNumberFormat, type_int); 18 DCHECK_GT(Intl::Type::kTypeCount, type_int); 19 return static_cast<Intl::Type>(type_int); 20 } 21 TypeFromSmi(Smi * type)22inline Intl::Type Intl::TypeFromSmi(Smi* type) { 23 return TypeFromInt(Smi::ToInt(type)); 24 } 25 26 } // namespace internal 27 } // namespace v8 28 29 #endif // V8_OBJECTS_INTL_OBJECTS_INL_H_ 30