1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:18:11 +00:00

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
parent 2ea85355fe
commit c485c86015
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 {};
}