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

[Merged by Bors] - Fix equality between objects and undefined or null #1872

Closed
wants to merge 1 commit into from

Conversation

HalidOdat
Copy link
Member

This PR fixes equality between object and null or undefined (like [] == null), which was failing the test262 harness test compare-array-symbol.js.

@HalidOdat HalidOdat added bug Something isn't working execution Issues or PRs related to code execution labels Feb 27, 2022
@github-actions
Copy link

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 88,342 88,342 0
Passed 42,779 42,793 +14
Ignored 21,413 21,413 0
Failed 24,150 24,136 -14
Panics 12 12 0
Conformance 48.42% 48.44% +0.02%
Fixed tests (14):
test/language/computed-property-names/basics/symbol.js [strict mode] (previously Failed)
test/language/computed-property-names/basics/symbol.js (previously Failed)
test/language/computed-property-names/object/method/symbol.js [strict mode] (previously Failed)
test/language/computed-property-names/object/method/symbol.js (previously Failed)
test/built-ins/Reflect/ownKeys/order-after-define-property.js [strict mode] (previously Failed)
test/built-ins/Reflect/ownKeys/order-after-define-property.js (previously Failed)
test/built-ins/Object/getOwnPropertySymbols/order-after-define-property.js [strict mode] (previously Failed)
test/built-ins/Object/getOwnPropertySymbols/order-after-define-property.js (previously Failed)
test/built-ins/RegExp/named-groups/unicode-match.js [strict mode] (previously Failed)
test/built-ins/RegExp/named-groups/unicode-match.js (previously Failed)
test/built-ins/String/prototype/replaceAll/replaceValue-call-each-match-position.js (previously Failed)
test/built-ins/String/prototype/replaceAll/replaceValue-call-matching-empty.js (previously Failed)
test/harness/compare-array-symbol.js [strict mode] (previously Failed)
test/harness/compare-array-symbol.js (previously Failed)

@codecov
Copy link

codecov bot commented Feb 27, 2022

Codecov Report

Merging #1872 (9279606) into main (60e2294) will not change coverage.
The diff coverage is 50.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1872   +/-   ##
=======================================
  Coverage   46.67%   46.67%           
=======================================
  Files         204      204           
  Lines       16701    16701           
=======================================
  Hits         7796     7796           
  Misses       8905     8905           
Impacted Files Coverage Δ
boa_engine/src/value/equality.rs 90.00% <50.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60e2294...9279606. Read the comment docs.

@Razican Razican added this to the v0.14.0 milestone Feb 27, 2022
@Razican
Copy link
Member

Razican commented Feb 27, 2022

bors r+

