Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Privatize JsValue's internals and expose it through a JsVariant (with immutable reference) #4080

Merged
merged 21 commits into from
Dec 19, 2024

Conversation

hansl
Copy link
Contributor

@hansl hansl commented Dec 10, 2024

Move JsValue to being a struct with an internal enumeration. This prevents people from deconstructing or constructing values directly, instead they should rely on helper methods (like as_*()) or using the JsVariant which contains references to the internal value.

The direction here is that we will change the interior representation of JsValue in the near future and this new representation will not be compatible with enum deconstruction / pattern matching.

There is no deprecation strategy here; every PR that add usage of JsValue as an enum will have a merge conflict or a test error. Every dependents doing the same will break when they update.

Fixes #3761.

@hansl hansl marked this pull request as draft December 10, 2024 19:25
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 55.58511% with 334 lines in your changes missing coverage. Please review.

Project coverage is 53.74%. Comparing base (6ddc2b4) to head (1cd5732).
Report is 320 commits behind head on main.

Files with missing lines Patch % Lines
core/engine/src/value/operations.rs 54.09% 56 Missing ⚠️
core/engine/src/value/mod.rs 77.86% 27 Missing ⚠️
core/engine/src/value/variant.rs 54.00% 23 Missing ⚠️
core/engine/src/value/conversions/try_from_js.rs 51.35% 18 Missing ⚠️
core/engine/src/object/builtins/jsdate.rs 0.00% 15 Missing ⚠️
core/engine/src/builtins/typed_array/builtin.rs 31.57% 13 Missing ⚠️
core/engine/src/object/builtins/jsset.rs 0.00% 10 Missing ⚠️
core/engine/src/builtins/temporal/duration/mod.rs 55.55% 8 Missing ⚠️
...ore/engine/src/builtins/temporal/plain_time/mod.rs 0.00% 8 Missing ⚠️
core/engine/src/object/builtins/jsfunction.rs 11.11% 8 Missing ⚠️
... and 45 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4080      +/-   ##
==========================================
+ Coverage   47.24%   53.74%   +6.50%     
==========================================
  Files         476      485       +9     
  Lines       46892    48139    +1247     
==========================================
+ Hits        22154    25874    +3720     
+ Misses      24738    22265    -2473     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hansl hansl marked this pull request as ready for review December 10, 2024 22:29
@hansl hansl requested a review from jasonwilliams December 10, 2024 22:29
@hansl hansl changed the title Jsvalue variant Privatize JsValue's internals and expose it through a JsVariant (with immutable reference) Dec 11, 2024
@nekevss nekevss requested a review from a team December 11, 2024 19:11
core/engine/src/value/mod.rs Outdated Show resolved Hide resolved
core/engine/src/value/mod.rs Outdated Show resolved Hide resolved
core/engine/src/value/mod.rs Outdated Show resolved Hide resolved
core/engine/src/value/mod.rs Outdated Show resolved Hide resolved
core/engine/src/value/mod.rs Outdated Show resolved Hide resolved
@hansl hansl requested a review from raskad December 16, 2024 22:51
@raskad
Copy link
Member

raskad commented Dec 17, 2024

Something is still bugged:

Test262 conformance changes:
| Test result | main |    PR   | difference |
|    Passed   | 43615  | 43423 |    192     |
|   Ignored   |  1471  | 1471  |     0      |
|   Failed    |  3539  | 3731  |    -192    |
|   Panics    |   0    |  203  |    -203    |

