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

Core: Ensure inherited getters are not invoked by assert.deepEqual #1326

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 24, 2018

  1. Core: Ensure inherited getters are not invoked by assert.deepEqual.

    Previously, given the following:
    
    ```js
    class Foo {
      constructor(a = 1) {
        this.a = a;
      }
    }
    
    Object.defineProperty(Foo.prototype, 'b', {
      enumerable: true,
      get() {
        return new Foo(this.a + 1);
      }
    })
    
    QUnit.test( "hello test", function( assert ) {
      assert.deepEqual(new Foo(), new Foo());
    });
    ```
    
    The `assert.deepEqual` invocation would never complete (ultimately
    crashing the tab or node process).
    
    The changes here ensure that inherited descriptors (getter / setter _or_
    value only) are compared without invoking the getter therefore
    preventing the issue mentioned above.
    rwjblue committed Oct 24, 2018
    Configuration menu
    Copy the full SHA
    54aad99 View commit details
    Browse the repository at this point in the history