bors bot pushed a commit that referenced this pull request Feb 27, 2022
This PR fixes equality between object and `null` or `undefined` (like `[] == null`), which was failing the test262 harness test [`compare-array-symbol.js`](https://github.com/tc39/test262/blob/18ce639a4c4768de337fa30b83bbb6de02b0e1a5/test/harness/compare-array-symbol.js).
@bors
Copy link

bors bot commented Feb 27, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Fix equality between objects and undefined or null [Merged by Bors] - Fix equality between objects and undefined or null Feb 27, 2022
@bors bors bot closed this Feb 27, 2022
@bors bors bot deleted the fix/object-equals branch February 27, 2022 17:08
@github-actions
Copy link

Benchmark for 19bf048

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 625.8±1.55ns 607.3±4.75ns -2.96%
Arithmetic operations (Execution) 2.3±0.00µs 2.3±0.02µs 0.00%
Arithmetic operations (Parser) 5.7±0.03µs 5.7±0.04µs 0.00%
Array access (Compiler) 1520.8±3.56ns 1484.3±11.79ns -2.40%
Array access (Execution) 11.7±0.05µs 12.1±0.61µs +3.42%
Array access (Parser) 12.5±0.14µs 12.7±0.07µs +1.60%
Array creation (Compiler) 2.1±0.01µs 2.2±0.02µs +4.76%
Array creation (Execution) 3.9±0.00ms 3.7±0.03ms -5.13%
Array creation (Parser) 14.1±0.19µs 14.4±0.06µs +2.13%
Array pop (Compiler) 4.3±0.02µs 4.1±0.04µs -4.65%
Array pop (Execution) 1761.4±167.00µs 1635.4±14.96µs -7.15%
Array pop (Parser) 146.2±1.65µs 148.7±0.27µs +1.71%
Boolean Object Access (Compiler) 1195.4±4.26ns 1187.4±8.90ns -0.67%
Boolean Object Access (Execution) 7.1±0.03µs 6.9±0.07µs -2.82%
Boolean Object Access (Parser) 15.2±0.17µs 15.7±0.15µs +3.29%
Clean js (Compiler) 3.9±0.01µs 3.9±0.02µs 0.00%
Clean js (Execution) 1305.9±9.77µs 1276.8±31.47µs -2.23%
Clean js (Parser) 30.5±0.22µs 31.0±0.28µs +1.64%
Create Realm 330.1±17.58ns 315.7±1.76ns -4.36%
Dynamic Object Property Access (Compiler) 1882.3±10.75ns 1890.9±17.97ns +0.46%
Dynamic Object Property Access (Execution) 8.0±0.03µs 7.9±0.09µs -1.25%
Dynamic Object Property Access (Parser) 11.0±0.09µs 11.2±0.10µs +1.82%
Fibonacci (Compiler) 2.6±0.01µs 2.6±0.04µs 0.00%
Fibonacci (Execution) 2.1±0.01ms 2.1±0.01ms 0.00%
Fibonacci (Parser) 17.0±0.22µs 17.4±0.12µs +2.35%
For loop (Compiler) 2.3±0.01µs 2.3±0.03µs 0.00%
For loop (Execution) 51.1±0.34µs 49.2±0.69µs -3.72%
For loop (Parser) 14.8±0.18µs 14.9±0.10µs +0.68%
Mini js (Compiler) 3.8±0.01µs 3.8±0.01µs 0.00%
Mini js (Execution) 1208.4±17.89µs 1166.0±14.72µs -3.51%
Mini js (Parser) 26.6±0.18µs 27.1±0.29µs +1.88%
Number Object Access (Compiler) 1105.3±4.46ns 1126.2±6.30ns +1.89%
Number Object Access (Execution) 5.5±0.02µs 5.4±0.03µs -1.82%
Number Object Access (Parser) 11.6±0.12µs 12.1±0.24µs +4.31%
Object Creation (Compiler) 1635.1±8.98ns 1615.5±15.77ns -1.20%
Object Creation (Execution) 7.2±0.03µs 7.3±0.03µs +1.39%
Object Creation (Parser) 9.7±0.11µs 9.9±0.04µs +2.06%
RegExp (Compiler) 1926.2±6.73ns 1884.9±19.41ns -2.14%
RegExp (Execution) 14.2±0.09µs 14.4±0.17µs +1.41%
RegExp (Parser) 10.6±0.11µs 10.7±0.16µs +0.94%
RegExp Creation (Compiler) 1686.9±10.02ns 1624.9±14.04ns -3.68%
RegExp Creation (Execution) 10.6±0.04µs 11.0±0.11µs +3.77%
RegExp Creation (Parser) 8.8±0.08µs 8.9±0.09µs +1.14%
RegExp Literal (Compiler) 1907.1±21.85ns 1912.4±19.88ns +0.28%
RegExp Literal (Execution) 14.1±0.03µs 14.5±0.11µs +2.84%
RegExp Literal (Parser) 8.6±0.10µs 8.6±0.12µs 0.00%
RegExp Literal Creation (Compiler) 1642.5±9.69ns 1663.8±18.80ns +1.30%
RegExp Literal Creation (Execution) 10.6±0.03µs 11.0±0.14µs +3.77%
RegExp Literal Creation (Parser) 6.7±0.09µs 6.8±0.04µs +1.49%
Static Object Property Access (Compiler) 1654.7±9.10ns 1705.5±92.37ns +3.07%
Static Object Property Access (Execution) 7.6±0.02µs 7.4±0.07µs -2.63%
Static Object Property Access (Parser) 10.4±0.12µs 10.6±0.08µs +1.92%
String Object Access (Compiler) 1615.1±7.56ns 1591.0±14.26ns -1.49%
String Object Access (Execution) 9.1±0.05µs 8.9±0.10µs -2.20%
String Object Access (Parser) 15.0±0.16µs 15.4±0.11µs +2.67%
String comparison (Compiler) 2.5±0.01µs 2.5±0.02µs 0.00%
String comparison (Execution) 6.9±0.04µs 6.8±0.07µs -1.45%
String comparison (Parser) 11.7±0.12µs 11.8±0.06µs +0.85%
String concatenation (Compiler) 2.1±0.10µs 1950.4±17.56ns -7.12%
String concatenation (Execution) 6.5±0.23µs 6.2±0.06µs -4.62%
String concatenation (Parser) 7.9±0.08µs 8.0±0.01µs +1.27%
String copy (Compiler) 1545.6±3.36ns 1526.0±10.10ns -1.27%
String copy (Execution) 5.6±0.02µs 5.6±0.05µs 0.00%
String copy (Parser) 5.9±0.03µs 5.8±0.04µs -1.69%
Symbols (Compiler) 1069.1±4.05ns 1081.8±17.12ns +1.19%
Symbols (Execution) 5.3±0.02µs 5.3±0.07µs 0.00%
Symbols (Parser) 4.4±0.04µs 4.5±0.03µs +2.27%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working execution Issues or PRs related to code execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants