blob: 1fa2d66f94da2082ec00f3a2873e54997f9a4146 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_OBJECTS_INTL_OBJECTS_INL_H_
#define V8_OBJECTS_INTL_OBJECTS_INL_H_
#include "src/objects/intl-objects.h"
namespace v8 {
namespace internal {
inline Intl::Type Intl::TypeFromInt(int type_int) {
STATIC_ASSERT(Intl::Type::kNumberFormat == 0);
DCHECK_LE(Intl::Type::kNumberFormat, type_int);
DCHECK_GT(Intl::Type::kTypeCount, type_int);
return static_cast<Intl::Type>(type_int);
}
inline Intl::Type Intl::TypeFromSmi(Smi* type) {
return TypeFromInt(Smi::ToInt(type));
}
} // namespace internal
} // namespace v8
#endif // V8_OBJECTS_INTL_OBJECTS_INL_H_
|