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

Test new_instance_should_point_to_prototype is not checked correctly #641

Closed
54k1 opened this issue Aug 18, 2020 · 0 comments · Fixed by #642
Closed

Test new_instance_should_point_to_prototype is not checked correctly #641

54k1 opened this issue Aug 18, 2020 · 0 comments · Fixed by #642
Labels
enhancement New feature or request test Issues and PRs related to the tests.
Milestone

Comments

@54k1
Copy link
Contributor

54k1 commented Aug 18, 2020

Describe the bug
The test just checks if the prototype of the instance is an object using the is_object method.

Consider the following js snippet (similar to the example in the test):

function Foo () {}
var bar = new Foo();

The test currently asserts typeof bar.__proto__ === "object"
Rather it should assert bar.__proto__ === Foo.prototype.

I guess the point of the test was to just check if bar.__proto__ was an object. But it's good to go one step further to assert that the prototype is correctly assigned to be Foo.prototype

@54k1 54k1 added the bug Something isn't working label Aug 18, 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 test Issues and PRs related to the tests. enhancement New feature or request and removed bug Something isn't working 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
enhancement New feature or request test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants