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

Fix wrong call to the underlying method when checking if an object is frozen #490

Merged
merged 1 commit into from Jul 18, 2015

Conversation

Projects
None yet
2 participants
@astorije
Member

astorije commented Jul 17, 2015

No description provided.

@keithamus

This comment has been minimized.

Show comment
Hide comment
@keithamus

keithamus Jul 18, 2015

Member

Ooops, good call. Missed that in the PR. Thanks @astorije

Member

keithamus commented Jul 18, 2015

Ooops, good call. Missed that in the PR. Thanks @astorije

keithamus added a commit that referenced this pull request Jul 18, 2015

Merge pull request #490 from astorije/patch-2
Fix wrong call to the underlying method when checking if an object is frozen

@keithamus keithamus merged commit 0d5e87a into chaijs:master Jul 18, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@astorije

This comment has been minimized.

Show comment
Hide comment
@astorije

astorije Jul 18, 2015

Member

For the record, here is why this buggy version passes the tests:

> var v = { foo: "bar" }
undefined
> Object.isSealed(v)
false
> Object.isFrozen(v)
false
> Object.freeze(v)
{ foo: 'bar' }
> Object.isSealed(v)
true
> Object.isFrozen(v)
true

So if you are frozen, you are sealed.

(Note that the opposite is not true:

> var v2 = { foo: "bar" }
undefined
> Object.isSealed(v2)
false
> Object.isFrozen(v2)
false
> Object.seal(v2)
{ foo: 'bar' }
> Object.isSealed(v2)
true
> Object.isFrozen(v2)
false

)

Member

astorije commented Jul 18, 2015

For the record, here is why this buggy version passes the tests:

> var v = { foo: "bar" }
undefined
> Object.isSealed(v)
false
> Object.isFrozen(v)
false
> Object.freeze(v)
{ foo: 'bar' }
> Object.isSealed(v)
true
> Object.isFrozen(v)
true

So if you are frozen, you are sealed.

(Note that the opposite is not true:

> var v2 = { foo: "bar" }
undefined
> Object.isSealed(v2)
false
> Object.isFrozen(v2)
false
> Object.seal(v2)
{ foo: 'bar' }
> Object.isSealed(v2)
true
> Object.isFrozen(v2)
false

)

@astorije

This comment has been minimized.

Show comment
Hide comment
@astorije

astorije Jul 18, 2015

Member

@keithamus, can you quickly release version 3.1.1 to make sure anyone who gladly switched to version 3.1.x to have these methods does not fall in this bug?

Member

astorije commented Jul 18, 2015

@keithamus, can you quickly release version 3.1.1 to make sure anyone who gladly switched to version 3.1.x to have these methods does not fall in this bug?

@astorije astorije deleted the astorije:patch-2 branch Jul 18, 2015

@renovate renovate bot referenced this pull request Feb 2, 2018

Open

Update dependency chai to v4 #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment