V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
js-break-iterator-inl.h
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_INTL_SUPPORT
6 #error Internationalization is expected to be enabled.
7 #endif // V8_INTL_SUPPORT
8 
9 #ifndef V8_OBJECTS_JS_BREAK_ITERATOR_INL_H_
10 #define V8_OBJECTS_JS_BREAK_ITERATOR_INL_H_
11 
12 #include "src/objects-inl.h"
13 #include "src/objects/js-break-iterator.h"
14 
15 // Has to be the last include (doesn't have include guards):
16 #include "src/objects/object-macros.h"
17 
18 namespace v8 {
19 namespace internal {
20 
21 inline void JSV8BreakIterator::set_type(Type type) {
22  DCHECK_GT(JSV8BreakIterator::Type::COUNT, type);
23  WRITE_FIELD(this, kTypeOffset, Smi::FromInt(static_cast<int>(type)));
24 }
25 
26 inline JSV8BreakIterator::Type JSV8BreakIterator::type() const {
27  Object* value = READ_FIELD(this, kTypeOffset);
28  return static_cast<JSV8BreakIterator::Type>(Smi::ToInt(value));
29 }
30 
31 ACCESSORS2(JSV8BreakIterator, locale, String, kLocaleOffset)
32 ACCESSORS(JSV8BreakIterator, break_iterator, Managed<icu::BreakIterator>,
33  kBreakIteratorOffset)
34 ACCESSORS(JSV8BreakIterator, unicode_string, Managed<icu::UnicodeString>,
35  kUnicodeStringOffset)
36 ACCESSORS(JSV8BreakIterator, bound_adopt_text, Object, kBoundAdoptTextOffset)
37 ACCESSORS(JSV8BreakIterator, bound_first, Object, kBoundFirstOffset)
38 ACCESSORS(JSV8BreakIterator, bound_next, Object, kBoundNextOffset)
39 ACCESSORS(JSV8BreakIterator, bound_current, Object, kBoundCurrentOffset)
40 ACCESSORS(JSV8BreakIterator, bound_break_type, Object, kBoundBreakTypeOffset)
41 
42 CAST_ACCESSOR(JSV8BreakIterator)
43 
44 } // namespace internal
45 } // namespace v8
46 
47 #include "src/objects/object-macros-undef.h"
48 
49 #endif // V8_OBJECTS_JS_BREAK_ITERATOR_INL_H_
Definition: libplatform.h:13