Broken tests (86):
test/language/statements/class/accessor-name-static/literal-numeric-non-canonical.js (previously Passed)
test/language/statements/class/accessor-name-inst/literal-numeric-non-canonical.js (previously Passed)
test/language/expressions/right-shift/S11.7.2_A5.1_T1.js (previously Passed)
test/language/expressions/left-shift/S11.7.1_A5.1_T1.js (previously Passed)
test/language/expressions/left-shift/S11.7.1_A5.2_T1.js (previously Passed)
test/language/expressions/left-shift/S9.5_A2.3_T1.js (previously Passed)
test/language/expressions/left-shift/S11.7.1_A4_T2.js (previously Passed)
test/language/expressions/left-shift/S11.7.1_A4_T1.js (previously Passed)
test/language/expressions/left-shift/S9.5_A2.1_T1.js (previously Passed)
test/language/expressions/left-shift/S11.7.1_A4_T4.js (previously Passed)
test/language/expressions/unsigned-right-shift/S9.6_A2.2.js (previously Passed)
test/language/expressions/unsigned-right-shift/S11.7.3_A5.1_T1.js (previously Passed)
test/language/expressions/unsigned-right-shift/S11.7.3_A4_T1.js (previously Passed)
test/language/expressions/unsigned-right-shift/S11.7.3_A4_T2.js (previously Passed)
test/language/expressions/bitwise-not/S9.5_A2.3_T2.js (previously Passed)
test/language/expressions/bitwise-not/S9.5_A2.1_T2.js (previously Passed)
test/language/expressions/class/accessor-name-static/literal-numeric-non-canonical.js (previously Passed)
test/language/expressions/class/accessor-name-inst/literal-numeric-non-canonical.js (previously Passed)
test/language/expressions/object/accessor-name-literal-numeric-non-canonical.js (previously Passed)
test/built-ins/Temporal/Duration/basic.js (previously Passed)
test/built-ins/Number/prototype/toFixed/S15.7.4.5_A1.4_T01.js (previously Passed)
test/built-ins/Math/clz32/Math.clz32_2.js (previously Passed)
test/built-ins/Math/imul/results.js (previously Passed)
test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-conversions-sab.js (previously Passed)
test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-conversions.js (previously Passed)
test/built-ins/TypedArray/prototype/sort/comparefn-is-undefined.js (previously Passed)
test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-is-undefined.js (previously Passed)
test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-simple-value.js (previously Passed)
test/built-ins/TypedArray/prototype/join/BigInt/custom-separator-result-from-tostring-on-each-simple-value.js (previously Passed)
test/built-ins/DataView/prototype/getUint32/return-values.js (previously Passed)
test/built-ins/DataView/prototype/setInt8/set-values-return-undefined.js (previously Passed)
test/built-ins/DataView/prototype/getInt32/return-values-sab.js (previously Passed)
test/built-ins/DataView/prototype/getInt32/return-values.js (previously Passed)
test/built-ins/DataView/prototype/setInt32/set-values-return-undefined.js (previously Passed)
test/built-ins/DataView/prototype/setFloat32/set-values-return-undefined.js (previously Passed)
test/built-ins/DataView/prototype/setUint8/set-values-return-undefined.js (previously Passed)
test/built-ins/DataView/prototype/setUint16/set-values-return-undefined.js (previously Passed)
test/built-ins/DataView/prototype/setInt16/set-values-return-undefined.js (previously Passed)
test/built-ins/String/S15.5.1.1_A1_T14.js (previously Passed)
test/built-ins/String/S15.5.2.1_A1_T16.js (previously Passed)
test/built-ins/String/S15.5.1.1_A1_T18.js (previously Passed)
test/built-ins/String/S9.8.1_A9_T1.js (previously Passed)
test/built-ins/String/S15.5.1.1_A1_T16.js (previously Passed)
test/built-ins/String/S15.5.2.1_A1_T18.js (previously Passed)
test/built-ins/String/S9.8.1_A10.js (previously Passed)
test/built-ins/String/S9.8.1_A9_T2.js (previously Passed)
test/built-ins/String/S9.8.1_A2.js (previously Passed)
test/built-ins/String/prototype/padStart/fill-string-non-strings.js (previously Passed)
test/built-ins/String/prototype/indexOf/searchstring-tostring.js (previously Passed)
test/built-ins/String/prototype/trim/15.5.4.20-2-19.js (previously Passed)
test/built-ins/String/prototype/trim/15.5.4.20-2-13.js (previously Passed)
test/built-ins/String/prototype/trim/15.5.4.20-2-6.js (previously Passed)
test/built-ins/String/prototype/trim/15.5.4.20-2-14.js (previously Passed)
test/built-ins/String/prototype/trim/15.5.4.20-2-21.js (previously Passed)
test/built-ins/String/prototype/trim/15.5.4.20-2-17.js (previously Passed)
test/built-ins/String/prototype/trim/15.5.4.20-2-16.js (previously Passed)
test/built-ins/String/prototype/trim/15.5.4.20-2-20.js (previously Passed)
test/built-ins/String/prototype/padEnd/fill-string-non-strings.js (previously Passed)
test/built-ins/JSON/stringify/value-number-negative-zero.js (previously Passed)
test/built-ins/JSON/parse/text-negative-zero.js (previously Passed)
test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-strict.js (previously Passed)
test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-non-strict.js (previously Passed)
test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-strict.js (previously Passed)
test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-non-strict.js (previously Passed)
test/built-ins/TypedArrayConstructors/internals/Set/conversion-operation.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-15.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-22.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-16.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-31.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-19.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-21.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-8.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-23.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-18.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-30.js (previously Passed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-2-24.js (previously Passed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-2-17.js (previously Passed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-2-20.js (previously Passed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-2-10.js (previously Passed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-2-18.js (previously Passed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-2-23.js (previously Passed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-2-21.js (previously Passed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-2-25.js (previously Passed)
test/built-ins/Array/S15.4.5.2_A1_T1.js (previously Passed)
test/annexB/built-ins/escape/argument_types.js (previously Passed)
test/annexB/built-ins/unescape/argument_types.js (previously Passed)

New panics (203):
test/language/expressions/in/S11.8.7_A4.js (previously Passed)
test/language/expressions/logical-or/S11.11.2_A4_T3.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/unary-expr.js (previously Passed)
test/language/expressions/concatenation/S9.8_A5_T2.js (previously Passed)
test/language/expressions/exponentiation/applying-the-exp-operator_A1.js (previously Passed)
test/language/expressions/exponentiation/applying-the-exp-operator_A7.js (previously Passed)
test/language/expressions/exponentiation/applying-the-exp-operator_A8.js (previously Passed)
test/language/expressions/exponentiation/applying-the-exp-operator_A15.js (previously Passed)
test/language/expressions/exponentiation/applying-the-exp-operator_A4.js (previously Passed)
test/language/expressions/optional-chaining/optional-chain-prod-expression.js (previously Passed)
test/language/expressions/logical-and/S11.11.1_A4_T3.js (previously Passed)
test/language/computed-property-names/object/property/number-duplicates.js (previously Passed)
test/intl402/supportedLocalesOf-throws-if-element-not-string-or-object.js (previously Passed)
test/intl402/supportedLocalesOf-test-option-localeMatcher.js (previously Failed)
test/intl402/Temporal/PlainYearMonth/from/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainYearMonth/compare/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainYearMonth/prototype/since/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainYearMonth/prototype/equals/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainYearMonth/prototype/until/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/Duration/prototype/round/relativeto-infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/Duration/prototype/total/relativeto-infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainDateTime/from/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainDateTime/compare/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainDateTime/prototype/since/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainDateTime/prototype/equals/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainDateTime/prototype/until/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainMonthDay/prototype/equals/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainMonthDay/prototype/toPlainDate/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainDate/from/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainDate/compare/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainDate/prototype/since/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainDate/prototype/equals/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/PlainDate/prototype/until/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/ZonedDateTime/from/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/ZonedDateTime/compare/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/ZonedDateTime/prototype/since/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/ZonedDateTime/prototype/equals/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Temporal/ZonedDateTime/prototype/until/infinity-throws-rangeerror.js (previously Failed)
test/intl402/Number/prototype/toLocaleString/this-number-value.js (previously Passed)
test/intl402/String/prototype/localeCompare/throws-same-exceptions-as-Collator.js (previously Passed)
test/intl402/DateTimeFormat/prototype/format/throws-value-non-finite.js (previously Failed)
test/built-ins/parseInt/S15.1.2.2_A1_T6.js (previously Passed)
test/built-ins/parseInt/S15.1.2.2_A1_T5.js (previously Passed)
test/built-ins/parseInt/S15.1.2.2_A1_T2.js (previously Passed)
test/built-ins/Atomics/pause/non-integral-iterationnumber-throws.js (previously Passed)
test/built-ins/Temporal/Instant/prototype/since/order-of-operations.js (previously Passed)
test/built-ins/Temporal/Instant/prototype/subtract/order-of-operations.js (previously Failed)
test/built-ins/Temporal/Instant/prototype/until/order-of-operations.js (previously Passed)
test/built-ins/Temporal/Instant/prototype/add/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainTime/from/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainTime/from/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/since/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/with/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/with/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/subtract/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/until/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/add/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainYearMonth/from/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainYearMonth/from/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainYearMonth/compare/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainYearMonth/prototype/since/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainYearMonth/prototype/with/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainYearMonth/prototype/toString/order-of-operations.js (previously Passed)
test/built-ins/Temporal/PlainYearMonth/prototype/equals/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainYearMonth/prototype/subtract/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainYearMonth/prototype/until/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainYearMonth/prototype/add/order-of-operations.js (previously Failed)
test/built-ins/Temporal/Duration/from/order-of-operations.js (previously Failed)
test/built-ins/Temporal/Duration/compare/relativeto-propertybag-infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/with/order-of-operations.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/round/order-of-operations.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/round/relativeto-infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/total/order-of-operations.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/total/relativeto-infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/subtract/order-of-operations.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/add/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/observable-get-overflow-argument-primitive.js (previously Passed)
test/built-ins/Temporal/PlainDateTime/from/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/compare/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/since/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/since/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/with/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/with/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/equals/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/subtract/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/until/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/until/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/add/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainMonthDay/from/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainMonthDay/from/observable-get-overflow-argument-string-invalid.js (previously Failed)
test/built-ins/Temporal/PlainMonthDay/from/observable-get-overflow-argument-primitive.js (previously Failed)
test/built-ins/Temporal/PlainMonthDay/from/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainMonthDay/prototype/with/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainMonthDay/prototype/toString/order-of-operations.js (previously Passed)
test/built-ins/Temporal/PlainMonthDay/prototype/equals/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/observable-get-overflow-argument-primitive.js (previously Passed)
test/built-ins/Temporal/PlainDate/from/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainDate/compare/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/since/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/since/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/with/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/with/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/subtract/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/until/order-of-operations.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/until/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/order-of-operations.js (previously Failed)
test/built-ins/Temporal/ZonedDateTime/from/order-of-operations.js (previously Failed)
test/built-ins/Temporal/ZonedDateTime/from/observable-get-overflow-argument-string-invalid.js (previously Failed)
test/built-ins/Temporal/ZonedDateTime/from/observable-get-overflow-argument-primitive.js (previously Failed)
test/built-ins/Temporal/ZonedDateTime/from/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/ZonedDateTime/compare/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/ZonedDateTime/prototype/since/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/ZonedDateTime/prototype/with/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/ZonedDateTime/prototype/equals/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/ZonedDateTime/prototype/subtract/order-of-operations.js (previously Failed)
test/built-ins/Temporal/ZonedDateTime/prototype/until/infinity-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/ZonedDateTime/prototype/add/order-of-operations.js (previously Failed)
test/built-ins/Number/S9.3.1_A2_U180E.js (previously Passed)
test/built-ins/Math/max/S15.8.2.11_A2.js (previously Passed)
test/built-ins/Math/pow/applying-the-exp-operator_A7.js (previously Passed)
test/built-ins/Math/pow/applying-the-exp-operator_A8.js (previously Passed)
test/built-ins/Math/pow/applying-the-exp-operator_A4.js (previously Passed)
test/built-ins/Math/min/S15.8.2.12_A2.js (previously Passed)
test/built-ins/Math/atan2/S15.8.2.5_A1.js (previously Passed)
test/built-ins/Math/atan2/S15.8.2.5_A8.js (previously Passed)
test/built-ins/TypedArray/prototype/set/array-arg-src-tonumber-value-conversions.js (previously Passed)
test/built-ins/TypedArray/prototype/fill/fill-values-conversion-operations.js (previously Passed)
test/built-ins/TypedArray/prototype/sort/sorted-values-nan.js (previously Passed)
test/built-ins/TypedArray/prototype/sort/sorted-values.js (previously Passed)
test/built-ins/TypedArray/prototype/sort/resizable-buffer-default-comparator.js (previously Passed)
test/built-ins/TypedArray/prototype/every/returns-false-if-any-cb-returns-false.js (previously Passed)
test/built-ins/TypedArray/prototype/every/BigInt/returns-false-if-any-cb-returns-false.js (previously Passed)
test/built-ins/TypedArray/prototype/some/returns-true-if-any-cb-returns-true.js (previously Passed)
test/built-ins/TypedArray/prototype/some/returns-false-if-every-cb-returns-false.js (previously Passed)
test/built-ins/TypedArray/prototype/some/BigInt/returns-true-if-any-cb-returns-true.js (previously Passed)
test/built-ins/TypedArray/prototype/some/BigInt/returns-false-if-every-cb-returns-false.js (previously Passed)
test/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js (previously Passed)
test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js (previously Passed)
test/built-ins/TypedArray/prototype/map/return-new-typedarray-conversion-operation.js (previously Passed)
test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js (previously Passed)
test/built-ins/DataView/prototype/setUint32/set-values-return-undefined.js (previously Passed)
test/built-ins/DataView/prototype/setFloat64/set-values-return-undefined.js (previously Passed)
test/built-ins/String/S15.5.1.1_A1_T12.js (previously Passed)
test/built-ins/String/15.5.5.5.2-3-6.js (previously Passed)
test/built-ins/String/15.5.5.5.2-3-7.js (previously Passed)
test/built-ins/String/S15.5.1.1_A1_T11.js (previously Passed)
test/built-ins/String/S15.5.2.1_A1_T5.js (previously Passed)
test/built-ins/String/15.5.5.5.2-3-3.js (previously Passed)
test/built-ins/String/S9.8.1_A4.js (previously Passed)
test/built-ins/String/S9.8.1_A1.js (previously Passed)
test/built-ins/String/15.5.5.5.2-3-4.js (previously Passed)
test/built-ins/String/prototype/toLocaleUpperCase/S15.5.4.19_A1_T7.js (previously Passed)
test/built-ins/String/prototype/toLocaleUpperCase/S15.5.4.19_A1_T8.js (previously Passed)
test/built-ins/String/prototype/toLocaleUpperCase/S15.5.4.19_A1_T6.js (previously Passed)
test/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T7.js (previously Passed)
test/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T8.js (previously Passed)
test/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T6.js (previously Passed)
test/built-ins/String/prototype/toUpperCase/S15.5.4.18_A1_T6.js (previously Passed)
test/built-ins/String/prototype/toUpperCase/S15.5.4.18_A1_T7.js (previously Passed)
test/built-ins/String/prototype/toUpperCase/S15.5.4.18_A1_T8.js (previously Passed)
test/built-ins/String/prototype/trim/15.5.4.20-2-3.js (previously Passed)
test/built-ins/String/prototype/trim/15.5.4.20-2-11.js (previously Passed)
test/built-ins/String/prototype/trim/15.5.4.20-2-9.js (previously Passed)
test/built-ins/String/prototype/trim/15.5.4.20-2-10.js (previously Passed)
test/built-ins/String/prototype/toLowerCase/S15.5.4.16_A1_T8.js (previously Passed)
test/built-ins/String/prototype/toLowerCase/S15.5.4.16_A1_T6.js (previously Passed)
test/built-ins/String/prototype/toLowerCase/S15.5.4.16_A1_T7.js (previously Passed)
test/built-ins/String/prototype/trimStart/this-value-number.js (previously Passed)
test/built-ins/String/prototype/trimEnd/this-value-number.js (previously Passed)
test/built-ins/JSON/stringify/replacer-array-number.js (previously Passed)
test/built-ins/TypedArrayConstructors/ctors/object-arg/conversion-operation.js (previously Passed)
test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation.js (previously Passed)
test/built-ins/isNaN/tonumber-operations.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-11.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-13.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-12.js (previously Passed)
test/built-ins/Object/defineProperty/15.2.3.6-2-5.js (previously Passed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-2-15.js (previously Passed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-2-13.js (previously Passed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-2-7.js (previously Passed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-2-14.js (previously Passed)
test/built-ins/isFinite/tonumber-operations.js (previously Passed)
test/built-ins/Array/property-cast-nan-infinity.js (previously Passed)
test/built-ins/Array/prototype/sort/S15.4.4.11_A2.2_T3.js (previously Passed)
test/built-ins/Array/prototype/sort/S15.4.4.11_A2.1_T3.js (previously Passed)
test/built-ins/Array/prototype/sort/S15.4.4.11_A3_T2.js (previously Passed)
test/built-ins/Array/prototype/sort/S15.4.4.11_A3_T1.js (previously Passed)
test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T3.js (previously Passed)
test/built-ins/Array/prototype/join/S15.4.4.5_A3.1_T1.js (previously Passed)
test/built-ins/Array/prototype/join/S15.4.4.5_A3.2_T1.js (previously Passed)
test/built-ins/RegExp/prototype/exec/failure-lastindex-set.js (previously Passed)
test/built-ins/parseFloat/S15.1.2.3_A1_T5.js (previously Passed)
test/built-ins/parseFloat/S15.1.2.3_A1_T6.js (previously Passed)
test/built-ins/parseFloat/S15.1.2.3_A1_T2.js (previously Passed)
test/annexB/built-ins/String/prototype/substr/start-and-length-as-numbers.js (previously Passed)
test/harness/assert-notsamevalue-nan.js (previously Passed)
test/harness/assertRelativeDateMs.js (previously Passed)
test/harness/compare-array-message.js (previously Passed)

@hansl
Copy link
Contributor Author

hansl commented Dec 18, 2024

Yes, I'll move some of these to unit tests to be easier to prevent regressions.

@hansl
Copy link
Contributor Author

hansl commented Dec 18, 2024

@raskad I've had to put back converting float to i32 as a float, and better compare with negative zero, but now it passes all tests and all test262 locally. This should be ready.

Copy link
Member

@raskad raskad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@raskad raskad added this to the next-release milestone Dec 18, 2024
@raskad raskad added the API label Dec 18, 2024
@raskad raskad requested a review from a team December 18, 2024 14:23
Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me. Nice work!

I had one nit, but its SUPER nitpicky and isn't really blocking merge at all.

core/engine/src/value/mod.rs Show resolved Hide resolved
@hansl hansl added this pull request to the merge queue Dec 19, 2024
Merged via the queue into boa-dev:main with commit 12faeca Dec 19, 2024
14 checks passed
@hansl hansl deleted the jsvalue-variant branch December 19, 2024 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restrict Direct Construction of JsValue to Ensure Invariants
3 participants