-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve reflected attribute tests (html/dom/reflection.js)
* Fix reflection tests wrt valueOf Without a toString:null in test values that are objects with a valueOf method, the DOM attribute would actually be set to "[object Object]" without ever calling the valueOf method (effectively turning those tests into behaving exactly the same as the {"test": 6} ones). Most existing tests were passing because the implemented algorithms would actually compute a WRONG expected value. The only test that doesn't compute the expected value ("double") won't actually run because all reflected IDL attributes of type "double" have custom getters. Fixes #44315 * Fix reflection tests wrt -0 for "double" attributes Setting -0 to the IDL attribute will set the DOM attribute to "0" (per ECMAScript's ToString, from the rules for the the best representation of a number as a floating point number), and the rules for parsing flowting-point number values won't ever turn that "0" into a -0 value. This test value is never actually being used though, as all the reflected attributes of type "double" have custom getters. * Add a few more reflection tests around whitespace for numeric types Specifically leading non-ASCII whitespace following leading ASCII whitespace (should be rejected), and trailing non-ASCII whitespace (should be ignored) * Add a few more numeric values to reflection tests Specifically "+" and "-" to exercise all possible code paths of failures. * Add exponential notation to reflection tests of double values * Implement "limited double" in reflection tests * Implement the reflect algorithm for doubles This should make it easier to extend tests with more values.
- Loading branch information
Showing
1 changed file
with
182 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters