feat: implement [[IsHTMLDDA]] internal slot (Annex B §B.3.6)#4980
feat: implement [[IsHTMLDDA]] internal slot (Annex B §B.3.6)#4980jedel1043 merged 5 commits intoboa-dev:mainfrom
Conversation
Test262 conformance changes
Fixed tests (32):Tested main commit: |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4980 +/- ##
===========================================
+ Coverage 47.24% 58.20% +10.95%
===========================================
Files 476 559 +83
Lines 46892 61404 +14512
===========================================
+ Hits 22154 35740 +13586
- Misses 24738 25664 +926 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jedel1043
left a comment
There was a problem hiding this comment.
We also need to gate every related to IsHTMLDDA behind the annex-b feature, because we don't wanna bundle this in builds that don't care about web compatibility.
| if search_value.is_object() | ||
| && !search_value | ||
| .as_object() | ||
| .is_some_and(|o| o.is::<IsHTMLDDA>()) |
There was a problem hiding this comment.
I don't think changing this is correct. According to the specification:
From the perspective of the ECMAScript language, language values are compared for equality using the SameValue abstract operation and the abstract operations it transitively calls.
So even if [[IsHTMLDDA]] objects act like undefined, per the spec semantics they should evaluate to not equal to undefined.
4232eb7 to
9dcf0a8
Compare
…rect String.prototype changes
| #[cfg(feature = "annex-b")] | ||
| if obj.is::<IsHTMLDDA>() { | ||
| return false; | ||
| } | ||
| let _ = obj; | ||
| true |
There was a problem hiding this comment.
You should use a match guard here to avoid the weird let _ assignment
#[cfg(feature = "annex-b")]
Self::Object(obj) if obj.is::<IsHTMLDDA>() =>Also applies to the nan boxed version
This Pull Request implements the
[[IsHTMLDDA]]internal slot (ECMAScript Annex B §B.3.6), enabling correct handling ofdocument.all-like objects.It changes the following:
IsHTMLDDAmarker struct with a custom[[Call]]internal method that returnsundefined(builtins/is_html_dda.rs)typeofoperator to return"undefined"for objects with[[IsHTMLDDA]](value/variant.rs)ToBooleanto returnfalsefor objects with[[IsHTMLDDA]](value/inner/nan_boxed.rs,value/inner/legacy.rs)==) so that[[IsHTMLDDA]]objects are loosely equal tonullandundefined(value/equality.rs)String.prototype.{match,matchAll,replace,replaceAll,search,split}to treat[[IsHTMLDDA]]objects as "undefined or null" in the spec's "neither undefined nor null" check (builtins/string/mod.rs)$262.IsHTMLDDAto the Test262 harness (tests/tester/src/exec/js262.rs)IsHTMLDDAfrom ignored features intest262_config.toml