mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
This algorithm is quite straightforward written in the specification, but leads to some type awkwardness in Rust. Most notably, the callbacks have different types and cannot be unified easily. They also return different string types. Similarly, the returning objects are all unique types and don't have a common denominator. Therefore, rather than implementing it in 1-to-1 fashion with the specification text, it instead uses callbacks to instruct the type system of what to call when. This is further complicated by the fact that the callback can exist or not, as well as return a value or not. This requires multiple unwrangling, combined with the fact that the algorithm should throw or not. All in all, the number of lines is relatively low compared to the specification algorithm and the Rust compiler does a lot of heavy lifting figuring out which type is what. Part of https://github.com/servo/servo/issues/36258 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net> |
||
---|---|---|
.. | ||
codegen | ||
webidls | ||
build.rs | ||
callback.rs | ||
Cargo.toml | ||
constant.rs | ||
constructor.rs | ||
conversions.rs | ||
error.rs | ||
finalize.rs | ||
guard.rs | ||
import.rs | ||
inheritance.rs | ||
interface.rs | ||
interfaces.rs | ||
iterable.rs | ||
lib.rs | ||
like.rs | ||
lock.rs | ||
mem.rs | ||
namespace.rs | ||
num.rs | ||
principals.rs | ||
proxyhandler.rs | ||
realms.rs | ||
record.rs | ||
reflector.rs | ||
root.rs | ||
script_runtime.rs | ||
settings_stack.rs | ||
str.rs | ||
trace.rs | ||
utils.rs | ||
weakref.rs |