Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index a0990efd76340ac7bdca7d9ef79fce23a6ba3df0..c10a5b0c66287e77ab4b63f1478668a1c51ed481 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -7928,34 +7928,28 @@ Local<Symbol> v8::Symbol::ForApi(Isolate* isolate, Local<String> name) { |
i_isolate->SymbolFor(i::Heap::kApiSymbolTableRootIndex, i_name, false)); |
} |
- |
-Local<Symbol> v8::Symbol::GetIterator(Isolate* isolate) { |
- i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
- return Utils::ToLocal(i_isolate->factory()->iterator_symbol()); |
-} |
- |
- |
-Local<Symbol> v8::Symbol::GetUnscopables(Isolate* isolate) { |
- i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
- return Utils::ToLocal(i_isolate->factory()->unscopables_symbol()); |
-} |
- |
-Local<Symbol> v8::Symbol::GetToPrimitive(Isolate* isolate) { |
- i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
- return Utils::ToLocal(i_isolate->factory()->to_primitive_symbol()); |
-} |
- |
-Local<Symbol> v8::Symbol::GetToStringTag(Isolate* isolate) { |
- i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
- return Utils::ToLocal(i_isolate->factory()->to_string_tag_symbol()); |
-} |
- |
- |
-Local<Symbol> v8::Symbol::GetIsConcatSpreadable(Isolate* isolate) { |
- i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
- return Utils::ToLocal(i_isolate->factory()->is_concat_spreadable_symbol()); |
-} |
- |
+#define WELL_KNOWN_SYMBOLS(V) \ |
+ V(HasInstance, has_instance) \ |
+ V(IsConcatSpreadable, is_concat_spreadable) \ |
+ V(Iterator, iterator) \ |
+ V(Match, match) \ |
+ V(Replace, replace) \ |
+ V(Search, search) \ |
+ V(Split, split) \ |
+ V(ToPrimitive, to_primitive) \ |
+ V(ToStringTag, to_string_tag) \ |
+ V(Unscopables, unscopables) |
+ |
+#define SYMBOL_GETTER(Name, name) \ |
+ Local<Symbol> v8::Symbol::Get##Name(Isolate* isolate) { \ |
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); \ |
+ return Utils::ToLocal(i_isolate->factory()->name##_symbol()); \ |
+ } |
+ |
+WELL_KNOWN_SYMBOLS(SYMBOL_GETTER) |
+ |
+#undef SYMBOL_GETTER |
+#undef WELL_KNOWN_SYMBOLS |
Local<Private> v8::Private::New(Isolate* isolate, Local<String> name) { |
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |