NamespaceImports.h (3661B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * vim: set ts=8 sts=2 et sw=2 tw=80: 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 // This file imports some common JS:: names into the js namespace so we can 8 // make unqualified references to them. 9 10 #ifndef NamespaceImports_h 11 #define NamespaceImports_h 12 13 // These includes are needed these for some typedefs (e.g. HandleValue) and 14 // functions (e.g. NullValue())... 15 #include "js/CallNonGenericMethod.h" 16 #include "js/GCHashTable.h" 17 #include "js/GCVector.h" 18 #include "js/TypeDecls.h" 19 #include "js/Value.h" 20 21 // ... but we do forward declarations of the structs and classes not pulled in 22 // by the headers included above. 23 namespace JS { 24 25 using ValueVector = JS::GCVector<JS::Value>; 26 using IdVector = JS::GCVector<jsid>; 27 using ScriptVector = JS::GCVector<JSScript*>; 28 29 class HandleValueArray; 30 31 class ObjectOpResult; 32 33 class JS_PUBLIC_API PropertyDescriptor; 34 35 namespace Scalar {} 36 37 } // namespace JS 38 39 // Do the importing. 40 namespace js { 41 42 namespace Scalar = JS::Scalar; 43 44 using JS::BooleanValue; 45 using JS::DoubleValue; 46 using JS::Float32Value; 47 using JS::Int32Value; 48 using JS::MagicValue; 49 using JS::NullValue; 50 using JS::NumberValue; 51 using JS::ObjectOrNullValue; 52 using JS::ObjectValue; 53 using JS::PrivateGCThingValue; 54 using JS::PrivateUint32Value; 55 using JS::PrivateValue; 56 using JS::StringValue; 57 using JS::UndefinedValue; 58 using JS::Value; 59 using JS::ValueType; 60 61 using JS::Latin1Char; 62 using JS::UniqueChars; 63 using JS::UniqueLatin1Chars; 64 using JS::UniqueTwoByteChars; 65 using JS::UniqueWideChars; 66 67 using JS::Ok; 68 using JS::OOM; 69 using JS::Result; 70 71 using JS::HandleIdVector; 72 using JS::HandleObjectVector; 73 using JS::HandleValueVector; 74 using JS::MutableHandleIdVector; 75 using JS::MutableHandleObjectVector; 76 using JS::MutableHandleValueVector; 77 using JS::RootedIdVector; 78 using JS::RootedObjectVector; 79 using JS::RootedValueVector; 80 81 using JS::IdVector; 82 using JS::ScriptVector; 83 using JS::ValueVector; 84 85 using JS::GCHashMap; 86 using JS::GCHashSet; 87 using JS::GCVector; 88 89 using JS::CallArgs; 90 using JS::CallNonGenericMethod; 91 using JS::IsAcceptableThis; 92 using JS::NativeImpl; 93 94 using JS::Rooted; 95 using JS::RootedBigInt; 96 using JS::RootedField; 97 using JS::RootedFunction; 98 using JS::RootedId; 99 using JS::RootedObject; 100 using JS::RootedScript; 101 using JS::RootedString; 102 using JS::RootedSymbol; 103 using JS::RootedTuple; 104 using JS::RootedValue; 105 106 using JS::PersistentRooted; 107 using JS::PersistentRootedBigInt; 108 using JS::PersistentRootedFunction; 109 using JS::PersistentRootedId; 110 using JS::PersistentRootedObject; 111 using JS::PersistentRootedScript; 112 using JS::PersistentRootedString; 113 using JS::PersistentRootedSymbol; 114 using JS::PersistentRootedValue; 115 116 using JS::Handle; 117 using JS::HandleBigInt; 118 using JS::HandleFunction; 119 using JS::HandleId; 120 using JS::HandleObject; 121 using JS::HandleScript; 122 using JS::HandleString; 123 using JS::HandleSymbol; 124 using JS::HandleValue; 125 126 using JS::MutableHandle; 127 using JS::MutableHandleBigInt; 128 using JS::MutableHandleFunction; 129 using JS::MutableHandleId; 130 using JS::MutableHandleObject; 131 using JS::MutableHandleScript; 132 using JS::MutableHandleString; 133 using JS::MutableHandleSymbol; 134 using JS::MutableHandleValue; 135 136 using JS::FalseHandleValue; 137 using JS::NullHandleValue; 138 using JS::TrueHandleValue; 139 using JS::UndefinedHandleValue; 140 141 using JS::HandleValueArray; 142 143 using JS::ObjectOpResult; 144 145 using JS::PropertyDescriptor; 146 using JS::PropertyKey; 147 148 using JS::Compartment; 149 using JS::Realm; 150 using JS::Zone; 151 152 using JS::BigInt; 153 154 } /* namespace js */ 155 156 #endif /* NamespaceImports_h */