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

[exec - function] function.prototype doesn't have own constructor property pointing to this function #533

Closed
croraf opened this issue Jun 27, 2020 · 0 comments · Fixed by #642
Labels
bug Something isn't working builtins PRs and Issues related to builtins/intrinsics execution Issues or PRs related to code execution
Milestone

Comments

@croraf
Copy link
Contributor

croraf commented Jun 27, 2020

Describe the bug

function.prototype should have an own constructor property pointing back to that function.

To Reproduce

const a = function asd() {};
a

Expected behavior
Should output this:

{
  constructor: {
    name: asd,
      prototype: [Cycle],
        length: 0,
          __proto__: {
      constructor: {
        name: Function,
          prototype: [Cycle],
            length: 1,
              __proto__: undefined
      },
      __proto__: undefined
    }
  },
  __proto__: {
    constructor: {
      setPrototypeOf: {
        length: 2
      },
      prototype: [Cycle],
        name: Object,
          length: 1,
            defineProperty: {
        length: 3
      },
      getPrototypeOf: {
        length: 1
      },
      is: {
        length: 2
      },
      __proto__: {
        constructor: {
          name: Function,
            prototype: [Cycle],
              length: 1,
                __proto__: undefined
        },
        __proto__: undefined
      }
    },
    hasOwnProperty: {
      length: 0
    },
    propertyIsEnumerable: {
      length: 0
    },
    toString: {
      length: 0
    }
  }
}

Instead top level constructor field is not present in the response.

@croraf croraf added the bug Something isn't working label Jun 27, 2020
@54k1 54k1 mentioned this issue Aug 18, 2020
@Razican Razican linked a pull request Aug 18, 2020 that will close this issue
@Razican Razican added builtins PRs and Issues related to builtins/intrinsics execution Issues or PRs related to code execution labels Aug 19, 2020
@Razican Razican added this to the v0.10.0 milestone Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working builtins PRs and Issues related to builtins/intrinsics execution Issues or PRs related to code execution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants