LibJS: Use macros to enumerate well-known symbols

Not only is this a much nicer api (can't pass a typo'd string into the
get_well_known_symbol function), it is also a bit more performant since
there are no hashmap lookups.
This commit is contained in:
Matthew Olsson 2020-07-09 15:34:20 -07:00 committed by Andreas Kling
commit c485c86015
Notes: sideshowbarker 2024-07-19 04:56:37 +09:00
7 changed files with 42 additions and 31 deletions

View file

@ -36,7 +36,7 @@ Object* get_iterator(Object& obj, String hint, Value method)
if (method.is_empty()) {
if (hint == "async")
TODO();
method = obj.get(obj.interpreter().get_well_known_symbol("iterator"));
method = obj.get(obj.interpreter().well_known_symbol_iterator());
if (interpreter.exception())
return {};
}