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:
parent
2ea85355fe
commit
c485c86015
7 changed files with 42 additions and 31 deletions
|
@ -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 {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue